Bridge Commander Central

BC Forums => BC Modding => Topic started by: tiqhud on July 16, 2008, 11:30:55 AM

Title: Spotlights
Post by: tiqhud on July 16, 2008, 11:30:55 AM
I have been trying to think of a way to make a spotlight, [you remember, likke the galaxy had in the TNG episode "the Pheonix] but may be I'm thinging wrong cause I'm at a loss. Not that bigg of a deal, just thought It might be handy.
Title: Re: Spotlights
Post by: Aeries on July 16, 2008, 02:06:09 PM
Does BC even support directional lighting like that? The only thing I can think of that emit light are suns and the alpha maps used on ships. Otherwise I'm pretty sure what you're suggesting isn't possible with the BC engine... somebody please prove me wrong? xD
Title: Re: Spotlights
Post by: laguardia528 on July 16, 2008, 04:28:13 PM
just a shot in the dark here but couldn't it be made by using a trnsparent texture extending out from the ship then having that section lit up like a christmas tree?
Title: Re: Spotlights
Post by: MLeo on July 16, 2008, 06:12:03 PM
Let's get out our trusty App.py

And the class LightPlacement has ConfigSpotLight

This thread has more on lights (though not neccesairly everything):
http://bc-central.net/forums/index.php/topic,3888.0.html
Title: Re: Spotlights
Post by: tiqhud on July 16, 2008, 09:20:46 PM
Let's get out our trusty App.py

And the class LightPlacement has ConfigSpotLight

This thread has more on lights (though not neccesairly everything):
http://bc-central.net/forums/index.php/topic,3888.0.html
read that, but isnt that for a system?

I dont see how it can be placed on a moving ship, hmmm
Title: Re: Spotlights
Post by: MLeo on July 17, 2008, 06:10:09 AM
A LightPlacement is an object that is part of the system.

Systems are just code that run once when a Set (what BC calls Systems) is loaded.
The code in a System definition could be run at any time (assuming a set is loaded of course).

Since a LightPlacement, just as a Ship are objects that are part of a system, they both have the AttachObject function, so you create a LightPlacement after the game has started, such as when you click on a button, set it to the location 0,0,0 (or where it is supposed to be on the ship), you configure the light of course, and then do pShip.AttachObject(pSpotLight) (or something similar of course!). Now the spotlight will always move when the ship moves, and turns when the ship turns (as if it's a fixed part of the ship).
Title: Re: Spotlights
Post by: tiqhud on July 17, 2008, 09:31:13 AM
A LightPlacement is an object that is part of the system.

Systems are just code that run once when a Set (what BC calls Systems) is loaded.
The code in a System definition could be run at any time (assuming a set is loaded of course).

Since a LightPlacement, just as a Ship are objects that are part of a system, they both have the AttachObject function, so you create a LightPlacement after the game has started, such as when you click on a button, set it to the location 0,0,0 (or where it is supposed to be on the ship), you configure the light of course, and then do pShip.AttachObject(pSpotLight) (or something similar of course!). Now the spotlight will always move when the ship moves, and turns when the ship turns (as if it's a fixed part of the ship).
HMMMM OK, not sure what I can do since I got the KM1 app.pyc [ and they added more to the app.py, that is in the SDK,the sizes don't match, I m going to try a different route, for now]
Title: Re: Spotlights
Post by: Kirk on July 17, 2008, 09:34:33 AM
Did you check the source folder that came with KM?
Title: Re: Spotlights
Post by: tiqhud on July 17, 2008, 11:15:51 AM
Did you check the source folder that came with KM?
YEP, and it is not there [no biggy tho]

and my apologizes it was in the episode "Pegesus not pheonix, I had just read the word pheonix and it stuck

Title: Re: Spotlights
Post by: limey BSc. on July 17, 2008, 11:50:01 AM
I just looked at all the stuff included in KM (not the source folder, the actual scripts folder) and neither app.py or app.pyc was in there. I'm pretty sure neither were modified.
Title: Re: Spotlights
Post by: MLeo on July 17, 2008, 01:31:11 PM
There isn't any reason why anyone would edit App.py, atleast no reason, at all, to edit it directly.


The LightPlacement class starts around 8992 (can't be entirely sure, since it doesn't, directly, show a line number).

You can create one through App.LightPlacement_Create
And it has 4 functions, ConfigAmbientLight, ConfigDirectionalLight, ConfigPointLight, ConfigSpotLight