Home   Help Search Login Register  

Author Topic: Another Quick Question  (Read 804 times)

0 Members and 1 Guest are viewing this topic.

Crook

  • Guest
Another Quick Question
« on: 10 Feb 2003, 18:41:52 »
Do any of you know if there is a string i can type so after a certain ammount of time it exits out of another script and how to check if the other script is still running so the timer doesn't go off after the other script is finished. Or if i can use one script instead of two to do that. This is what I have...
#Loop
?!(Alive ap1):Goto "ap1dead";
?!(Alive ap2):Goto "ap2dead";
Goto "Loop";
#ap1dead
Titletext [format["%1 Wins The Match!",Name ap2], "PLAIN"];
PlaySound "win";
[] exec "r1m2cut.sqs";
~5
TitleText ["","PLAIN"];
Goto "Exit";
#ap2dead
Titletext [format["%1 Wins The Match!",Name ap1], "PLAIN"];
PlaySound "win";
~5
[] exec "r1m2cut.sqs"
TitleText ["","PLAIN"]
Goto "Exit"
#Exit
~1.2
Removeallweapons ap1;
Removeallweapons ap2;

Exit

Is there a way to make it go to two parts of a script and skip the rest like...

start here:
#Loop
?!(Alive ap1):Goto "ap1dead";
?!(Alive ap2):Goto "ap2dead";
Goto "Loop";

and also be timing it: so it will be in the loop as well as the timer...
something like this...

#Loop
?!(Alive ap1):Goto "ap1dead";
?!(Alive ap2):Goto "ap2dead";
Goto "Loop";

#Timer
~30
hint "you have 30 seconds left..."
~30
hint  "times up, its a draw"
Goto "exit"

Make it goto both Loop and Timer at the same time in the same script...
If not is there a way to check if another script is running in the timer script so the timer doesn't go off after the other script is finished...

Please help IM SO STUPID!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Another Quick Question
« Reply #1 on: 10 Feb 2003, 22:54:32 »
Syntax (as ever) not guaranteed and I'm not sure ifI've understood the problem correctly, but does this help?   I've assumed you want a 10 minute mission =600 seconds


_counter=0    (probably you don't actually need this, but hey, wtf)

#loop
blah blah blah

~0.5      (remember that you need a time delay in a loop)
?(_counter=0) and (time>570):goto "timer"
?time>600 goto "end"
goto "loop"


#timer
hint " blah"
_counter=1
goto "loop


#end
hint "you both lost"
~6
exit
Plenty of reviewed ArmA missions for you to play

Crook

  • Guest
Re:Another Quick Question
« Reply #2 on: 10 Feb 2003, 23:25:24 »
thanks im have been waiting all day for that answer

Crook

  • Guest
Re:Another Quick Question
« Reply #3 on: 11 Feb 2003, 07:58:11 »
ok something is wrong with this string and im left clueless...
To give you guys some more information on what I'm trying to do...
I'm making a map which it like a 1 on 1 tournament where the map sets the position of the players adds and removes weapons... Each match I want to have a 1 minute limit...

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Another Quick Question
« Reply #4 on: 11 Feb 2003, 08:52:34 »
try making it a function script (sqf instead of sqs)
If you don't already have one I suggest you get the official command reference version 1.85 from the editors depot and check out the part of functions in it.

either that or you make two scripts
Not all is lost.

Crook

  • Guest
Re:Another Quick Question
« Reply #5 on: 11 Feb 2003, 11:02:30 »
I dont want the map to be for resistance.... Anyways, how would a make one script check is another script is running so it doesn't go off before it should? For example... I am making a paintball style map only there is two people fighting and i want the fighters to alternate (ap1 vs ap2 (1st round) ap3 vs ap4 (2nd round))... I want a time limit on the rounds... I want a script to tell if one is dead (which i know how to do)... I don't want the script to tell me that ap1 is dead after the timer goes off because it doesn't count....
« Last Edit: 11 Feb 2003, 11:06:36 by Crook »

Crook

  • Guest
Re:Another Quick Question
« Reply #6 on: 13 Feb 2003, 16:15:40 »
Alright, I need help with the counter... This is what I got...

_counter=0
#Loop
?!(Alive ap1):Goto "ap1dead";
?!(Alive ap2):Goto "ap2dead";
~1
_counter=x +1;
?(_counter=60): Goto "Timer"
Goto "Loop";

I keep getting an error with ?(_counter=60): Goto "Timer"
Can someone please help me so I can finish this god forsaken map?