Page 3 of 3

Posted: February 20th, 2006, 10:39 pm
by Drofder2004
Also, whenever you see...

Code: Select all

for(;;)
You read that as forever. Simply because the for loop does not end (unless told to). using these incorrectly can cause infinite loop errors.

Posted: February 20th, 2006, 11:02 pm
by Pedsdude

Code: Select all

main()
{
thread e1();
}
e1()
{
b1 = getent ("b1","targetname");
f1 = getent ("f1","targetname");
l1 = getent ("l1","targetname");
r1 = getent ("r1","targetname");
bottom1 = getent ("bottom1","targetname");
trigger = getent ("e1","targetname");
b1b = getent ("b1b","targetname");
f1b = getent ("f1b","targetname");
l1b = getent ("l1b","targetname");
r1b = getent ("r1b","targetname");
while(1)
{
trigger waittill ("trigger");
bottom1 moveZ (2,1,0.5,0.5);
b1b moveX (-40,1,0.5,0.5);
f1b moveX (40,1,0.5,0.5);
l1b moveY (40,1,0.5,0.5);
r1b moveY (-40,1,0.5,0.5);
wait(1);
b1b moveX (40,1,0.5,0.5);
f1b moveX (-40,1,0.5,0.5);
l1b moveY (-40,1,0.5,0.5);
r1b moveY (40,1,0.5,0.5);
wait(1);
b1 moveZ (66,1,0.5,0.5);
f1 moveZ (66,1,0.5,0.5);
l1 moveZ (66,1,0.5,0.5);
r1 moveZ (66,1,0.5,0.5);
wait(1);
b1 moveX (-8,1,0.5,0.5);
f1 moveX (8,1,0.5,0.5);
l1 moveY (8,1,0.5,0.5);
r1 moveY (-8,1,0.5,0.5);
r1 waittill ("movedone");
wait(2);
bottom1 moveZ (318,2,0.5,0.5);
b1 moveZ (318,2,0.5,0.5);
f1 moveZ (318,2,0.5,0.5);
l1 moveZ (318,2,0.5,0.5);
r1 moveZ (318,2,0.5,0.5);
r1 waittill ("movedone");
wait(1);
bottom1 moveX (-184,2,0.5,0.5);
b1 moveX (-184,2,0.5,0.5);
f1 moveX (-184,2,0.5,0.5);
l1 moveX (-184,2,0.5,0.5);
r1 moveX (-184,2,0.5,0.5);
r1 waittill ("movedone");
wait(2);
bottom1 moveX (-52,2,0.5,0.5);
bottom1 waittill ("movedone");
wait(2);
bottom1 moveZ (-320,1,0.5,0.5);
b1 moveX (192,1,0.5,0.5);
wait(1);
bottom1 moveX (236,1,0.5,0.5);
f1 moveX (176,1,0.5,0.5);
l1 moveX (184,1,0.5,0.5);
r1 moveX (184,1,0.5,0.5);
wait(1);
l1 moveY (-8,1,0.5,0.5);
r1 moveY (8,1,0.5,0.5);
wait(1);
b1 moveZ (-384,1,0.5,0.5);
f1 moveZ (-384,1,0.5,0.5);
l1 moveZ (-384,1,0.5,0.5);
r1 moveZ (-384,1,0.5,0.5);
r1 waittill ("movedone");
}
}
That's the script for the lift at the end of the map - can you see any reason for it to only do it once? :?

Posted: February 20th, 2006, 11:11 pm
by Drofder2004
With that many things moving, I dont recommend the "waittill movedone" function. Try removing them all and replacing them with times.

Code: Select all

main()
{
thread e1();
}

e1()
{
b1 		= getent ("b1","targetname");
f1 		= getent ("f1","targetname");
l1 		= getent ("l1","targetname");
r1 		= getent ("r1","targetname");
bottom1 = getent ("bottom1","targetname");
trigger = getent ("e1","targetname");
b1b 	= getent ("b1b","targetname");
f1b 	= getent ("f1b","targetname");
l1b 	= getent ("l1b","targetname");
r1b 	= getent ("r1b","targetname");

while(1)
{
trigger waittill ("trigger");
bottom1 moveZ (2,1,0.5,0.5);
b1b 	moveX (-40,1,0.5,0.5);
f1b 	moveX (40,1,0.5,0.5);
l1b 	moveY (40,1,0.5,0.5);
r1b 	moveY (-40,1,0.5,0.5);

wai 1;

b1b 	moveX (40,1,0.5,0.5);
f1b 	moveX (-40,1,0.5,0.5);
l1b 	moveY (-40,1,0.5,0.5);
r1b 	moveY (40,1,0.5,0.5);

wait 1;

b1 		moveZ (66,1,0.5,0.5);
f1 		moveZ (66,1,0.5,0.5);
l1 		moveZ (66,1,0.5,0.5);
r1 		moveZ (66,1,0.5,0.5);

wait 1;

b1 		moveX (-8,1,0.5,0.5);
f1 		moveX (8,1,0.5,0.5);
l1 		moveY (8,1,0.5,0.5);
r1 		moveY (-8,1,0.5,0.5);

wait 2;

bottom1	moveZ (318,2,0.5,0.5);
b1 		moveZ (318,2,0.5,0.5);
f1 		moveZ (318,2,0.5,0.5);
l1 		moveZ (318,2,0.5,0.5);
r1 		moveZ (318,2,0.5,0.5);

wait  2;

bottom1	moveX (-184,2,0.5,0.5);
b1 		moveX (-184,2,0.5,0.5);
f1 		moveX (-184,2,0.5,0.5);
l1 		moveX (-184,2,0.5,0.5);
r1 		moveX (-184,2,0.5,0.5);

wait 2;

bottom1	moveX (-52,2,0.5,0.5);

wait 2;

bottom1	moveZ (-320,1,0.5,0.5);
b1 		moveX (192,1,0.5,0.5);

wait 1;

bottom1	moveX (236,1,0.5,0.5);
f1 		moveX (176,1,0.5,0.5);
l1 		moveX (184,1,0.5,0.5);
r1 		moveX (184,1,0.5,0.5);

wait 1;

l1 		moveY (-8,1,0.5,0.5);
r1 		moveY (8,1,0.5,0.5);

wait 1;

b1 		moveZ (-384,1,0.5,0.5);
f1 		moveZ (-384,1,0.5,0.5);
l1 		moveZ (-384,1,0.5,0.5);
r1 		moveZ (-384,1,0.5,0.5);

wait 1;
}
}
Spaced out to make it easier to read :P
You may need to change the wait values, mine may not work 100% correctly.
:)

Posted: February 20th, 2006, 11:46 pm
by Pedsdude
OK, will try them ;)

Posted: February 21st, 2006, 12:11 am
by Pedsdude
Oh btw, what kind of trigger should I use with this code?:

Code: Select all

end_trig = getent("end_trig","targetname");
while(1)
{
end_trig waittill ("trigger",user);
user iprintlnbold("Congrats");
}
Just trigger_use, with cursorhint:HINT_NOACTIVATE ?

Posted: February 21st, 2006, 12:36 am
by Luke
It should be a trigger_multiple, coz that trigger works when the player touches it without needing input from the player...so ideally u want it where the player has no option but to fall/move through it.

Posted: February 21st, 2006, 1:45 am
by Drofder2004
Luke wrote:It should be a trigger_multiple, coz that trigger works when the player touches it without needing input from the player...so ideally u want it where the player has no option but to fall/move through it.
Indeed.

Posted: February 21st, 2006, 1:57 pm
by Pedsdude
Ah ok, so they can't keep setting it off like in ultra_gap_training :)

Posted: February 21st, 2006, 3:42 pm
by Pedsdude
Hmmm, well I tested it and it worked, although I don't really have anywhere where you can only trigger it once. Is there any way to make sure you can only do it once every 10 seconds or so? Also, does it show to everyone in the server or just that one person?

Posted: February 21st, 2006, 3:58 pm
by Luke
Pedsdude wrote:Hmmm, well I tested it and it worked, although I don't really have anywhere where you can only trigger it once. Is there any way to make sure you can only do it once every 10 seconds or so? Also, does it show to everyone in the server or just that one person?
It should show for just the one player, but test it with someone to make sure...

If you want it so it can only be triggered once every 10 seconds just add a wait time

Code: Select all

end_trig = getent("end_trig","targetname"); 
while(1) 
{ 
end_trig waittill ("trigger",user); 
user iprintlnbold("Congrats"); 
wait 10;
}

Posted: February 21st, 2006, 4:44 pm
by Pedsdude
Oh yeah... stupid me :P

Posted: February 21st, 2006, 10:08 pm
by Soviet
KillerSam wrote:
Pedsdude wrote:Oh yeah... stupid me :P
stooooooooooooooooooopid....sorry had too.
lmao...owned

Posted: February 21st, 2006, 10:42 pm
by Pedsdude
Shhh.... :P

I can't seem to fix the elevator :( Will just leave the finish message so that people understand they've finished.