Schilly 10 Posted July 26, 2009 Hey all, I'm having an issue with a helper script I'm making... Basically I am trying to get it to add a series of actions to a unit when run. EG: nul = [this] execVM "A10Loader.sqs"; Is supposed to add 4 different actions to the a10. Here is the code: ////////////////////////////////////////////////////////////////// // Helper Script for a A10 Loadout function for Armed Assault // Created by: Patrick Schillemat, schillemat@20thsfg.com // // Usage: nul=[plane] execVM "A10Loader.sqf"; // //////////////////////////////////////////////////////////////// _plane = _this select 0; _plane addAction ["A-10 CAS Loadout","A10Loadout.sqf",[_plane,"CAS"],1,true,true,"","speed _plane <= 3 && !isEngineOn _plane"]; _plane addAction ["A-10 ATG Loadout","A10Loadout.sqf",[_plane,"ATG"],1,true,true,"","speed _plane <= 3 && !isEngineOn _plane"]; _plane addAction ["A-10 LGB Loadout","A10Loadout.sqf",[_plane,"LGB"],1,true,true,"","speed _plane <= 3 && !isEngineOn _plane"]; _plane addAction ["A-10 Standard Loadout","A10Loadout.sqf",[_plane,"STD"],1,true,true,"","speed _plane <= 3 && !isEngineOn _plane"]; Anyone see anything wrong with that code? If so what is it as I am lost :crazy: Share this post Link to post Share on other sites
Daveyboy154 10 Posted July 26, 2009 I could be completely wrong, but would you need to have some kind of index for the actions, like _action1 = ...., _action2 =.... etc. I'm a bit of a novice, so i'm not sure. Dave Share this post Link to post Share on other sites
Big Dawg KS 6 Posted July 26, 2009 You cannot use the local variable _plane inside the condition for addAction. Use _target instead, it is a reserved variable inside an action condition that points to the object the action is added to. Share this post Link to post Share on other sites
Schilly 10 Posted July 26, 2009 Perfect. Thanks Big Dawg Share this post Link to post Share on other sites