Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 1,403 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
good snow and rain script #110240
02/01/07 14:27
02/01/07 14:27
Joined: Oct 2005
Posts: 42
A
aslan123 Offline OP
Newbie
aslan123  Offline OP
Newbie
A

Joined: Oct 2005
Posts: 42
just call the functions snow_start() or rain_start() in your main function or where ever you want it to start


/////////snow script///////////////////
DEFINE Weather_snow,2;

VAR Snow_strenght = 20; //strenght of snow
VAR Snow_Radius = 400; //radius of snow
VAR Snow_Fallspeed = -15; //fallspeed snow

FUNCTION snow_start(); //starts snowfall

BMAP bsnow = <snow.tga>;

FUNCTION s_spec()
{
my.skill_b += 0.3 * time;
my.skill_a = 30 - my.skill_b;
if(my.skill_a < 0) { my.lifespan = 0; }
}

FUNCTION s_effect()
{
my.skill_a = 0;
my.skill_b = 0;

my.bmap = bsnow;
my.vel_x = 0;
my.vel_y = 0;
my.vel_z = -4 ;
my.size =4 ;
my.move =1 ;
my.alpha = 100 ;
my.x += random(1000)-500;
my.y += random(1000)-500;
my.z += random(100)-50;
my.transparent = 1 ;
my.gravity =0 ;
my.streak =0 ;
my.bright =1 ;
my.function = s_spec;
my.flare =1 ;
}

FUNCTION snow_start()
{
if(Weather_mode == Weather_snow) { return; }
VAR myPos[3];
Weather_Mode = Weather_snow;

while(Weather_Mode == Weather_snow)
{
vec_set(myPOS,camera.x);
MyPos.X = myPos.X - 100;
MyPos.Y = myPos.Y + 100;
MyPos.Z = myPos.Z ;
MyPos.Z = Camera.Z + 80;

effect(s_effect,Snow_strenght ,MyPOS,nullvector);
wait(1 );
}
}

/////////////////////////////////////////////////////////////////////////
//////////rain//////////////////////////////////////////////////////////

VAR Weather_Mode = 3;

DEFINE Weather_rain,1;

VAR Rain_strenght = 20; //Strenght of Rain
VAR Rain_Radius = 2000; //Raidus of Rain
VAR Rain_Fallspeed = -40; //Fallspeed of the raindrops

VAR Rain_sound = 75; //reserved

SOUND sd_rain = <rain.wav>; //Sound of raining

VAR sd_handle;

FUNCTION rain_start(); //Starts normal raining

BMAP brain = <drop.pcx>;


//Rain

FUNCTION r_spec()
{
my.skill_b += 0.3 * time;
my.skill_a = 10 - my.skill_b;
if(my.skill_a < 0) { my.lifespan = 0; }
}


FUNCTION r_effect()
{
my.skill_a = 0;
my.skill_b = 0;

my.bmap = brain;
my.vel_x = 0;
my.vel_y = 0;
my.vel_z = Rain_fallspeed;
my.size = 14;
my.move = 1;
my.alpha = 100 ;
my.x += random(Rain_Radius)-Rain_Radius/2;
my.y += random(Rain_Radius)-Rain_Radius/2;
my.z += random(100)-50;
my.transparent = 1 ;
my.gravity =0 ;
my.streak =0 ;
my.bright =1 ;
my.function = r_spec;
my.flare =1 ;
}


FUNCTION rain_fun(storm)
{
if(Weather_mode == Weather_rain ) { return; }

VAR myPos[3];

Weather_Mode = Weather_rain;

sd_handle = snd_loop (sd_rain,100,0);

while(Weather_Mode == Weather_rain )
{
vec_set(myPOS,camera.x);
MyPos.X = myPos.X ;
MyPos.Y = myPos.Y ;
MyPos.Z = myPos.Z ;
MyPos.Z = Camera.Z + 80;

effect(r_effect,Rain_strenght ,MyPOS,nullvector);


wait(1 );
}
}



FUNCTION rain_start()
{
rain_fun(0);
}

Re: good snow and rain script [Re: aslan123] #110241
02/01/07 19:48
02/01/07 19:48
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
thx ... very fun contribution, something that can be used in a lot of games, saves the time of coding it ourselves ...
useful!


~"I never let school interfere with my education"~
-Mark Twain
Re: good snow and rain script [Re: aslan123] #110242
02/02/07 21:02
02/02/07 21:02
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Same here darragh, quite usefull
Btw, do you have a nice snow/rain bmap

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Bug in the snow [Re: frazzle] #110243
09/20/07 02:49
09/20/07 02:49
Joined: Jun 2004
Posts: 30
Alabama
C0113c70r Offline
Newbie
C0113c70r  Offline
Newbie

Joined: Jun 2004
Posts: 30
Alabama
Using a *.tga image didn't seem to work. I used a *.pcx instead.

With this small change, the snow AND the rain worked GREAT!

Thanx for the scripts.

Last edited by C0113c70r; 09/20/07 03:01.

Owner - Blue Aegis Software & Marketing
Re: Bug in the snow [Re: C0113c70r] #110244
09/22/07 10:34
09/22/07 10:34
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline

Expert
Realspawn  Offline

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
i added this in my online wdl library thx


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1