OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Gielovic on 07 May 2008, 23:36:21
-
Hej
Does any of you guys know how to kill a script which a unit is executing (kronzky's UPS) from another script x, so i don't get any annoying messages once i delete all the units in an area in script x?
Kind Regards
-
Hm. With kronzkys UPS its a bit difficult : if Im not mistaken it duplicates itself: i.e., even though you grab a handle using ScriptHandle = [parameters] execvm "ups.sqf", scriptHandle will only correspond to ONE instance of the script. I might be wrong however!
As it were, youre in luck: UPS has a lot of built-in features that you would do well to use. Open up the script in notepad and read the script heading for all kinds of advanced usage, including, I believe, a way to disable zones and turn off a lot of stuff. Check it out.
Otherwise, you can always try to use the terminate (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=t#796) command on the script handle and try to turn it off that way :)
Wolfrug out.
-
Thanks mate
I'll have a good look at it..
why is this general btw:P...
-
why is this general btw
Because stopping a running script is not advanced stuff :)
-
OK...well testing this will be difficult as the error doesn't always show up :confused:
but i'll let you know when i have a solution :D
-
I'm pretty sure you will find the error in the ArmA.rpt file, located in (a hidden folder) C:\Documents and Settings\user.pcname\Local Settings\Application Data\ArmA\.
Seeing the error message would probably give a hint of what's going on, I'm presuming that depending on which cycle you delete the group the script tries to do stuff with a non-existing group and goes bananas.. :dunno:
-
i guess that's the problem indeed;) Therefor i would like to terminate the script before deleting the units:D
-
What version of the script are you using?
I don't get any errors when I delete a group being manipulated by the script. :dunno:
@Wolfrug
If I terminate an instance UPS using it's handle the group goes to the 'waypoint' the script has set it to go (before the termination) to but it stops there and doesn't seem to be affected by the script anymore (and scriptDone on the handle returns true), so I guess you can terminate the script normally. :scratch:
-
Here's the error i receive once in a while
Error in expression <KRON_TRGFlag=>
Error position: <=>
Error Generic error in expression
-
You could try using the terminate (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=t#796) command since it seems to work (at least it did for me) :dunno:
Are you using the 2.0.0 version of the script?
-
He i found out whats wrong i guess:D
I used the terminate command, but that didn't work (maybe i should name all the scripts different when executing
anyway..the error only appears when I delete the units (using radio for example) when the 'clones' aren't there yet. Which will never happen in a mission, because noone deletes units within 2 secs after the mission start :D
Tnx for the help guys :good:
-
maybe i should name all the scripts different
Of course.
It's just a global variable (of sort) so the name will point to the latest script run with that name.
the error only appears when I delete the units (using radio for example) when the 'clones' aren't there yet.
I find that odd, I didn't have any errors when deleting the units :scratch:
Maybe I just didn't test long enough.. :dunno: