Home   Help Search Login Register  

Author Topic: Stop scripts externally  (Read 2085 times)

0 Members and 1 Guest are viewing this topic.

Offline Gielovic

  • Contributing Member
  • **
Stop scripts externally
« 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

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Stop scripts externally
« Reply #1 on: 08 May 2008, 01:41:00 »
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 command on the script handle and try to turn it off that way :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Gielovic

  • Contributing Member
  • **
Re: Stop scripts externally
« Reply #2 on: 09 May 2008, 19:35:03 »
Thanks mate
I'll have a good look at it..

why is this general btw:P...

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Stop scripts externally
« Reply #3 on: 09 May 2008, 20:18:07 »
Quote
why is this general btw
Because stopping a running script is not advanced stuff :)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Gielovic

  • Contributing Member
  • **
Re: Stop scripts externally
« Reply #4 on: 10 May 2008, 00:37:59 »
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

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Stop scripts externally
« Reply #5 on: 10 May 2008, 10:28:30 »
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:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Gielovic

  • Contributing Member
  • **
Re: Stop scripts externally
« Reply #6 on: 13 May 2008, 16:10:55 »
i guess that's the problem indeed;) Therefor i would like to terminate the script before deleting the units:D

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Stop scripts externally
« Reply #7 on: 13 May 2008, 18:30:40 »
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:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Gielovic

  • Contributing Member
  • **
Re: Stop scripts externally
« Reply #8 on: 14 May 2008, 20:24:34 »
Here's the error i receive once in a while
Code: [Select]
Error in expression <KRON_TRGFlag=>
  Error position: <=>
  Error Generic error in expression

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Stop scripts externally
« Reply #9 on: 15 May 2008, 03:47:52 »
You could try using the terminate command since it seems to work (at least it did for me) :dunno:

Are you using the 2.0.0 version of the script?
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Gielovic

  • Contributing Member
  • **
Re: Stop scripts externally
« Reply #10 on: 16 May 2008, 11:47:34 »
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:

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Stop scripts externally
« Reply #11 on: 16 May 2008, 18:14:53 »
Quote
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.

Quote
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:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.