Jump to content
Sign in to follow this  
TheBoat

Reserved Variable in expression? Noob at scripting

Recommended Posts

Hey guys, I'm new to scripting and today I wanted to test myself by making a simple script that spawns a littlebird (AH9 version) when I walked into a trigger. Here's the scripts code

spawn= getMarkerPos helispawn; 
createVehicle [b_AH9_F, helispawn];

When I was making it I looked up some of the commands such as getMarkerPos but "helispawn" is the name of the marker I want the helicopter to spawn at.

Now, this is the init code on the trigger that goes off upon activation, but the problem is, I cannot even input it because it says "reserved variable in expression". So the first thing I want to know is, will this script work, and the second thing is, what's causing the reserved variable in expression when trying to type this into the "on act" field in my trigger?

Share this post


Link to post
Share on other sites

There is currently on going work to lock the ability to override engine scripting commands, no longer possible to do it on dev branch, such as spawn, so that is why you are receiving that message.

getMarkerPos expects a string with a marker name. You currently give a (probably?) undefined variable.

Your createVehicle is also wrong, currently there are two different implementations of it, the most simple one is:

_chopper = "B_AH9_F" createVehicle getMarkerPos "helispawn";

But that one should be avoided and you should definitely use the createVehicle Array:

_chopper = createVehicle ["B_AH9_F", getMarkerPos "helispawn", [], 0, "NONE"];

Share this post


Link to post
Share on other sites
But that one should be avoided and you should definitely use the createVehicle Array:

_chopper = createVehicle ["B_AH9_F", getMarkerPos "helispawn", [], 0, "NONE"];

Can you explain this particular bit of script please? I understand the _chopper, but am not sure what that specifically does, and I understand createVehicle ["B_AH9_F", getMarkerPos "Helispawn", - but after that I'm blanked. What does the , [], 0, "NONE"]; mean to the computer that's running the scripts?

Share this post


Link to post
Share on other sites

Hi! there is any way to setvariable "binocular"?

 


9:25:56 Error in expression <missionNamespace setVariable ["Binocular", [[0, 15], "Equ>
9:25:56   Error position: <setVariable ["Binocular", [[0, 15], "Equ>
9:25:56   Error Reserved variable in expression

Binocular is arma command Word...
TY for answers ;)

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  

×