Help!!! with moon phases, or faking it...
by Svengali · in Torque 3D Beginner · 02/06/2011 (8:24 pm) · 4 replies
Ok, so I'm installing time tracking, moon phases, and dynamic weather in my project. Everything is going quite well, with the exception of one thing. I cannot get the moon to change phases. I'm using a Scattersky with the night box, and moon material. I can change the field value for scattersky.moonMat, but the material is never updated in game. I'm trying to do it on the client side, and have tried to use changeMaterial(),.setBitmap() (this was before I noticed it changes somewhere along the line to beta 3), and a couple of other methods. Anyone have any idea how to get this to work? Or maybe an idea on a different way to do this? I'm more than willing to fake it, but I'm not sure where to start. Thanks in advance!
About the author
Creator of SvengaliGames, and developing the once up coming title NightLife: The MMORPG Of Dark Horror. Now named ATROX NOCTIS: Daemons Cradle- www.svengaligames.com
#2
If you could check that your method will work on the final I greatly appreciate it. I can't tell you how many systems I've had to rewrite each time we switch beta versions, lol.
Thanks again for your time.
02/07/2011 (7:44 am)
Thanks for the quick response. Of course, I was working on this same issue all night in my sleep. I have not used setDirtyMask before, but it sounds like it may be the solution to a couple of small nit-picky things I need to fix. During my sleep (yes I know it's odd to program in dreams...) the best thing I came up with was actually creating the scattersky though a script object, and deleting it when the phase changes then recreating it.If you could check that your method will work on the final I greatly appreciate it. I can't tell you how many systems I've had to rewrite each time we switch beta versions, lol.
Thanks again for your time.
#3
ScatterSky has a "applyChanges" method that you can call from script. This triggers a resend of the sky data to the client and should do away with the problem here.
Sorry for not seeing that sooner.
02/10/2011 (2:25 am)
Ha, I actually overlooked something.ScatterSky has a "applyChanges" method that you can call from script. This triggers a resend of the sky data to the client and should do away with the problem here.
YourSkyObject.moonMat = MyMoonMaterial; YourSkyObject.applyChanges();
Sorry for not seeing that sooner.
#4
02/12/2011 (4:01 pm)
Thanks for your help!
Associate Rene Damm
What's necessary is for the respective fields to become protected fields and trigger a setMaskBits(UpdateMask) when they change value. I'll take a look at this today and make sure that's corrected for 1.1 final.
//Edit: I'll also post the changes here.