PDA

View Full Version : Ammo crate load out



The_Oakster
Jun 29 2004, 10:36
I have added the ammo crate load out from the sticky thread on frequently asked questions.

I cut and pasted it in to the mission file but i now get an error message but i cant see whats wrong?

The error message is -

Mission/Vehicles/Item.1.init': 'M' encountered instead of ';'

the load out from the mission file is -

class Item1
{
position[]={1661.708496,24.974998,5573.960449};
azimut=5.000000;
id=1;
side="EMPTY";
vehicle="ReammoBoxWest";
lock="LOCKED";
skill=0.200000;
init="this addweaponcargo ["M16",15]; this addweaponcargo ["M21",5]; this addmagazinecargo ["M16",100]; this addmagazinecargo ["M21",50]; this addweaponcargo ["LAWLauncher",5]; this addmagazinecargo ["LAWLauncher",50]; this addweaponcargo ["M60",5]; this addmagazinecargo ["M60",20]; this addmagazinecargo ["SmokeShell", 10]; this addweaponcargo ["Binocular", 5]; this addweaponcargo ["HandGrenade",15]; this addmagazinecargo ["HandGrenade",15]; this addweaponcargo ["FlareRed",15]; this addmagazinecargo ["FlareRed",15]; this addweaponcargo ["FlareGreen",15]; this addmagazinecargo ["FlareYellow",15]; this addweaponcargo ["FlareYellow",15]; this addweaponcargo ["Flare",15]; this addmagazinecargo ["Flare",15]; this addweaponcargo ["SmokeShellRed",15]; this addmagazinecargo ["SmokeShellRed",15]; this addweaponcargo ["SmokeShellGreen",15]; this addmagazinecargo ["SmokeShellGreen",15]";
};

I cant see where the mystery M is?

The_Oakster
Jun 29 2004, 12:09
I've sorted it now but i dont know how.

The only thing i did differently was adding the load out to the object in the editor rather than adding it to the mission.sqs!

I wouldn't have thought it would have made much difference!!

Winters
Jun 29 2004, 13:34
Here is a simple script that you could use that will allow you to easily fill ammocrates with any weapons you choose.

I used this for a nam mission but half of it also lists normal weapons (which i didnt use for the Nam mission) try it out.

Credit goes to Backoff and Deadmeat for the script.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;------------------------------------------------------------------------------
;AmmoCrate.sqs v 2.0
;By Backoff & DeaDMeaT Productions

;Add weapon to an ammo crate

;Exemple&#58; type this line in the init field of an ammo crate
;&#91;this, &#34;LIGHT&#34;, &#34;WEST&#34;&#93; exec &#34;ammocrate.sqs&#34;
;&#91;objectname, load type, side&#93; exec &#34;ammocrate.sqs&#34;

;load type&#58;
;----------
;&#34;LIGHT&#34;&#58; basic weapons
;&#34;MEDIUM&#34;&#58; weapons
;&#34;HARD&#34;&#58; rocket & grenade launcher
;&#34;Explosive&#34;&#58; hand grenade, mine, etc...
;&#34;Equipment&#34;&#58; night vision google, binocular, etc...

;side&#58;
;-----
;&#34;WEST&#34;&#58; add ammo/weapon for west side
;&#34;EAST&#34;&#58; add ammo/weapon for east side
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
_crate = _this select 0
_type = _this select 1
_side = _this select 2
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
clearmagazinecargo _crate
clearweaponcargo _crate
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
?&#40;_type == &#34;Equipment&#34;&#41;&#58; goto &#34;Equipment&#34;
?&#40;_type == &#34;Explosive&#34;&#41;&#58; goto &#34;Explosive&#34;
goto format &#91;&#34;%1%2&#34;, _type, _side&#93;
Goto &#34;End&#34;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
#LightWEST
_crate AddWeaponCargo &#91;&#34;sebm16a1&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;sebm14&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;sebcar15&#34;, 20&#93;

_crate AddMagazineCargo &#91;&#34;sebm16a1magn&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;sebm14magn&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;sebcar15magn&#34;, 200&#93;

Goto &#34;End&#34;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
#LightEAST
_crate AddWeaponCargo &#91;&#34;sebsks&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;sebrpd&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;sebrpglauncher&#34;, 20&#93;

_crate AddMagazineCargo &#91;&#34;sebsksmagn&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;sebrpdmagn&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;sebrpgrocket&#34;, 200&#93;
Goto &#34;End&#34;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
#MediumWEST
_crate AddWeaponCargo &#91;&#34;sebm16a1gl&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;sebm60&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;sebm79&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;seblawlauncher&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;seb90mmrecoiless&#34;, 20&#93;

_crate AddMagazineCargo &#91;&#34;sebm16a1magn&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;sebm60magn&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;sebm79he&#34;, 300&#93;
_crate AddMagazineCargo &#91;&#34;seblawrocket&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;seb90mmrocket&#34;, 200&#93;
Goto &#34;End&#34;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
#MediumEAST
_crate AddWeaponCargo &#91;&#34;AK47&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;PK&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;G36a&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;RPGLauncher&#34;, 20&#93;

_crate AddMagazineCargo &#91;&#34;Pipebomb&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;AK47&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;PK&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;G36aMag&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;RPGLauncher&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;Mine&#34;, 200&#93;
Goto &#34;End&#34;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
#HardWEST
_crate AddWeaponCargo &#91;&#34;LAWLauncher&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;M16GrenadeLauncher&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;MM1&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;AALauncher&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;CarlGustavLauncher&#34;, 20&#93;

_crate AddMagazineCargo &#91;&#34;AALauncher&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;M16&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;LAWLauncher&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;GrenadeLauncher&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;MM1Magazine&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;CarlGustavLauncher&#34;, 200&#93;
Goto &#34;End&#34;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
#HardEAST
_crate AddWeaponCargo &#91;&#34;RPGLauncher&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;AK74GrenadeLauncher&#34;, 20&#93;
_crate AddWeaponCargo &#91;&#34;6G30&#34;, 20&#93;

_crate AddMagazineCargo &#91;&#34;AK74&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;RPGLauncher&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;6G30Magazine&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;GrenadeLauncher&#34;, 200&#93;
Goto &#34;End&#34;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
#Explosive
_crate AddMagazineCargo &#91;&#34;HandGrenade&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;Mine&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;Timebomb&#34;, 200&#93;
_crate AddMagazineCargo &#91;&#34;Pipebomb&#34;, 200&#93;
Goto &#34;end&#34;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
#Equipment
_crate AddWeaponCargo &#91;&#34;NVgoggles&#34;, 200&#93;
_crate AddWeaponCargo &#91;&#34;Binocular&#34;, 200&#93;
_crate AddWeaponCargo &#91;&#34;Flare&#34;, 200&#93;
_crate AddWeaponCargo &#91;&#34;SmokeShell&#34;, 200&#93;
Goto &#34;end&#34;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
#end
Exit
;------------------------------------------------------------------------------[/QUOTE]