Home   Help Search Login Register  

Author Topic: Changing kits between soldiers  (Read 2056 times)

0 Members and 1 Guest are viewing this topic.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Changing kits between soldiers
« on: 12 Jul 2005, 17:27:17 »
here's a little script i put together that lets any 2 units switch kits(all their weapons and ammo).
it should be mp compatible, but i can't test that.

it can be used as an action like it is in the demo mission, but you can also call the script to change 2 ai units or force the player to change,etc

[unit1,unit2] exec "kitswitch.sqs"

order doesn't matter ( [unit2,unit1] )

known bugs:
1: if you don't reload and you switch weapons, it will gain back its ammo in the mag you hadn't reloaded
2: when you switch weapons you have to hit your "toggle weapons" key to be able to fire

i don't think 1 can be fixed, but what about 2? does anyone have any ideas?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Changing kits between soldiers
« Reply #1 on: 12 Jul 2005, 17:51:06 »
question 2 - use 'selectweapon'...
« Last Edit: 12 Jul 2005, 17:51:52 by bedges »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Changing kits between soldiers
« Reply #2 on: 12 Jul 2005, 18:28:29 »
odd, its still didn't work... the same thing happens:
you have your gun out, but you have to toggle between single,burst, grenades (whatever button that is)  to be able to shoot.

Offline Blanco

  • Former Staff
  • ****
Re:Changing kits between soldiers
« Reply #3 on: 12 Jul 2005, 19:50:00 »
Try a combination of selectweapon and
Quote
unitname action ["weaponinhand"]
Search or search or search before you ask.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Changing kits between soldiers
« Reply #4 on: 13 Jul 2005, 06:32:58 »
the weapon is in their hand.

if you dl the script you'll see what i mean
there is a little demo mission where you can take people kits through actions.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Changing kits between soldiers
« Reply #5 on: 13 Jul 2005, 17:16:05 »

_primary = primaryweapon _unit
_ammo = magazines _unit
_weps = weapons _unit

{_unit addMagazine _x} forEach _ammo
{_unit addWeapon _x} forEach _weps
?(_primary == "M16GrenadeLauncher"): _primary = "M16Muzzle"
?(_primary == "Ak74GrenadeLauncher"): _primary = "AK74Muzzle"
?(_primary == "Ak47GrenadeLauncher"): _primary = "AK47Muzzle"


_unit selectWeapon _primary


most addon grenade launcher weapons are also "XXXMuzzle"

there are a few exceptions to the rule

but use the lines above will auto select normal fire muzzle without having to toggle through weapons
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Changing kits between soldiers
« Reply #6 on: 13 Jul 2005, 23:21:27 »
well, if thats the only problem, than why won't a regular m16 get selected, or any other weapon that isn't a grenade launcher

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Changing kits between soldiers
« Reply #7 on: 14 Jul 2005, 00:33:46 »
odd, its still didn't work... the same thing happens:
you have your gun out, but you have to toggle between single,burst, grenades (whatever button that is)  to be able to shoot.

i was replying to that post
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123