Fearing that someone will attempt to lock my topic in the Scripting Ideas section, i've created a beta version of the AmmoBearer script and am placing here.
Bug Fixes/announcements:
I've corrected the error where the unit was given ammunition for every weapon. It now checks to see if the unit has a weapon in the list.
The user is also able to define how many magazines for each weapon the ammobearer has.
The ammobearer will now not run up to a soldier if he has no weapon.
The ammobearer still, however runs up to the soldier if the ammobearer doesn't have any magazines left for the soldier. This bug needs to be fixed. FIXED
Ammobearer groups cannot be assigned yet. FIXED
Ammobearer will now give himself ammo.
Supplies of ammo cannot be changed during the game.
A person in a group can only be resupplied if he is within 50meters of the ammobearer.
AmmoBearer will now return back to his original position.
(Possible Bug) I havn't tested the ammobearer moving in combat, so please tell me if you find any errors, or if the ammobearer stalls somewhere. Please provide statistics. Like how many times he distributed ammo, or if he was in the middle of going back to his original position. This will help speed up completion.
All major errors and bugs are fixed.
The script does not work in multiplayer. It should now, at least I hope
The script only works on one squad. If you want to use it on multiple groups, you will need to change global variables so that they have different names for each instance of the script. FIXED
I'm planning on combining the script into one .sqs file. So hold tight. Completed
To activate the script, do the following:
1.)Create a group of say 5 people
2.)Give one of them a name.(This will be the ammobearer)
3.)Write in the init field: [This], ((Units group this)), ["m16", "m60", "m21"], ["m16", "m60", "m21"], [5,5,5] Exec "Rearm.sqs"; (Put everything except Exec "Rearm.sqs" between brackets.)
4.)Format is: [(Name of AmmoBearer), (Array of magazines), (Array of weapons), (Array of number of supplies for each magazine)] Exec "Rearm.sqs"
5.)Make sure that the first entry in the magazine array corresponds with the first in the weapons array and the array of supplies for each magazine.
Please notify me if there are any bugs at:
Bluelikeu32@hotmail.com
Here's the current v0.84b of the script