Jump to content
Sign in to follow this  
thefluffyraisin

this addAction alternative

Recommended Posts

Hello everyone! I just have a simple question I need answered for a mission. I'm using a script called the ASOR Gear Selector, and in order to us it, you need to place a command in a unit's Init field, using the this addAction command. My question is, can I instead of using the addAction command and using the script via menu, can I have the script run at the start of the mission via trigger. (I.E. : As soon as the mission starts, the gear menu pops up instead of having to select it manually.)

Share this post


Link to post
Share on other sites

What exactly do you have to put in the unit's init field?

The addAction command simply calls a script (or code) when the action is selected by the player, so it should be possible to call that script directly instead, for example by using execVM "SCRIPT\PATH".

Btw. thread moved to mission editing & scripting.

Share this post


Link to post
Share on other sites

Thanks for the reply! The init command is as follows: this addAction["<t color=#111111'>Gear Select</t>", "execvm 'ASORGS\open.sqf']; So would how would I directly execute the script?

Share this post


Link to post
Share on other sites

You just pull out the call to the script, being:

[] execVM "ASORGS\open.sqf";

^ This is directly calling the script.

Edited by JShock

Share this post


Link to post
Share on other sites

Hmm, when I put that into a trigger it gives me a "Type Script, expected Nothing" error. I'm assuming I have to specify the unit in which I want the script to affect?

Share this post


Link to post
Share on other sites
Hmm, when I put that into a trigger it gives me a "Type Script, expected Nothing" error. I'm assuming I have to specify the unit in which I want the script to affect?

Yea that or this:

null = [unitName] execVM "ASORGS\open.sqf";

And depending on how the script is put together, you may need to make a few modifications to it since you aren't using the addAction any longer.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×