OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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 ?
-
Hmmm, try
spetz2 selectweapon (secondaryweapon spetz2)
-
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):
spetz2 playmove "Weapon"
-
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!
-
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.
-
thanks alot i havent tried it but ill have a go witht he playmove idea
once ive tested it ill solve the thread