OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: icarus_uk on 15 Jan 2003, 18:31:58

Title: Counting Ammo in cargo
Post by: icarus_uk on 15 Jan 2003, 18:31:58
Ok people.  I have a cessna, that I want to be loading up with Satchel Charges (just satchel charges).

I want it to count how many charges I have in the cargo and then it shows me the number.  I will be decreasing the number with a seperate part of the script.

_mags = magazines Plane1;
_i = 0;
#loop
_type = _mags select _i;
_count = Plane1 ammo _type;
titleText[format["There are %1 of %2", _count, _type], "PLAIN"];
_i = _i + 1;
? _i < count _mags : goto "loop";


You might have gathered that this doesnt work!  Why not?
Title: Re:Counting Ammo in cargo
Post by: LCD on 16 Jan 2003, 01:20:58
dere r 2 difrent Qs in here and i can answer only1  :-\

Quote
Why not?

cuz da magazines command returns only da magazines of da unit/vehicle if it have weapons (da magazines dat da unit/vehicle can shot) so cuz da cessna have nothin 2 shot its scatchel wid it dont return dem in magazines command  :-\

LCD OUT
Title: Re:Counting Ammo in cargo
Post by: Tomb on 22 Jan 2003, 00:40:08
Rough trans. from LSD'ish to Tombish :

 :D Wassup, hifly!!!! what'cha been eatin' lately man?!! them cessies won't let any scroll count mags fer crap
as long as ya ain't got no mags to frikkin count, lazzy!!!! Try & create a custom weapon outta the satchels
and addWeapon/addMagazine the stuff to yer planes.... then ya can count 'em!  ;D

Or 'setAmmoCargo' to a minimum (i.e. only 1 satchel) and use a looped AddMagazineCargo-banana.
( ::) that is if ya can count ammoCargo at all, which brings us back to yer orig. Q  ::) )


;D