Home   Help Search Login Register  

Author Topic: Adding/removing weapons  (Read 1020 times)

0 Members and 1 Guest are viewing this topic.

Harvey

  • Guest
Adding/removing weapons
« on: 10 Dec 2004, 16:13:47 »
Hi

This is probably really simple....but then so am I ! :-)

What I have is an AI rpg soldier with his AK in his hands and his rpg on his back by default.

What I want (for a cutscene) is to show the rpg soldier with the rpg in his hands and the ak on his back.

But I dont know how.....:-(

Ive tried writing a script, first removing all his weapons, then adding just an rpg and then using the line :

rpg1_action_weaponinhand

but that doesnt seem to work (and im sure theres a better way without having to remove all weapons !)

Any help gratefully received !




Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Adding/removing weapons
« Reply #1 on: 10 Dec 2004, 16:32:02 »
There is a switchMove that gets the guy to crouch holding the RPG ready to fire.  I suggest you download the excellent mission by macguba and ponq that shows all the switchMoves

Harvey

  • Guest
Re:Adding/removing weapons
« Reply #2 on: 10 Dec 2004, 16:54:17 »
OK...where might that be ? :-)

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Adding/removing weapons
« Reply #3 on: 10 Dec 2004, 17:14:15 »
Tried this?

unit selectWeapon weapon
Operand types:
    unit: Object
    weapon: String
Compatibility:
    Version 1.27 required.
Type of returned value:
    Nothing
Description:
    Select given weapon. For weapon values see CfgWeapons.

Example:
    soldierOne selectWeapon "LAWLauncher"


However, if there are enemy infantry or no enemy armour around he'll possibly revert back to the rifle under AI control.

Just a guess, but an alternative may be to remove his AT ammo or set him to 'never fire' and put a 'never fire' enemy AFV out of shot.

Harvey

  • Guest
Re:Adding/removing weapons
« Reply #4 on: 10 Dec 2004, 17:23:33 »
OK, after some looking at this I now have the script :

_rpg1 = _this select 0

_rpg1 switchmove "combat to weapon"

_rpg1 selectweapon "RPGLauncher"

So now he gets his RPG out fine, but puts it away straight away....should I get rid of his AK as well to stop him putting his rpg away ??

(There are other soldiers around btw.)

Offline nigel

  • Members
  • *
  • I'm a llama!
Re:Adding/removing weapons
« Reply #5 on: 14 Dec 2004, 08:14:27 »
Have you tried it with the RGP7 and an AP rocket ?

(Just a guess...)


Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Adding/removing weapons
« Reply #6 on: 14 Dec 2004, 21:09:54 »
try dePBOing the campaign and looking at the credits of the Operation Flashpoint campaign. They have a few scenes of some Russian loons looking down their AT weapons at a US tank and then fireing.

That might help.  The problem with switchMove commands and playMoves are that with some the AI will switch right back out of it.  And i have never been able to select weapon to work...
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08