OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Crook on 02 Feb 2004, 14:42:17
-
I need help to fix this broken script... I'm completely stumped!
This is what i have
_counter = EScore + 1
~10
?(_counter > EScore):Goto "Lose";
Goto "Exit"
Exit
#Lose
DisableUserInput True;
FlagE Setflagowner ap1
~8
titlecut ["","PLAIN DOWN"];
ap1 exec "westwin.sqs"
#Exit
Exit
-
I guess it would help if i told you what I wanted it to do...
I want the ?(_counter > EScore):Goto "Lose"; to go to Lose if the counter number is greater than the score of East but if it is equal to the counter i want it to quit.
-
Tell us more about what you are trying to do and what went wrong.
_counter is always more than EScore so the script always goes to "lose".
It should be:-
[ap1] exec "westwin.sqs"
-
Just seen your second post which crossed with mine.
What is the _counter? What is is counting? At the moment you are defining it to be one more than EScore.
-
the counter is supposed to count the east score and at the begining of the script the counter will be 1 more than the east score... so after 10 seconds it will check to see if the counter is more than the east score (it will be more than 10 second im just using 10 seconds to test it) if the east hasn't scored it should go to a part of the script called lose if they did score it should exit.
-
So what is actually wrong?
Has Escore been defined anywhere?
-
Ah, I see. So EScore will change (possibly) during the time delay. Try this. Syntax etc not guaranteed.
_counter = EScore
; EScore may change in this interval
~30
?(_counter == EScore):Goto "Lose"
?(_counter < EScore):hint format ["My script is fubar.\n_counter - %1\nEScore - %2", _counter, EScore"]
exit
#Lose
hint format ["Lose activated!\n_counter - %1\nEScore - %2", _counter, EScore"]
DisableUserInput True;
FlagE Setflagowner ap1
~8
titlecut ["","PLAIN DOWN"] <---- is this meant to be blank?
[ap1] exec "westwin.sqs"
exit
-
nope...
-
As deaddog said, what is wrong? What's happening/not happening? How do you know that it isn't working? Is the script even starting correctly? We need more clues.
You could try creating a blank test mission and calling the script from that. Insert lines into various places in the script like this
EScore = 300
to see what happens.
-
Dude, you've been asked twice about what exactly your script is doing wrong and all you can say is "nope" >:( Nope to what?
You must not really be interested in getting it fixed.
Good luck and BTW, You're Welcome!!