OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Lykurgos on 11 Apr 2003, 18:54:23
-
Sorry to interrupt you again, but I am making a mp mission for tomorrow evening and I received some problems.
Case n.1
Must be asked hundreds of times, but how to remove actions?
Case n.2
I made rain script. One of the players controls the weather and this script is trying to make a rain:
#Raini
hint "Rain commenced"
playsound "Thundr3"
0 setOvercast 20
leadere removeaction ["Rain","Raino.sqs"]
leadere addaction ["End rain","End rain.sqs"]
~22
? (RainEnd==1) : goto "Raini"
0 setOvercast 0
Hint "Rain ended"
~2
leadere addaction ["Rain","Raino.sqs"]
exit
It works except for 2 things:
-the removeaction doesnÂ't work.
-It goes through the list of commands, but only once, I tried to make a loop, so it circles alltime until the RainEnd has value 1.
Case n.3
Very similar to the rain script, except this one must circle forever.
#Changa
~400
hint "Time will change in 3"
~1
hint "Time will change in 2"
~1
hint "Time will change in 1"
~1
skiptime 12
hint "Time changed"
goto "Changa"
Same problem; it only does it once, it doesnÂ't circle.
Any help will be appreciated. :)
(Sorry to post this into a wrong area...)
-
@ 1: PlayerName removeaction ActionName
@ 2: See # 1.
@ 3: I dunno what is the problem on that one. :-\
-
well as far as the removing action goes:
To add an action you should use this:
actionid=unit addaction["actiontext","actionscript"]
and to remove it you should use this:
unit removeaction actionid
action id is the the name assigned to the action using the addaction command.
You do not need to assign an id to your action, but it is a useful way of
remembering what each one is!
You can also remove the first action you created using:
unit removeaction 0
the second by changing the 0 to a 1 etc...
As far as the scripting stuff I'm sure someone else more knowledgable in those matters will come along and help you out with it ;)
Also I noticed that in your "weather script" you omitted the
setrain command
which version of OFP are you using? cause setrain works pretty well. if you have a current enough version to support it ;)
-
3. If the script is exiting after one correct loop, then there is something wrong with the loop. (Obviously.) Try deleting the loop label and command and replacing them. Use a name that makes it easy to spot a mistake, like "A".
If that doesn't work, it might be a bizarre effect with the skiptime command. Try deleting that and see if the loop works.
Sorry I can't be more helpful.
-
I have resistance, but I am using OFP 1.46 in this mission, because my friends donÂ't have resistance.
Okay, the removeaction is working. But the loop doesnÂ't work.
Thanks anyway, althought I can make some short rains and a skiptime for several times, but not loop. Could be the only solution.