OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 09 Sep 2005, 21:40:42

Title: does select weapon ever work
Post by: 456820 on 09 Sep 2005, 21:40:42
ive tried selectweapon in a script and the unit never selects the weapon
i use
spetz2 selectweapon "At4Launcher"
of course hes called spetz2 and he has an At4
but he doesnt select it i want him to swing it out then target a truck then im going to grab the missile and do a few camra angles on it but ive seen many people use select weapon and it never works so is there an easier alternative ?
Title: Re:does select weapon ever work
Post by: Blanco on 09 Sep 2005, 22:04:51
Hmmm, try
Quote
spetz2 selectweapon (secondaryweapon spetz2)

Title: Re:does select weapon ever work
Post by: Kyle Sarnik on 09 Sep 2005, 22:32:49
Hmmm, try

No, thats not the problem, and I will tell you this, it DID work, the unit will select the AT4Launcher, however, your problem isn't that he won't select it, its that even with a secondary weapon selected, an AI unit WON'T allways switch to the animation untill they are about to fire it. Therefore, the solution would be to add this line after/under your first one (which is fine, leave it):

Code: [Select]
spetz2 playmove "Weapon"
Title: Re:does select weapon ever work
Post by: RujiK on 10 Sep 2005, 03:17:21
I had this problem in an intro that I was doing where a unit refused to pull out his lawlauncher. One loop around it though is (this will only work in cutscenes or rare other occasions) to just setpos a tank where the player cant see it and then voila! The unit pulls out his weapon!
Title: Re:does select weapon ever work
Post by: Kyle Sarnik on 10 Sep 2005, 03:29:29
I had this problem in an intro that I was doing where a unit refused to pull out his lawlauncher. One loop around it though is (this will only work in cutscenes or rare other occasions) to just setpos a tank where the player cant see it and then voila! The unit pulls out his weapon!

There is an easier, more precise way to do it, simply force the unit to select the weapon and then force the animation on him like I stated in my previous post. Trust me on this one I am positive with it.
Title: Re:does select weapon ever work
Post by: 456820 on 10 Sep 2005, 09:40:24
thanks alot i havent tried it but ill have a go witht he playmove idea

once ive tested it ill solve the thread