Home   Help Search Login Register  

Author Topic: Deficient magazines  (Read 2157 times)

0 Members and 1 Guest are viewing this topic.

Offline Rellikki

  • Members
  • *
  • Die-hard OFP player
Deficient magazines
« on: 21 Feb 2011, 15:11:24 »
Is there a way to give units deficient magazines? For example, if you addMagazine an unit a M16 magazine, it always has the full 30 rounds. Is it possible reduce the ammunition count so it would be only half loaded?
« Last Edit: 21 Feb 2011, 15:41:49 by Rellikki »

Walter_E_Kurtz

  • Guest
Re: Deficient magazines
« Reply #1 on: 21 Feb 2011, 17:45:01 »
The only way I can see this to be done is by sliding the ammo gauge far to the left in the unit's setup. Then it would start the mission with one, partly-empty magazine.

If you create a load of units like this in an isolated spot of the map, you should be able to transfer their mags to another using action (check Planck's list of actions for syntax). The following might work:

donor action ["drop magazine",recipient,0,0,"M16"]

(unfortunately, it appears that the recipient has to be inanimate, ie. a vehicle, crate or corpse).

Offline Rellikki

  • Members
  • *
  • Die-hard OFP player
Re: Deficient magazines
« Reply #2 on: 21 Feb 2011, 19:22:51 »
The only problem is that the ammo slider only works on the default ammo that the unit has. After you give the unit new magazines using the addMagazine command, the ammo count isn't affected by the ammo slider anymore. :confused:

Walter_E_Kurtz

  • Guest
Re: Deficient magazines
« Reply #3 on: 21 Feb 2011, 21:01:31 »
Without knowing the circumstances you're trying to engineer it's hard to generate ideas:

1. Create your own config
      - magazines with lower bullet counts and the weapons to fire them

2. Weaponholders
      - start the player without weapons and spawn some near him
Code: [Select]
Armoury_M16 = "weaponholder" createVehicle [(getPos player select 0) + 2, (getPos player select 1) + 2]
Armoury_M16 addWeaponCargo ["M16",1]
then use the donation system as above
      donor1 action ["drop magazine",Armoury_M16,0,0,"M16"]

Offline Rellikki

  • Members
  • *
  • Die-hard OFP player
Re: Deficient magazines
« Reply #4 on: 23 Feb 2011, 20:21:16 »
The first method would of course be the most practical way, but I wanted to know if it's possible by mission editing means. The less required addOns the better.

The second method would probably work too, but as I said, the ammo slider only works for the default loadout of the unit. The M16 magazine I talked about was only just an example, but take for example a magazine type that none of the units have by default and need to be given to the unit with the addMagazine command. In this case the ammo slider wouldn't work anymore, because the addMagazine command gives him a full loaded magazine which isn't affected by it.

But seeing as there doesn't really seem to be another way, I should probably just scratch the whole thing, unless there's any more ideas.

Walter_E_Kurtz

  • Guest
Re: Deficient magazines
« Reply #5 on: 24 Feb 2011, 00:01:08 »
How many rounds are you trying to get rid of? Couldn't you use fire to make the AI discharge the weapon somewhere away from the player? And then employ action to drop weapon / take weapon between units? (Should also work with magazines).

Offline Rellikki

  • Members
  • *
  • Die-hard OFP player
Re: Deficient magazines
« Reply #6 on: 24 Feb 2011, 00:46:07 »
That might just work, I never thought of that. I'll give it a try. Thanks.

Walter_E_Kurtz

  • Guest
Re: Deficient magazines
« Reply #7 on: 24 Feb 2011, 00:51:35 »
Demo mission attached, all done through triggers.

The soldier you can see from the hill should discharge 5 rounds at which point he should crouch and "drop" the weapon. In fact it is transferred to the crate. The player can use Radio Alpha to have the FN-FAL added to his inventory - he should perform the "take" animation and return to standing.