Page 1 of 1

nm_portal like water rising

Posted: March 2nd, 2010, 3:42 pm
by BatterY
Hello.

I'm currently making a map that will have a script that raises water from time to time.

So, i'll write some details here:

Code: Select all

Every 2nd minute waiter level raises, printing bold: Flood!! Get To Safety!! 10 seconds before water level rises and it will rise about 60 units higher than normal, and lowers back to its normal level after 30 seconds.

Here's something i've thought:

iprintlnbold("Flood!!");
wait(1);
iprintlnbold("Get to safety!!");
wait(10);
(waterlevel +60, takes 3 seconds to rise)
wait(30);
(waterlevel -60, takes 3 seconds to lower)
iprintlnbold("flood over");

I would apperciate anyone who gives his/her helping hand :)

Re: nm_portal like water rising

Posted: March 2nd, 2010, 4:21 pm
by waywaaaard
Where is your water located? Just make the water brush 60 longer (z axis). Make it as a script model and then either with a origin and moveTo((0, 0, 60), 3) or moveZ(60, 3)

Re: nm_portal like water rising

Posted: March 2nd, 2010, 5:12 pm
by BatterY
Umm.. could you give a code for it, or correct mine? And what key and value i give to it?

Code: Select all

wait(49);
iprintlnbold("Flood Warning!!");
wait(1);
iprintlnbold("Get To Safety Towers!!");
wait(10);
moveTo((-1536, -168, 120), 5)
wait(30);
moveTo((-1536, -168, 0), 5)
iprintlnbold("Flood Is Over.");
wait(1);
irpintlnbold("Be Aware Of The Next One...");
wait(60);

Re: nm_portal like water rising

Posted: March 2nd, 2010, 5:31 pm
by Oi!mel

Code: Select all

water()
{
water	= getent("water","targetname");

while(1)
{
wait(49);
iprintlnbold("Flood Warning!!");
wait(1);
iprintlnbold("Get To Safety Towers!!");
wait(10);
water movez (60, 5)
water waittill movedone;
wait(30);
water movez (-60, 5)
water waittill movedone;
iprintlnbold("Flood Is Over.");
wait(1);
irpintlnbold("Be Aware Of The Next One...");
wait(60);
}
}
Make the water brush.
right click > script > brushmodel
add key/value to entity:
targetname
water

Re: nm_portal like water rising

Posted: March 2nd, 2010, 5:41 pm
by BatterY
Thank you very much! :D

Re: nm_portal like water rising

Posted: March 2nd, 2010, 6:18 pm
by Oi!mel
There is a bug:
water movez (60, 5);
water movez (-60, 5);

Forgot it

Re: nm_portal like water rising

Posted: March 2nd, 2010, 7:36 pm
by BatterY
ok, fixed that

Re: nm_portal like water rising

Posted: March 3rd, 2010, 3:07 pm
by Rezil
The water will wait for 109 seconds? :o

Re: nm_portal like water rising

Posted: March 3rd, 2010, 4:28 pm
by Rezil
KillerSam wrote:That's what the code says :!:
Every 2nd minute waiter level raises, printing bold: Flood!! Get To Safety!! 10 seconds before water level rises and it will rise about 60 units higher than normal, and lowers back to its normal level after 30 seconds.
Reason for me being amazed. :)

Re: nm_portal like water rising

Posted: March 3rd, 2010, 6:17 pm
by Oi!mel
No
wait(49);
iprintlnbold("Flood Warning!!");
wait(1);
iprintlnbold("Get To Safety Towers!!");
wait(10);
First part takes 1 minute
water movez (60, 5)
water waittill movedone;
wait(30);
water rises 60 units, and wait 30 seconds
water movez (-60, 5)
water waittill movedone;
water drops
iprintlnbold("Flood Is Over.");
wait(1);
irpintlnbold("Be Aware Of The Next One...");
wait(60);
last part, wait for another minute

That meens its 2 minutes dropped, then it rises again.

Re: nm_portal like water rising

Posted: March 3rd, 2010, 6:38 pm
by Oi!mel
well, that is what you said xd. having my problem with that language, sorry. but whats the proplem? you don't get it?

Re: nm_portal like water rising

Posted: March 3rd, 2010, 7:05 pm
by Rezil
Sorry, didn't see the 2 minutes part, my bad! Thought he only wanted it for 30 seconds. :)

Re: nm_portal like water rising

Posted: March 4th, 2010, 7:39 pm
by Nightmare
Please don't have your in map targetname simply be "water".
What I suggest to most scripters is to add their map name in front to avoid conflicting with other maps.

Re: nm_portal like water rising

Posted: March 4th, 2010, 7:49 pm
by xeno
Rez|l wrote:Sorry, didn't see the 2 minutes part, my bad! Thought he only wanted it for 30 seconds. :)
Ha ha. I was waiting for you to say that :D