Home   Help Search Login Register  

Author Topic: Scripting Tank Ammo....Simple?  (Read 511 times)

0 Members and 1 Guest are viewing this topic.

AngusHeaf

  • Guest
Scripting Tank Ammo....Simple?
« on: 16 Dec 2002, 21:22:29 »
I've poured over the scripting reference for a couple hours now and for the life of me I can't find a command to load ammo for a vehicle. I've found how to load cargo ammo for these vehicles, but not primary ammo (main guns). Is this even possible? They couldn't have left that out could they? They included setFuel but is there a way to set the amount of ammo left in whatever vehicle's main guns via scripting?

Thanks for any help.

Kaliyuga

  • Guest
Re:Scripting Tank Ammo....Simple?
« Reply #1 on: 16 Dec 2002, 21:56:18 »
all you have to do to reload a tank or some other such vehicle.. is use these commands :

(This example is for the AH1)
_unit removemagazines "HellfireLauncherCobra"
_unit removemagazines "ZuniLauncher38"
_unit removemagazines "MachineGun30"
_unit addmagazine "HellfireLauncherCobra"
_unit addmagazine "ZuniLauncher38"
_unit addmagazine "MachineGun30"


substitute the _unit for the name of your vehicle that is being reloaded.....  and the bit in quotes should be the weapons used by the vehicle you're trying to reload ;)


AngusHeaf

  • Guest
Re:Scripting Tank Ammo....Simple?
« Reply #2 on: 17 Dec 2002, 20:37:36 »
I've tried that on a few tanks and can't get it to work at all. Someone on another forum mentioned it was a bug but no one else has confirmed it. My code was basically...

_obj removeallweapons;
_obj addmagazine "shell125";

That resulted in nothing being added. The only vehicle I've been able to reload this way is the M2 machine gun. But so far it doesn't work on any armor (the part that matters to me). Any idea if it's really a bug or just something else?

Kaliyuga

  • Guest
Re:Scripting Tank Ammo....Simple?
« Reply #3 on: 17 Dec 2002, 20:48:09 »
Hmm... haven't come across that bug myself...  
I have a nice reload script that allows a total reload of weapons via radio command for any official (BIS)chopper/plane/armored vehicle.

I'll go throw it in an example mission and get back to you with the results..  if it works I'll send you a copy of the mission so you can get a look at it ;)


Kaliyuga

  • Guest
Re:Scripting Tank Ammo....Simple?
« Reply #4 on: 17 Dec 2002, 22:29:52 »
 Well....  I did a little test on my PC using the script I have..

and it works for all the tanks I tried, except the T80 for some reason???  it only reloaded the MG ammo on that one..

here's the mission....  

throw it in your   Users/Missions folder ..  
It's on desert Island ;)

there are four tanks , all are completely empty of ammo..

a T72, T80, T55 and M1A1

if you get in and use the radio commands, you will see the ammo appear  

Radio Alpha: T72
Radio Bravo: T80
Radio Charlie: M1A1
Radio Delta: T55


Kaliyuga

  • Guest
Re:Scripting Tank Ammo....Simple?
« Reply #5 on: 17 Dec 2002, 22:32:12 »
I suppose the mission would help wouldn't it?


;D