Home   Help Search Login Register  

Author Topic: Ammo and Choppers and Parachutes  (Read 1707 times)

0 Members and 1 Guest are viewing this topic.

Offline Shadow_Spyder

  • Members
  • *
    • 31st MEU ArmA Realisim Unit
Ammo and Choppers and Parachutes
« 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

Offline Shadow_Spyder

  • Members
  • *
    • 31st MEU ArmA Realisim Unit
Re: Ammo and Choppers and Parachutes
« Reply #1 on: 28 Dec 2007, 03:25:50 »
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!

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Ammo and Choppers and Parachutes
« Reply #2 on: 28 Dec 2007, 15:28:41 »
Look at this script 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).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Shadow_Spyder

  • Members
  • *
    • 31st MEU ArmA Realisim Unit
Re: Ammo and Choppers and Parachutes
« Reply #3 on: 28 Dec 2007, 18:27:10 »
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?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Ammo and Choppers and Parachutes
« Reply #4 on: 29 Dec 2007, 01:57:55 »
Sorry, I gave a more vague link than I'd intended. Yes, I meant for you to look at the Air Supply 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).

« Last Edit: 29 Dec 2007, 02:03:41 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Shadow_Spyder

  • Members
  • *
    • 31st MEU ArmA Realisim Unit
Re: Ammo and Choppers and Parachutes
« Reply #5 on: 29 Dec 2007, 04:39:49 »
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
« Last Edit: 29 Dec 2007, 16:19:15 by Planck »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Ammo and Choppers and Parachutes
« Reply #6 on: 29 Dec 2007, 04:47:16 »
May you copy here the code you have for your two actions?

Offline Shadow_Spyder

  • Members
  • *
    • 31st MEU ArmA Realisim Unit
Re: Ammo and Choppers and Parachutes
« Reply #7 on: 29 Dec 2007, 05:09:39 »

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
« Last Edit: 29 Dec 2007, 16:20:00 by Planck »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Ammo and Choppers and Parachutes
« Reply #8 on: 29 Dec 2007, 16:27:21 »
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

Offline Shadow_Spyder

  • Members
  • *
    • 31st MEU ArmA Realisim Unit
Re: Ammo and Choppers and Parachutes
« Reply #9 on: 29 Dec 2007, 19:52:54 »
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
« Last Edit: 29 Dec 2007, 20:15:00 by Mandoble »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Ammo and Choppers and Parachutes
« Reply #10 on: 29 Dec 2007, 20:18:26 »
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.