Help! Dynamic changes of the sky and sun
by Petter Holmberg · in Torque Game Engine · 04/26/2005 (12:44 pm) · 4 replies
I need to add script support for changing sky and sun parameters during a running game. I know how to access and change the parameters of these objects, but simply changing them won't result in a visible change. I want the effect that you get when changing something in the world editor and clicking on the "Apply" button. For instance, if you'd change the sun's ambience to red and clicked on "Apply", everything would look red. This does not happen if you simply change the ambience parameter of the sun object though, because it needs to update somehow. Relighting the scene doesn't do it. I haven't figured out what happens when the "Apply" button is pressed here, and if I can easily do the same operation from the script, or by adding a source code function call somewhere.
Does anyone have an idea of how to solve this problem and get in-game updates of the sky and sun via scripted calls?
Does anyone have an idea of how to solve this problem and get in-game updates of the sky and sun via scripted calls?
#2
You could try looking in the common directory under editors and see what you can find. I haven't played with dynamic changes to the skyboxes.
04/26/2005 (1:10 pm)
As he is not a licensed Torque developer, it will be quite difficult to utilize the resources as I believe they all deal with the C++ side rather than the TorqueScript side.You could try looking in the common directory under editors and see what you can find. I haven't played with dynamic changes to the skyboxes.
#3
There's a handy resource here for time and weather. I haven't run it yet but I looked at the source code. It doesn't appear to do anything with the sun depending on the time though. Neither changing any sky parameters besides fog and clouds, which are scriptable already.
04/26/2005 (1:19 pm)
Hmm, thanks for your input. But the question remains. Maybe it indeed deals with the C++ side. I've checked the editor code, and it does some stuff that might or might not change this. I'm also not sure if this is the right thing to do from another place in the script. In any case, the code I'm talking about cannot be used like that in the script part I'm working with at the moment.There's a handy resource here for time and weather. I haven't run it yet but I looked at the source code. It doesn't appear to do anything with the sun depending on the time though. Neither changing any sky parameters besides fog and clouds, which are scriptable already.
#4
04/26/2005 (1:25 pm)
Oops hehe, didn't look to see if he was an owner or not.
Torque Owner Dreamer
Default Studio Name