OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Scratchdat on 25 Mar 2003, 17:50:09
-
Is it possible to set the ammo of a unit (in this case, a helicopter) after some of its ammo has already been fired?
There must be some way, because you can do it with an ammo truck :o
-
look up the following commands in the command ref and see if they help you
addMagazine
addMagazines
addWeapon
removeWeapon
removeAllWeapons
-
This probably wont work, for 2 reasons:
1. It is a vehicle, and so doesn't have 'magazines' (also what about Machine Gun in a chopper, does that have magazines? If so good, but missiles dont).
2. The amount of ammo already used is unknown, so i may be adding too little or too much ammo to the chopper.
-
I think it still works for vehicles ..... check the latest weapon and ammo list for the correct names, Kuro's version has them. The syntax is the same. The only complication is that sometimes the missile or whatever is counted as a magazine, and sometimes as a weapon.
Adding too many is not a problem - if the unit is already full, then nothing happens.
It is possible to check to see how many rounds/mags/missiles a unit has left but I'm not sure how to do it. It was mentioned in a thread I read the other day, but I can't remember what it was really about or whether it was this board ... I'll have a look.
-
stuff from the command ref that might be useful
unit ammo magazine
Operand types:
unit: Object
magazine: String
Type of returned value:
Number
Description:
Count how many shots are left for given magazine type.
Example:
player ammo "M16"
unit hasWeapon weaponName
Operand types:
unit: Object
weaponName: String
Type of returned value:
Boolean
Description:
Check if unit has given weapon.
Example:
player hasWeapon "M16"
and I found that thread. (http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=7675;start=0)