Start and stop rain
by Michael Schaumburg · in Torque Game Engine · 02/09/2005 (10:36 am) · 8 replies
I like to have random start and stop of raining in our game but have no idea
to make it. I have the functions startRain() and stopRain(). How can I call these
functions randomly ???
Any idea will be great ..
to make it. I have the functions startRain() and stopRain(). How can I call these
functions randomly ???
Any idea will be great ..
#2
I've posted the full code in the forums before... if people want I could post it again
02/09/2005 (10:46 am)
Below is basically the code I used for part of a Random Weather system in Tribes 2. It worked fine in Torque the last time I checked.function initStorm()
{
%rainstart = %stormstart + getrandom(35,90);
%rainend = %stormstart + getrandom(120,240);
Precipitation.setStorm(%rainstart, 30, 1, %rainend, 40, 0);
}
function Precipitation::setStorm(%obj, %inStartT, %inLengthT, %inPer, %outStartT, %outLengthT, %outPer)
{
if(%inStartT < %outStartT)
%obj.stormShow(false);
else
%obj.stormShow(true);
%obj.schedule(%inStartT*1000, "stormPrecipitation", %inPer, %inLengthT);
%obj.schedule(%outStartT*1000, "stormPrecipitation", %outPer, %outLengthT);
}I've posted the full code in the forums before... if people want I could post it again
#4
Some Info .
The new precipitation dont have setStorm , stormShow and moore.
02/09/2005 (11:29 am)
@LabratSome Info .
The new precipitation dont have setStorm , stormShow and moore.
#5
02/09/2005 (11:35 am)
Billy, it's an example of his old code for Tribes II. I don't think it's meant to be a drop-in thing and it's easy to adapt it to current Torque IMO.
#6
02/09/2005 (2:59 pm)
In the demo the rain is started and stopped by simply adding and deleting the Precipitation object from the mission.
#7
02/10/2005 (12:08 am)
Hmm.. I'll have to look at how storms are handled in TGE now.
#8
I need. Thanks.....
02/11/2005 (12:39 am)
I got it working with the resource Dirk has posted. I was digging into this code and took whatI need. Thanks.....
Associate Anthony Rosenbaum