Jump to content
Sign in to follow this  
breeze

simple script not sue how to call for it

Recommended Posts

I have followed the Mr Murray book and made a crate script for my ammo Crates however it doesnt seem to execute by what I add in the initialization line

My first impression is to execute it with

Exec crate.sqs

after reading saome posts I see this nul= exec crate.sqs

or

nul=0 execVM crate.sqs

None of these work I however dont understand why I would add the nul or the VM.

this is what my script looks like

clearWeaponCargo _crate;

clearMagazineCargo _crate;

_this addWeaponCargo ["G36a",20];

_this addWeaponCargo ["G36C",20];

_this addWeaponCargo ["G36_C_SD_eotech",20];

_this addWeaponCargo ["G36K",20];

_this addWeaponCargo ["M16A4_ACG_GL",20];

_this addWeaponCargo ["M4A1_HWS_GL_camo",20];

_this addWeaponCargo ["M4A1_HWS_GL_SD_Camo",20];

_this addWeaponCargo ["MP5A5",20];

_this addWeaponCargo ["MP5SD",20];

_this addWeaponCargo ["M240",20];

_this addWeaponCargo ["M24",20];

_this addWeaponCargo ["Colt1911",20];

_this addWeaponCargo ["M9",20];

_this addWeaponCargo ["M136",20];

_this addWeaponCargo ["SMAW",20];

_this addWeaponCargo ["Binocular",20];

_this addWeaponCargo ["M9SD",20];

_this addWeaponCargo ["M8_carbine",20];

_this addWeaponCargo ["M8_carbineGL",20];

_this addWeaponCargo ["M8_compact",20];

Thanks for any help you can give me

Share this post


Link to post
Share on other sites

Try this.

Init:

fillCrate = this execVM "crate.sqf"

crate.sqf (make sure it has .sqf extension):

clearWeaponCargo _this;
clearMagazineCargo _this;

_this addWeaponCargo ["G36a",20];
_this addWeaponCargo ["G36C",20];
_this addWeaponCargo ["G36_C_SD_eotech",20];
_this addWeaponCargo ["G36K",20];
_this addWeaponCargo ["M16A4_ACG_GL",20];
_this addWeaponCargo ["M4A1_HWS_GL_camo",20];
_this addWeaponCargo ["M4A1_HWS_GL_SD_Camo",20];
_this addWeaponCargo ["MP5A5",20];
_this addWeaponCargo ["MP5SD",20];
_this addWeaponCargo ["M240",20];
_this addWeaponCargo ["M24",20];
_this addWeaponCargo ["Colt1911",20];
_this addWeaponCargo ["M9",20];
_this addWeaponCargo ["M136",20];
_this addWeaponCargo ["SMAW",20];
_this addWeaponCargo ["Binocular",20];
_this addWeaponCargo ["M9SD",20];
_this addWeaponCargo ["M8_carbine",20];
_this addWeaponCargo ["M8_carbineGL",20];
_this addWeaponCargo ["M8_compact",20];

Share this post


Link to post
Share on other sites

Mine are called like this:

null0 = this execVM "ammo.sqf"

Not sure if your scripts being sqs rather than sqf would effect it, either.

Share this post


Link to post
Share on other sites

Thanks to both of you yes i did typo the sps spf in original post I was using the correct format which was sqf,,

The fillcrate command worked great

Does anyone know what the Null0 or the VM in the term "execVM" stands for why are they used?

Share this post


Link to post
Share on other sites

ExecVM returns a handle to the script so that you can use other commands (ex scriptDone) to check the status of/do something to the script.

Share this post


Link to post
Share on other sites
Thanks to both of you yes i did typo the sps spf in original post I was using the correct format which was sqf,,

The fillcrate command worked great

Does anyone know what the Null0 or the VM in the term "execVM" stands for why are they used?

To my little knowledge so far :

Null0 is a predefined variable which represents .. nothing ! Kind of wastebasket. If needed, you could use another a selfdefined variablename to store the outcome of the execVM command.

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  

×