Home   Help Search Login Register  

Author Topic: using execVM in the activation field of a waypoint  (Read 2083 times)

0 Members and 1 Guest are viewing this topic.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
using execVM in the activation field of a waypoint
« on: 01 Mar 2007, 17:43:29 »
[group this, array] execVM "myscript.sqf"


can't get a waypoint to accept this code in it's activation field
however it will happily accept

[group this, array] exec "myscript.sqs"

is this a feature/bug or am i doing something wrong with the execVM
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: using execVM in the activation field of a waypoint
« Reply #1 on: 01 Mar 2007, 17:48:01 »
sqf is still considered to be a function by the game instead of regular script (or something like that), so you need to use either:
Code: [Select]
foo=[group this, array] execVM "myscript.sqf"or
Code: [Select]
call {[group this, array] execVM "myscript.sqf"}
Personally I prefer the latter..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re: using execVM in the activation field of a waypoint
« Reply #2 on: 04 Mar 2007, 23:17:04 »
thx H, that did it
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re: using execVM in the activation field of a waypoint
« Reply #3 on: 06 Mar 2007, 15:48:55 »
It's a feature of the intended kind - in other words, that's how it's supposed to work.

The reason why the execVM attempt fails and exec works is that the former is a command that returns a value (a script handle) whereas exec returns nothing.

h- showed two ways of handling it - you either make use of the return value from execVM or you do a call "trick" to throw it away.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: using execVM in the activation field of a waypoint
« Reply #4 on: 06 Mar 2007, 23:04:03 »
I stand educated :)

Is there some other use for the script handle than the use with the command terminate?
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: using execVM in the activation field of a waypoint
« Reply #5 on: 07 Mar 2007, 00:33:16 »
Yep, you may check if one script is finished using its handler for scriptDone command.

Code: [Select]
_script1=[group this, array] execVM "myscript.sqf";
waitUntil {scriptDone _script1;};
hint "MyScript.sqf finished";


Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: using execVM in the activation field of a waypoint
« Reply #6 on: 07 Mar 2007, 07:52:21 »
Right, knew about that command but completely forgot it..
Way too many new commands to make sense out of.. :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.