OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Harvey on 10 Dec 2004, 16:13:47

Title: Adding/removing weapons
Post by: Harvey 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 !



Title: Re:Adding/removing weapons
Post by: THobson 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
Title: Re:Adding/removing weapons
Post by: Harvey on 10 Dec 2004, 16:54:17
OK...where might that be ? :-)
Title: Re:Adding/removing weapons
Post by: ACF 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.
Title: Re:Adding/removing weapons
Post by: Harvey 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.)
Title: Re:Adding/removing weapons
Post by: nigel on 14 Dec 2004, 08:14:27
Have you tried it with the RGP7 and an AP rocket ?

(Just a guess...)

Title: Re:Adding/removing weapons
Post by: Tyger 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...