Jump to content
Sign in to follow this  
bravo 6

Rearm air vehicles with truck?

Recommended Posts

I was building a mission and my idea is to start the mission with some choppers at base + some planes, both have no fuel and no ammo.

Support trucks were there to refuel and rearm these air vehicles.

Now please tell me why can't i rearm these empty choppers and planes with a simply fully fueled and fully with ammo?

This is ruining my idea for the mission.

help plz.

Share this post


Link to post
Share on other sites

hmm wasnt it the same in ofp that if you didnt have at least one tow or 1 bullet you could not rearm that particular magazine ?

Or am i dreaming of ofp 1.0 again

Share this post


Link to post
Share on other sites

i tryed put a chopper with some bullets.. then fired.. after that i tried to rearm.. i had no option to rearm sad_o.gif

its quite stupid.. if vehicle is empty (fuel and ammo), i can refuel with no problem, infact it auto refuels without my permission, but i CAN NOT REARM pistols.gif

confused_o.gif

why?!

edit: to answer your question, i don't think so. We could rearm even if you had no ammo at all

Share this post


Link to post
Share on other sites

Was ok in ofp.. yeah it does get quite stressfull in a big combond arms map when your trying to save your men and you gotta use all ammo then you run out.. after you run out that helicopter is useless. may as well crash and die when u run out of ammo.

Share this post


Link to post
Share on other sites
Was ok in ofp.. yeah it does get quite stressfull in a big combond arms map when your trying to save your men and you gotta use all ammo then you run out.. after you run out that helicopter is useless. may as well crash and die when u run out of ammo.

yup, that was my idea.

Huge mission with real usefull air support.

This should be fixed ugently

Share this post


Link to post
Share on other sites

Already reported at BTS a long time ago.

Currently you need to have at least one rocket per weapon in the helo to be able to rearm.

Share this post


Link to post
Share on other sites

I made a simple script to get around this issue.  I've tested it in MP a few times and it seems to work better with 1.05 than it did with 1.02.

It uses a helo pad, and any class in the repairlist that lands or drives on the pad will be repaired, refueled and rearmed.  The refueling and repairing are incremental, but the rearming is almost immediate.  I haven't fine tuned it yet, but if it's of use to you, here it is.

It's not universal at the moment, although it could be tweaked simply by changing the repairlist to include "Land" and "Air" and then tweaking a few local vars.  I made it for a specific mission, so that's why I haven't done that yet.  So for what it's worth, here are the instructions and script.

Oh, and for some reason, I can't use getArray to snag the magazines or weapons from CfgVehicle (the vehicle's config), only from CfgWeapons, and in some cases, there are more than 1 type of magazine that works in a particular weapon.  The AH1 and Littlebird share the same FFAR launcher, so I had to add an exception for the AH1.  I'll test and see if I can use getArray with 1.05 to get the magazines and weapons.

1.)  Copy and paste the text below into an sqs named "vclRepariPad.sqs"

2.)  Place a heli pad (or whatever you want to use) into the mission editor and have it exec it like so:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> this exec "vclRepairPad.sqs"

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_pad = _this

;;Add whatever vehicle classes you want to be repaired, refueled and rearmed.

repairList = ["UH60MG","Mi17_MG","Mi17","AV8B2","AV8B","SU34","SU34B","AH1W","AH6","KA50","AH6_RACS","M1Abrams","T72"]

#CheckLoop

~1

_x = 0

#SearchLoop

~.05

_type = repairList Select _x

_obj = NearestObject [_pad,_type]

?!Isnull _obj : Goto "Continue"

Goto "Skip"

#Continue

;;hint format ["%1\n%2",_obj,_pad distance _obj]

?typeOf _obj != _type : goto "Skip"

?_pad Distance _obj < 10 && Alive _obj && getPos _obj select 2 < 2 && Local _obj && !isNull driver _obj : Goto "Found"

#Skip

_x = _x + 1

?_x < Count repairList : Goto "SearchLoop"

goto "CheckLoop"

#Found

_name = getText (configFile >> "CfgVehicles" >> _type >> "displayName")

?damage _obj > .01 && local _obj : titletext [format ["Repairing %1",_name],"PLAIN"]

#RepairLoop

~.03

_obj setDamage (Damage _obj - .01)

?damage _obj > .05 : goto "RepairLoop"

?fuel _obj < 1 && local _obj : titletext [format ["Refueling %1",_name],"PLAIN"]

#FuelLoop

~.03

_obj setFuel (fuel _obj + .01)

?fuel _obj < .99 : goto "FuelLoop"

#Rearm

?local _obj : titletext [format ["Rearming %1",_name],"PLAIN"]

?!local _obj : goto "EndArm"

_weapons = weapons _obj

{_obj removeWeapon _x} foreach _weapons

~1

{_obj addWeapon _x} foreach _weapons

_x = 0

;;player groupChat format ["%1",_weapons]

