OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Shadow_Spyder on 25 Dec 2007, 20:08:52
-
Ok, so what I am looking to do is when you load up a chopper or whatever airborne vehicle with ammo and weapons ect, you fly to a location where the ground troops are, and via addaction, you click "drop supplies" or whatever and all that ammo/weapons goes into an ammo box and falls to the ground via parachute. I think I can work out the addaction part, but as far as putting all that stuff into an ammo box and getting it attached to a parachute, I am completely lost. I tried searching these forums but didn't come up with any good results, a few of them looked promising but the links they offered were dead. Anyone who can provide me some tips or missions I can check out to see how things work i'd greatly appreciate it. Thx
-
Been a couple few days and no replies yet. I know it has been over the holiday so a lot of people aren't around... but figured I'd give a bump. Thanks!
-
Look at this script (http://www.ofpec.com/ed_depot/index.php?action=list&game=ArmA&type=sc&cat=xyz) to see how to drop an ammo crate with a parachute. One thing you can't do is remove the weapons and ammo from the helicopter and add it to the crate, since there is no way to query what items are in a vehicle's gear inventory. The best you can do is clear the inventory of the aircraft and create and fill the ammobox with arbitrary equipment (since any player could add or remove equipment from the aircraft without you knowing).
-
Thanks Spooner. I am not sure exactly which mission you were wanting me to check out, but I grabbed an Air Resupply one or something because its the only one that really fit.
Anywayz, I looked over the script and even though he explains what each line is doing very well, I am a newb and a half and still don't understand. Especially with the naming of units ect.
Second, a guy from the BI forums had mentioned something about using pickweaponpool and putweaponpool to gather weapons in the chopper and put them in an empty ammobox. Can you confirm this or do you know for a fact this does not work?
-
Sorry, I gave a more vague link than I'd intended. Yes, I meant for you to look at the Air Supply (http://www.ofpec.com/ed_depot/index.php?action=details&id=425&page=0&game=ArmA&type=sc&cat=xyz) script.
You could, in fact, use putweaponpool and then immediately pickweaponpool to transfer everything across correctly, though these commands were designed to put items into the campaign weapon pool and take them out again at a later date. No idea whether this would work at all in MP games though. The pick and then put wouldn't do anything if the item had already been manually removed. Because of this you wouldn't actually ever know what was in either inventory, but you should be able to correctly transfer everything across. Actually, it is a neat way of getting around the problem that I hadn't considered and will actually be useful to me if it works in MP (which I doubt, but it is always worth a try).
-
Copy that Spooner. I can't get it to work at all in my SP test missions, dunno if I'm doing it wrong or not. I set it up by action menue. I place the weapons/ammo in a UH60 named Chopper. I use the action "Take Weapons" which is supposed to "pickweaponpool chopper". Then I have another action "Put Weapons" which is supposed to "putweaponpool ammobox" and I've got my test ammo box named ammobox right there next to the chopper.
Any ideas on how I can get this all to work, if it even will work?
Removed unnecessary quote - Planck
-
May you copy here the code you have for your two actions?
-
Things I have on the map:
My character, no name.
UH60 named Chopper
2X ammo boxes. 1 box named ammobox (the recieving box)
In my characters init field, I've got:
this addAction ["Pick Ammo", "pickweaponpool chopper"]; this addAction ["Put Ammo", "putweaponpool ammobox"]
When I use the 1 ammo box to get my equiptment, load up the chopper, click Pick Ammo and arma CTD's.
Removed unnecessary quote - Planck
-
this addAction ["Pick Ammo", "pickweaponpool chopper"]; this addAction ["Put Ammo", "putweaponpool ammobox"]
I cannot see how that can work, as second parameter of addAction must by an sqs or sqf script, not code.
put these pick commands inside two different scripts, and then put the scripts names as second parameter of addAction.
addAction command (http://www.ofpec.com/COMREF/index.php#5)
-
I have tried it as a script and nothing happened thats why I changed it to what I posted above. I guess the pickweaponpool and putweaponpool don't work in SP missions or something, and as I've heard multiple times now, theres no way to get the weapons/ammo that are inside a vehicles cargo space, so completing my objective can not be done as far as I know.... guess i'll have to scrap this and move on to something new.
Removed unnecessary quote - Mandoble
-
You may do something as follows:
The Put weapons script reads the player's weapons and ammo arrays, and stores them into a global array, adding them to the existing content of that array. Now in that global variable you have all the weapons and ammo you added to the chopper. So, when needed you may empty the array while you fill up an ammo box with its contents.