OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 15 May 2005, 11:29:08

Title: reamr when empty
Post by: 456820 on 15 May 2005, 11:29:08
okay i have a Vulcan wich when it uses all its ammo i want it to automatically rearm instead of it calling for support because the rearm trucks get blown up from the choppers
So what would i put in a trigger, init field what ever needed to see when the vulcan has no ammo left to give it about 3/4 of full ammo.

Also sorry i spelt the title wrong can someone please sort it out. im a bit tired
Title: Re:reamr when empty
Post by: THobson on 15 May 2005, 11:42:46
Try:
Condition
tankname ammo "VulcanCannon" < 0

Activate:
tankname removeMagazines "VulcanCannon";tankname addMagazine "VulcanCannon"

However this will give you a full load of ammo (one magazine is a full load) .  The reason for removing the magazine first is so that the new magazine replaces what is already there and does not add to it.

I have not tested this.  You may need to check out the command ammo in the comref
http://www.ofpec.com/editors/comref.php?letter=A#ammo (http://www.ofpec.com/editors/comref.php?letter=A#ammo)
Title: Re:reamr when empty
Post by: 456820 on 15 May 2005, 11:47:50
thanks for that but how do i make that happen when the vulcan is out of ammo
Title: Re:reamr when empty
Post by: THobson on 15 May 2005, 11:49:05
I was editing when you were posting.  Check my first reply again.
Title: Re:reamr when empty
Post by: 456820 on 15 May 2005, 11:49:59
oh okay i will test that now cheers