#GetMagazines

~1

_w = _weapons select _x

_mags = getArray (configFile >> "CfgWeapons" >> _w >> "magazines")

?_type == "AH1W" && count _mags > 1 : _mags = ["38RND_FFAR"]

;;player groupChat format ["_w: %1, _mags: %2",_w,_mags]

{_obj removeMagazine _x} foreach _mags

~1

{_obj addMagazine _x} foreach _mags

_x = _x + 1

?_x < count _weapons : goto "GetMagazines"

~2

?local _obj : titletext [format ["%1 is ready to go.",_name],"PLAIN"]

#EndArm

~30

goto "CheckLoop"

Share this post


Link to post
Share on other sites

Here's another version that's universal.  It should repair all vehicles and rearm them.  Same instructions as above to use it.

EDIT: Ooh, I finally hit a 1000 posts. Man I'm such a spammer.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_pad = _this

;;repairList = ["UH60MG","Mi17_MG","Mi17","AV8B2","AV8B","SU34","SU34B","AH1W","AH6","KA50","AH6_RACS","M1Abrams","T72"]

repairList = ["Land","Air"]

#CheckLoop

~1

_x = 0

#SearchLoop

~.05

_class = repairList Select _x

_obj = NearestObject [_pad,_class]

?!Isnull _obj : Goto "Continue"

Goto "Skip"

#Continue

;;hint format ["%1\n%2",_obj,_pad distance _obj]

_type = typeOf _obj

?_obj isKindOf "Man" : goto "Skip"

?_pad Distance _obj < 10 && Alive _obj && getPos _obj select 2 < 2 && Local _obj && !isNull driver _obj : Goto "Found"

#Skip

_x = _x + 1

?_x < Count repairList : Goto "SearchLoop"

goto "CheckLoop"

#Found

_name = getText (configFile >> "CfgVehicles" >> _type >> "displayName")

?damage _obj > .01 && local _obj : titletext [format ["Repairing %1",_name],"PLAIN"]

#RepairLoop

~.03

_obj setDamage (Damage _obj - .01)

?damage _obj > .005 : goto "RepairLoop"

?fuel _obj < 1 && local _obj : titletext [format ["Refueling %1",_name],"PLAIN"]

#FuelLoop

~.03

_obj setFuel (fuel _obj + .01)

?fuel _obj < .99 : goto "FuelLoop"

#Rearm

_weapons = weapons _obj

?count _weapons < 1 : goto "EndArm"

?count _weapons == 1 && _weapons select 0 in ["CarHorn", "BikeHorn","TruckHorn","SportCarHorn"] : goto "EndArm"

?local _obj : titletext [format ["Rearming %1",_name],"PLAIN"]

?!local _obj : goto "EndArm"

{_obj removeWeapon _x} foreach _weapons

~1

{_obj addWeapon _x} foreach _weapons

_x = 0

#GetMagazines

~1

_w = _weapons select _x

_mags = getArray (configFile >> "CfgWeapons" >> _w >> "magazines")

?_type == "AH1W" && count _mags > 1 : _mags = ["38RND_FFAR"]

;;player groupChat format ["_w: %1, _mags: %2",_w,_mags]

{_obj removeMagazine _x} foreach _mags

~1

{_obj addMagazine _x} foreach _mags

_x = _x + 1

?_x < count _weapons : goto "GetMagazines"

~2

?local _obj : titletext [format ["%1 is ready to go.",_name],"PLAIN"]

#EndArm

~30

goto "CheckLoop"

Share this post


Link to post
Share on other sites

Yeah but this kinda spam is Goooooood notworthy.gif

Checkin this out now just what i needed

EDIT: ok this works good heres the only thing. With the one i was working on i wanted to make sure the

A: You couldnt fly over the top and be rearmed and refuelled without landing

B:i also wanted to introduce a time delay with Vehicle chat...looked a bit like this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_load = _this select 0

~1

_load vehiclechat "Harrier is ready in 60 sec.";

~0

_load setfuel 0

~10

_load setdamage 0

~5

_load addMagazine "4Rnd_Sidewinder_AV8B"

_load vehiclechat "Harrier is Rearming.";

~5

_load addMagazine "4Rnd_Sidewinder_AV8B"

~10

_load addMagazine "300Rnd_25mm_GAU12"

~5

_load addMagazine "300Rnd_25mm_GAU12"

~10

_load vehiclechat "Harrier is Rearmed.";

~5

_load vehiclechat "Harrier is Refueling.";

~10

_load setfuel 1

~1

_load vehiclechat "Harrier is ready for flight.";

exit

sorry im crap at this hehe

Youl notice i kill the fuel first until its fully rearmed and reloaded this again stops people triggering then running off.

Is this easy to implement as like i said im crap at this

Wedge

Share this post


Link to post
Share on other sites

It wouldn't be hard to implement long waits, but perhaps if I added a check to make sure the vehicle hadn't left the pad as well. Like if the vehicle's distance increases from the pad, then it'll stop repairs, etc. It could also check for the vehicle's speed, so if it's != 0, then it won't start.

Another thing I noticed is that if you rearm an Abrams, it'll rearm the main gun, but not the commanders gun. I assume there must be some other command for that...not sure.

Share this post


Link to post
Share on other sites

These scripts you wrote are absolutely awesome. What a great service to the community. Thanks for sharing!

Can this (the rearm part of this) wonderful script be adapted to a mobile ammo truck?

It would suck to have tanks and mobile AA have to return to a repair pad just to rearm.

Thoughts?

Share this post


Link to post
Share on other sites

You can add it to anything. I just used a pad as a reference. If you want to limit pads to only aircraft, just modify the repairlist to have only "Air" in it.

Then copy the script and have one with only "Land" in the repairlist and have a truck or something exec it.

BTW, I have a newer version with more functionality--it checks to make sure the vehicle hasn't left the pad, etc. I'll probably slow down repair time, although you can easily modify the thing as it is now by changing the wait periods.

It still doesn't work right with some vehicles if they don't have gunners because of the bug in the game, but if you switch to gunner seat, it'll fully rearm anything, even with 0 ammo in the weapon.

The only weapons it can't reload are secondary turrets, like the commander turret on the Tanks and the door gunner on the UH60. I just don't know how to add magazines to those. Maybe I'll stick a thread up to see if anyone else knows how to do that.

I'll put the updated version here later. I'll probably edit my previous posts with it.

Share this post


Link to post
Share on other sites

Yeah, it's pretty much done for now.  I could make it fancier, I suppose, but until I figure out how to refill the secondary turrets on the tanks and UH60, there's not much I'll do to it.

This makes it so you can hop in the gunner seat and rearm those stubborn aircraft with gunner positions.  Apparently if you hop in as pilot, say in an AH1 in MP, when you try to rearm, the thing will keep resetting to 0.  So you have to hop in as gunner, rearm it, then get back as pilot.  After that, it seems to rearm just fine.  I suspect it's because if you're both gunner and pilot, the it makes the unit local to you.  *shrug*

I toyed with another version that actually uses getArray to get ammo from the various turrets, but I found that every vehicle config has different turret names and such so it wouldn't be as universal--i.e. you'd have to edit it for future addons with different turret names and such.  So I left it like this.  It's not perfect, but it works well enough.

Oh, and if you're wondering why I left it as SQS, I've had some odd performance issues with SQF scripts taking up too much CPU overheadin MP missions, so I'm sticking with good old SQS for now, especially in cases where several instances of the script could be running at once.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_pad = _this

;;repairList = ["UH60MG","Mi17_MG","Mi17","AV8B2","AV8B","SU34","SU34B","AH1W","AH6","KA50","AH6_RACS","M1Abrams","T72"]

repairList = ["Land","Air"]

#CheckLoop

~3

_x = 0

#SearchLoop

~1

_class = repairList Select _x

_obj = NearestObject [_pad,_class]

?!Isnull _obj : Goto "Continue"

Goto "Skip"

#Continue

;;hint format ["%1\n%2",_obj,_pad distance _obj]

_type = typeOf _obj

?_obj isKindOf "Man" : goto "Skip"

?_pad Distance _obj < 10 && Alive _obj && getPos _obj select 2 < 2 && Local _obj && count crew _obj > 0 : Goto "Found"

#Skip

_x = _x + 1

?_x < Count repairList : Goto "SearchLoop"

goto "CheckLoop"

#Found

_name = getText (configFile >> "CfgVehicles" >> _type >> "displayName")

?damage _obj > .01 && local _obj : titletext [format ["Repairing %1",_name],"PLAIN"]

#RepairLoop

~.03

_obj setDamage (Damage _obj - .01)

?damage _obj > .005 : goto "RepairLoop"

?fuel _obj < 1 && local _obj : titletext [format ["Refueling %1",_name],"PLAIN"]

#FuelLoop

~.03

_obj setFuel (fuel _obj + .01)

?fuel _obj < .99 : goto "FuelLoop"

#Rearm

_weapons = weapons _obj

?count _weapons < 1 : goto "EndArm"

?count _weapons == 1 && _weapons select 0 in ["CarHorn", "BikeHorn","TruckHorn","SportCarHorn"] : goto "EndArm"

?local _obj : titletext [format ["Rearming %1",_name],"PLAIN"]

?!local _obj : goto "EndArm"

{_obj removeWeapon _x} foreach _weapons

~1

{_obj addWeapon _x} foreach _weapons

_x = 0

#GetMagazines

~1

_w = _weapons select _x

_mags = getArray (configFile >> "CfgWeapons" >> _w >> "magazines")

?_type == "AH1W" && count _mags > 1 : _mags = ["38RND_FFAR"]

;;player groupChat format ["_w: %1, _mags: %2",_w,_mags]

{_obj removeMagazine _x} foreach _mags

~1

{_obj addMagazine _x} foreach _mags

_x = _x + 1

?_x < count _weapons : goto "GetMagazines"

~2

?local _obj : titletext [format ["%1 is ready to go.",_name],"PLAIN"]

#EndArm

~30

goto "CheckLoop"

Share this post


Link to post
Share on other sites
Yeah, it's pretty much done for now. ...

Uh oh - a problem.

This works good in single player and testing in the mission editor, but does NOT function correctly on a dedicated server.

If you sit on the pad, it will refuel and repair you - but the weapons don't work - in particular with the AH1Z.

Is it possible that game-logic needs to be integrated into the script?

In my troubleshooting - if I sit on the pad, my hellfires go up to 8 (full), then shoot back down to zero. But in editor-testing, it remains full at 8.

Share this post


Link to post
Share on other sites

It would also be cool if you could have a few grunts actually loading the ammo as well or at least simulated.

Share this post


Link to post
Share on other sites

You could also use the mapfacts mode for this too. In the mapfacts demo missions, you will find some examples of each mode and the scripts they added for refuel, repair and rearm.

Share this post


Link to post
Share on other sites

This works fine on a dedicated server. As I mentioned in an earlier post, BIS hasn't fixed the bug where if you don't have a gunner, then the vehicle will not rearm properly. If you get in as gunner, rearm and then get out, it'll work fine.

I use it in several of my missions on my dedi.

Share this post


Link to post
Share on other sites
Yeah, it's pretty much done for now.  I could make it fancier, I suppose, but until I figure out how to refill the secondary turrets on the tanks and UH60, there's not much I'll do to it.

This makes it so you can hop in the gunner seat and rearm those stubborn aircraft with gunner positions.  Apparently if you hop in as pilot, say in an AH1 in MP, when you try to rearm, the thing will keep resetting to 0.  So you have to hop in as gunner, rearm it, then get back as pilot.  After that, it seems to rearm just fine.  I suspect it's because if you're both gunner and pilot, the it makes the unit local to you.  *shrug*

I toyed with another version that actually uses getArray to get ammo from the various turrets, but I found that every vehicle config has different turret names and such so it wouldn't be as universal--i.e. you'd have to edit it for future addons with different turret names and such.  So I left it like this.  It's not perfect, but it works well enough.

Oh, and if you're wondering why I left it as SQS, I've had some odd performance issues with SQF scripts taking up too much CPU overheadin MP missions, so I'm sticking with good old SQS for now, especially in cases where several instances of the script could be running at once.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_pad = _this

;;repairList = ["UH60MG","Mi17_MG","Mi17","AV8B2","AV8B","SU34","SU34B","AH1W","AH6","KA50","AH6_RACS","M1Abrams","T72"]

repairList = ["Land","Air"]

#CheckLoop

~3

_x = 0

#SearchLoop

~1

_class = repairList Select _x

_obj = NearestObject [_pad,_class]

?!Isnull _obj : Goto "Continue"

Goto "Skip"

#Continue

;;hint format ["%1\n%2",_obj,_pad distance _obj]

_type = typeOf _obj

?_obj isKindOf "Man" : goto "Skip"

?_pad Distance _obj < 10 && Alive _obj && getPos _obj select 2 < 2 && Local _obj && count crew _obj > 0 : Goto "Found"

#Skip

_x = _x + 1

?_x < Count repairList : Goto "SearchLoop"

goto "CheckLoop"

#Found

_name = getText (configFile >> "CfgVehicles" >> _type >> "displayName")

?damage _obj > .01 && local _obj : titletext [format ["Repairing %1",_name],"PLAIN"]

#RepairLoop

~.03

_obj setDamage (Damage _obj - .01)

?damage _obj > .005 : goto "RepairLoop"

?fuel _obj < 1 && local _obj : titletext [format ["Refueling %1",_name],"PLAIN"]

#FuelLoop

~.03

_obj setFuel (fuel _obj + .01)

?fuel _obj < .99 : goto "FuelLoop"

#Rearm

_weapons = weapons _obj

?count _weapons < 1 : goto "EndArm"

?count _weapons == 1 && _weapons select 0 in ["CarHorn", "BikeHorn","TruckHorn","SportCarHorn"] : goto "EndArm"

?local _obj : titletext [format ["Rearming %1",_name],"PLAIN"]

?!local _obj : goto "EndArm"

{_obj removeWeapon _x} foreach _weapons

~1

{_obj addWeapon _x} foreach _weapons

_x = 0

#GetMagazines

~1

_w = _weapons select _x

_mags = getArray (configFile >> "CfgWeapons" >> _w >> "magazines")

?_type == "AH1W" && count _mags > 1 : _mags = ["38RND_FFAR"]

;;player groupChat format ["_w: %1, _mags: %2",_w,_mags]

{_obj removeMagazine _x} foreach _mags

~1

{_obj addMagazine _x} foreach _mags

_x = _x + 1

?_x < count _weapons : goto "GetMagazines"

~2

?local _obj : titletext [format ["%1 is ready to go.",_name],"PLAIN"]

#EndArm

~30

goto "CheckLoop"

To refill all weapons (no matter if doorgunner UH60MG(M134) or Reargunner at RHIB2Turrets(Mk19) or even commander turrets at T72 (DSHKM), M1Abrams (M2) even from zero ammo (red 0). Just use:

? local vehicle player : (vehicle player) setVehicleAmmo X

where X = from 0 to 1

0 means no ammo (red zero)

0.5 means all weapons to 50% of ammo.

1 means all weapons to max. ammo possible (no adding mags)

This command is only refilling the actual magazine for all weapons.

But this command can't work properly if you in Mission Editor, moving the bar of ammo to ZERO.

So if you need more mags, try the method:

-removeMagazines

-removeWeapon X

-addMagazine Y (loop if needed more)

-addWeapon

So i recommend if you want to start a mission with some vehicles to ZERO ammo but in the mission can be rearmed,

use "remove-add" way if vehicles has more than one mag or

directly the setVehicleAmmo if vehicle has only one mag.

Share this post


Link to post
Share on other sites

Ok, i think that i have to speak more about rearming vehicles.

I will write only details for MP.

As an example, i will say that i'm stuck in a MP script to support vehicles.

This is the fact and enough tested:

- You can repair and refuel vehicles with 0 bugs with the commands 'vehicle player setDammage X' and 'vehicle player setFuel X'. I'm doing in this way with a filter so only one human player can repair-refuel from its actual status till 100%.

No matter if the human player is not gunner,commander,driver/pilot etc... just it works.

No matter if AI is inside, no matter with which seats is occuping AI.

Just add a filter to ensure that only one human player will run the repair/refuel.

If you doing a 'progressive in time' support, it will seems closer to ArmA style.

You can get repairs from the object (not only 'repair truck' and/or 'Ural Repair'wink_o.gif you want. I added the 'land_repair_center'

as an 'allowed-repair-object'. I'm not writing an addon.

You can refuel from the object you want.

Read the list of Actions for "REARM","REFUEL" and "REPAIR". It's a copy of ArmA way doing (with its bugs too).

And the time for my jewel, REARM.

What i've tested as 100% OK in MP?

Always me, as host in non dedicated server, my own computer.

- Human player piloting plane. I've written a piece of script to repair-refuel-rearm planes without to land, just flying over the airport (Paraiso Airport,Pita Airport, Rahmadi Island Airport and Antigua Island Airport" below 25 meters altitude.

It works 100% good if no human gunner inside (su34's).

It means, if only one human player inside a plane, it will rearm 100% all weapons even FROM ZERO AMMO in one or all weapons.

In planes, you have only 1 mag per weapon, so you can use setVehicleAmmo instead removeweapon-removemag-addmag-addweapon way. It's faster and easier.

- in su34's, if both human players inside... only working 100% repair/refuel with setFuel and setDammage. setVehicleAmmo is doing in some cases weird things. But never rearming 100%.

I tried the quitweapon,addMags,addWeapon style, but it remains the same. Buggy buggy.

The bug is not cause of su34, is cause one human player filtered as 'local to vehicle' is running the rearm piece of script, and the other (gunner) not. I tried the animal-thing to

make both the rearm sequence, but is more weird lol and never rearming 100%.

When a human player is flying alone the su34, rearming even from zero, 100% perfect. So, covering the ArmA bug.

-Choppers can get support in helipads (Heli_H_civil and Heli_H)

but it remains the same: refuel/repair is 100% ok, no matter how many human players inside, and Rearm is failing when more than one human player inside. As example, in AH1Z, the bug is equal to su34 case.

- Choppers can also reheal his crew when near: rescue helipad (Heli_H_rescue),MASH,BMP2 ambulance and M113 ambulance. Working good.

- Rest of vehicles:

- Repairs at repair trucks and near 'repair_center'.

- Refuel at all kind of gas stations except the 'small_gas_tank', that has to be handled with 'nearestObject id', of course, in fuel trucks too, and im thinking in certain type (color) of barrels.

- Rearming vehicles at ammo crates (im crazy, i know) and near ammo trucks too (yes, from zero ammo too). But the same bug occurs when more than 1 human player inside.

I made a lot a lot lot lot lot LOOOOOOOOOOOOOOOOTTTT of tests with different ways to rearm. And finally, got stuck.

This is my final status of tests:

- SPECIAL VEHICLES:

the script can know how many ammo/mags has:

- KA50 in ALL its weapons (2A42 AP and 2A42 HE too)

- UH60MG in both M134 cannons (but right cannon if fired by human, not AI. If fired by AI, when rearming again, reset to 2000 bullets and again under control).

- T72 in ALL its weapons including the DSHKM machine gun for commander (can be rearmed only one mag, not all, because if you adding mags, will be added to driver/gunner space, adding a 3rd weapon to driver/gunner, not to real commander machine gun DSHKM.

- same for M1Abrams, both M256, and for commander it can rearm only one mag.

- BMP2 has the same 2A42 weapon of KA50, so, yep, i can know all its ammo.

- In RHIB2Turrets can be known all his ammo/mags, but reargunner weapon (Mk19) can be rearmed only the actual mag.

- there is a land rover that ArmA never showing ammo in Hint-style , but you can know his ammo/mags too. Shooting M2 in 6 mags. Well, can't remember if this vehicle is the land rover with M2 machine gun or the humvee with M2 MG.

As a curiosity, i know who is the 2nd gunner of UH60MG and RHIB2Turrets.

Ah, another detail, who knows how to drive at max. 20km/h an UAZ AGS-30 with only the rear wheels? (front wheels in air). I know a certain lynx can do it.

Well, but now, the final ask:

Well, returning to rearm matters...

I think, that the rearm bug that im speaking about with some commands published by ArmA only appearing when more than one player inside a vehicle.

So

Same script in both players will make this 'truth':

Player 1 with script X will meet "? local vehicle player" as true.

Player 2 with script X will meet "? local vehicle player" as false.

Assuming that Player 1 is driving/piloting.

As i said before, im doing a simple filter to select who can launch this line to rearm the vehicle:

- ? local (vehicle player) : goto "StartToRearm"

so, only the player with that line as true, will start to rearm the vehicle.

Then... why a player when is alone (or only 'surrounded' by AI)can rearm the vehicle? no matter if player is gunner or commander, if he is the only one human inside, he can at 100%.

The bug is like an infinite loop rearming and rearming and rearming... and never done. Just looping to start with his original amount of ammo just when started to rearm.

Anyone can rearm a vehicle even from zero ammo, with more than one human player inside the 'target' vehicle?

Share this post


Link to post
Share on other sites

Well, one reply more:

Trying rearm methods i found this info that can call for errors.

In ArmApedia, wiki is declaring that "UH60MG" vehicles has "M134_2" and "M134" as weapons... that is not fair.

If you using the command 'weapons', it will show only "M134", the real left gun, and with 'magazines (vehicle player)' it will show that there is only one magazine (and it belongs to left gun).

Well, how to find that "M134_2" ?

Just use the Event Handler "FIRED".

Then you will see that "M134_2" that is only fired by the 2nd gunner (doorgunner, right gunner).

Another question.

How is working the 'hidden' weapons of some vehicles?

- M1Abrams. Originally, it has 3 weapons. M256 (with 2 differents magazines, one for SABOT and one for HE), the 2nd weapon called "M240_veh" that is a MG, and the fatal last, the MG for commander 'M2'.

Well, with the command 'weapons', it will show you only the "M256" and the "M240_veh". Why? dunno, i'm not an ArmA programmer. But how can we manage this? Wait, patience.

With the command 'magazines (vehicle)' it will show you only

this: mag for "M240_veh" and maybe 2 more.

Maybe??? yes. If you fired all SABOT's (20), you will lose the magazine item "20Rnd_120mmSABOT_M1A2", and if then, you firing the HE ones (also 20), you WILL NOT lose the "20Rnd_120mmHE_M1A2". And the same example at inverse. You will never get the magazine for the commander MG.

Well, i can experiment... if i write this... (vehicle) addMagazine "100Rnd_127x99_M2" ... yeah! i'm adding a magazine for MG of commander! but... commander will have no more mags. Why? because you are ALWAYS adding weapons/magazines to the 'space' of the driver/pilot and gunner (not 2nd gunner). So if finally, you adding the weapon 'M2' for this M1Abrams, driver and gunner will be able to fire this new weapon, but still the MG of the commander (that is a M2 too) will have the same ammo/mags. I hope enough explained.

- T72. The same style as M1Abrams, but changing the name of weapons/mags.

- KA50. The amazing Kamov 50. Well, it has no troubles with the rockets and Vikhr's. As in the T72 and M1A1, this chopper has a strange weapon, the "2A42". It has 2 different magazines. One for AP (dunno, im not militar), and one for HE (High Explosive?), so the same style that tanks, if you firing till 0 one of them, you will lose that mag, but if you firing the other mag till 0, you wont lose it. So you (maybe) have not to add it. "Low" and "High" is appearing in ArmA HUD when you are firing that "2A42", but is not LOW for 2A42-AP and HIGH for 2A42-HE. Its just the rate of fire. LOW = 1 bullet at a time, and HIGH = 5.

Well if you using the command 'ammo' to know how many ammo has "2A42" weapon you will get only the ammo for the current selected magazine. It means. If you are firing the AP rounds, then you will get the ammo for AP (from 0-230) and if you are firing (or just selected) HE rounds, you will get the ammo for HE magazine (from 0 to 230 too). Yep, its weird, but its a fact.

- BMP2. Same weapon "2A42" of KA50. Same mags, same weird behaviour. Commander of BMP2 can't fire, so this vehicle has no more 'weird' weapons, it has no more turrets. The other weapons are normal "PKT" MG. So you can know so easily its ammo, except for "2A42". 2A42 in BMP2 has 250 'bullets' per magazine, both.

And finally, the last strange vehicle in know his weaponry:

- RHIB2Turrets. It has 2 turrets, like UH60MG. Frontgunner is shooting a "M2" Machine Gun (MG) with more than one magazine (easily knowable) and the last weird weapon, the weapon of Reargunner, the Mk19 grenade launcher.

This weapon is not appearing with the command 'weapons' and his mags (48 grenades x 4 mags) not appearing with the command 'magazines'.

So... how can we know the ammo and his mags of this weird weapons?

Not easily, but not impossible.

I tried Event Handler "FIRED" launched for (vehicle player) so

all players inside your vehicle can know the same info as you.

I will not explain how this EH is working, but you will see that "FIRED" EH is telling you which weapon, which magazine and with which ammoclass was fired... etc. This EH is fired each time a 'piece' of ammo is fired. As example, the UH60MG machine gun of gunner or doorgunner can shoot in Low Rate, 5 bullets per time, and in High rate, 25. Identical to M134 weapon of AH6 and AH6_Racs. But here starts another strange issue. Maybe is lack of my computer, or maybe is another ArmA trick. If you shooting the M134 at low rate, EH will be fired 5 times. If you firing M134 at high rate, EH will be fired 5 times too... at least EH is telling you if the weapon is firing in low or high rate, but it makes us to do a lot of added work.

Well, another funny thing, how many times you dreaming with an AH6 or AH6_Racs with more seats for cargo players...

Well too... we can think at inverse way... why not take a MH6 or MH6_Racs and adding it weapons?

It works, i enough tested with the same weapon as UH60, 38 FFAR's, the same magazine in AH6... 14 x FFAR's... it will be fired from the center of the MH6, it means from the physical center of the vehicle. Because MH6 has no chassis for weapons lol it is so weird for me. And more weird... can be rearmed with normal ammo trucks, without adding more script.

Just remaining the same Zero-Ammo-Bug.

But i have no 'moral' to add Hellfires or the weapons from planes to that MH6... lol so abuser.

In the same time, i tried to add horns to certain vehicles that have not that funny (for me) stuff.

All support Ural's have not horn. All motorcycles too, the 3 UAZ's... etc etc.

I got stuck too with this issue... so, you have to add the horn as a weapon , and you have to add the action "MANUALFIRE" to be enabled to driver/gunner to 'fire' the Horn, but probably nobody will hear it... dunno why not, it seems nobody, not 100% tested.

You can add too the 'BikeHorn' to make more fun. But not, you can't add combat weapons to the tractor, and not, to the motorcycles too =( OOooooh !!!! no super tractor...

Well, really you can add weapons and magazines, but motorcycles only will 'fire' horns. Not flares and grenades =(

The weird thing starts when with the horns, as it is added as weapon, can be used by the gunner, yeps, mostly of times but is doing some disturb to gunner and pilot sigh... but i tried.

So i hope this tarzan english can be understood and you dont hating me. Try your own crazy tests, probably you will see a lot of truths and a lot of interesting 'crazy changes'.

Share this post


Link to post
Share on other sites

LOL, another reply to myself to the command setVehicleAmmo.

If you wanting to start a mission with a vehicle at 0 ammo but you want that vehicle can be rearmed... you have a problem.

You can't use the command setVehicleAmmo to zero value because with normal ArmA style the ammo trucks cant rearm a vehicle from zero ammo.

Just quit the weapon/weapons, not his magazines. And it will make you more work to do to detect when which vehicle is near the trucks and when you have to add it the weapon/weapons.

You can use the setVehicleAmmo to zero as an initcondition of a vehicle, if when rearming, you increasing that value, ArmA by default will rearm nothing. Just you must to do it.

Forget to rearm vehicles in this way:

(vehicle player) setVehicleAmmo _ammovariable

and then making _ammovariable = _ammovariable + 0.01

as an example.

Why?

Because at start, 0.01 means to add an 1% of ammo to all weapons. In some cases, this will add nothing.

Real example:

AH1Z, with 0 ammo in all his 3 weapons.

1% adding to Hellfires will do nothing, because the 1% of 8 (max amount of hellfires, that is 100%), is too low under 1 x Hellfire. So it will add nothing.

Well, a trick, the AV8B Harrier that is not a bomber, can carry 4 x AIM9X, so it means the minimum % of succesful rearm will be 0.25, the 25%, as the 25% of 100% is 4, so 1 missil of 4 will be added.

But its not really truth and not really a lie.

Just try to add when all is zero, 0.08, then add 0.06 if you want, to make a loop closer to the original style of ArmA, with the difference, that setVehicleAmmo will add a common value for ALL WEAPONS, not to certain one. And remember, that value is not a number of ammo itself, just deal with it like a percentage divided by 100.

Only you have to add a delay for that loop to make it in a balanced reallistic/playable way.

So it depends on the vehicle you want to rearm, which is the lowest percentage 'reasonable' to make a weapon growning.

The percentage is always from one magazine. This command will not add more magazines... but yep, it can quit magazines from a vehicle... so powerful, weird and buggy at the same time.

Another issue and i hope the last one with rearm:

If you are using the method removeweapon etc etc addweapon... in some vehicles when just added the weapon to be rearmed... you will notice that you cant fire it !!!!

Just type as example:

vehicle player selectWeapon "nameofweapon"

where "nameofweapon" can be the position of an array...

but without ""

Then you will see the weapon in the ArmA HUD.

And if still you cant shoot it... just use an action "MANUALFIRE". But this last, handle it with a lot of eyes.... because you can fire the weapon that is moving the gunner... (never the 2nd gunner).

Share this post


Link to post
Share on other sites

Resupply using trucks!!

http://www.flashpoint1985.com/cgi-bin....1040772

I do currently use a 'hand rolled' script to detect when the helicopter is resupplied correctly.

Is there a way to tell what the 'maximum FIRABLE capacity' of a vehicle for a particular weapon is from the configs. By firable I mean not cargo.

Also I have heard that reading the config files can cause performance issues, anyone like to comment ?

Barmy

Share this post


Link to post
Share on other sites

I did it, but in a complicated way.

As i noticed in ArmA 1.05 (original addOn), the vehicle that has the max. amount of 'fireable' weapons is 4.

So catch this concept.

Weapon1 : make the 100% of the max amount.

Weapon2: make the 100% of the max amount.

.

.

.

Weapon 4 : make the 100% of the max. amount.

If we have a vehicle with 3 weapons... make % of Weapon 4 = 100.

If we have a vehicle with 2 weapons... make % of Weapon 3 to 100, and Wpon4 to 100.

.

.

.

As example:

AH1Z. 3 Weapons. One mag per weapon.

Weapon1: M197 cannon. 100% = 750 x 1 (750 bullets, 1 mag).

Weapon2: FFAR rckts. 100% = 38 x 1 (38 rockets, 1 mag).

Weapon3: Hellf's missils. 100% = 8 x 1 (8 missils, 1 mag).

Weapon4 = none, then 100%  wink_o.gif

As example now:

_NeedingW1 = 0

_NeedingW2 = 0

_NeedingW3 = 0

_NeedingW4 = 0

_ammoW1 = _myCobra ammo "M197"

_ammoW2 = _myCobra ammo "FFARLauncher"

_ammoW3 = _myCobra ammo "HellfireLauncher"

_percAmmoW1 = round (_ammoW1 / 7.5)  ; ? _percAmmoW1 < 100 : _NeedingW1 = 1

_percAmmoW2 = round (_ammoW2 / 0.38) ; ? _percAmmoW2 < 100 : _NeedingW2 = 1

_percAmmoW3 = round (_ammoW3 / 0.08) ; ? _percAmmoW3 < 100 : _NeedingW3 = 1

_percAmmoW4 = 100

Now _percAmmoW1 = percentage from max amount (750).

And all weapons with percentage.

_NeedingRearm = 0

? ((_NeedingW1 == 1) OR (_NeedingW2 == 1) OR (_NeedingW3 == 1) OR (_NeedingW4 == 1)) : _NeedingRearm = 1 ; goto "REARM"

#NoNeedingRearm

(END)

The script i wrote here is not a real one. My original one is much more complicated.

If you have more than 1 mag, you need another kind of maths... I gave you only one possible way. Not the only one.

You have to make a lot different and complicated script to catch ammo of special vehicles/turrets.

Use Event Handler 'fired' to catch ammo of these vehicles:

- KA50. Weapon "2A42" with 2 kind of different ammo.

- BMP2. Weapon "2A42" with 2 kind of different ammo.

- UH60MG. Weapon "M134_2".

- RHIB2Turret. Weapon "MK19".

- M1Abrams. "M256" & "M2".

- T72. "D81" & "DSHKM".

Following weapons can be rearmed only its actual/last mag:

- RHIB2Turret. MK19. (Reargunner GL).

- M1Abrams. M2. (Commander MG).

- T72. DSHKM. (Commander MG).

The rest, can be fully rearmed (all mags, no matter).

Quote[/b] ]Is there a way to tell what the 'maximum FIRABLE capacity' of a vehicle for a particular weapon

If you making arrays with some REAL info about declaring max weapons... its names... its name of magazines... you can do easy maths to test the weapons of a vehicle.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×