OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Scratchdat on 09 Jun 2004, 18:04:37

Title: unit selectWeapon "Binocular" wont work???
Post by: Scratchdat on 09 Jun 2004, 18:04:37
Should be quite simple but apparently its not.

Basically I want a unit to use his binoculars, but

unit selectWeapon "Binocular"

doesn't seem to work, even though the unit has binoculars in his inventory.

Any ideas?
Title: Re:unit selectWeapon "Binocular" wont work???
Post by: Tomb on 09 Jun 2004, 23:00:02
 :) yea, dude. ya need to use the default "play/Switch-Moves" from a list, pref. using a script :

Name a guy Bob, then in a scroll you put:

Bob playMove "StandToBinocStand"

..or whatever the code is. And then a short delay before you loop the command. ;) :thumbsup:
And finally, a trigger could fire the magic word that would cut the loop & exit the script.


Example:

Code: [Select]
#loop
~2
bob switchMove "CombatRunFtoLying"
~2
bob selectWeapon "binocular"
?notbozoBinocing: bob switchMove "auto", exit
goto "loop"

som'n like that would make bob lie down & use them binocs  ::) ;D

later :-*
Title: Re:unit selectWeapon "Binocular" wont work???
Post by: Scratchdat on 10 Jun 2004, 08:29:33
Cheers m8  

:thumbsup:
Title: Re:unit selectWeapon "Binocular" wont work???
Post by: Blanco on 10 Jun 2004, 18:37:17
Should be quite simple but apparently its not.

Basically I want a unit to use his binoculars, but

unit selectWeapon "Binocular"

doesn't seem to work, even though the unit has binoculars in his inventory.

Any ideas?


Works for me, make sure you put the unit in SAFE behaviour.

@Tomb
Code: [Select]
bob switchMove "auto",
???
do you mean ?
Code: [Select]
bob setunitpos "AUTO"





Title: Re:unit selectWeapon "Binocular" wont work???
Post by: Tomb on 10 Jun 2004, 20:23:32
 :) nope, m8
I was talking about animations... If you selectWeapon Binocs, he'll pocket them again
after a short while. To avoid this (for cutscenes or alike), a looped scroll works better. :thumbsup: