PDA

View Full Version : simple script not sue how to call for it



Breeze
Jul 13 2009, 15:28
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

Big Dawg KS
Jul 13 2009, 16:12
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];

peonic
Jul 13 2009, 16:14
Mine are called like this:



null0 = this execVM "ammo.sqf"


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

Breeze
Jul 13 2009, 16:30
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?

Big Dawg KS
Jul 13 2009, 16:34
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.

Lincoln1stFJ
Jul 20 2009, 01:21
Is there a fillcrate; all - to allow for all weapons and perhaps an exclusion or two?

Eclipse4349
Jul 22 2009, 19:43
Is there a fillcrate; all - to allow for all weapons and perhaps an exclusion or two?


See my reply here:
http://forums.bistudio.com/showthread.php?t=79285

BoomBoomSate
Jul 22 2009, 22:50
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.