OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: shadow99 on 23 Jul 2004, 07:18:14

Title: "LOOK at someone when you're speaking to them!"
Post by: shadow99 on 23 Jul 2004, 07:18:14
You can guess what this thread is about. How do I make a unit face another unit by rotating on the spot? Doing it through scripting would be my first choice...
Title: Re:"LOOK at someone when you're speaking to them!"
Post by: Kaliyuga on 23 Jul 2004, 07:45:51
 try using

unitname dowatch unit2name

in an trigger/init/script/etc..


:cheers:

Title: Re:"LOOK at someone when you're speaking to them!"
Post by: shadow99 on 23 Jul 2004, 07:56:29
No dice. Not in a camera script anyway. I'll try init...
Title: Re:"LOOK at someone when you're speaking to them!"
Post by: shadow99 on 23 Jul 2004, 08:00:56
Actually, yes. It does work. Sorry...
Title: Re:"LOOK at someone when you're speaking to them!"
Post by: shadow99 on 23 Jul 2004, 08:10:46
Well it kind of does and kind of doesn't. It seems to work for three of the characters, but one of them stares at their left and to the ground.
Title: Re:"LOOK at someone when you're speaking to them!"
Post by: shadow99 on 23 Jul 2004, 08:11:28
Maybe I could make a stationary unit for them to look at...
Title: Re:"LOOK at someone when you're speaking to them!"
Post by: ollestolpe on 23 Jul 2004, 10:11:50
Maybe the other guys have treated him bad..
And he is too ashamed to look at them.

Perhaps a scipt isn't always the best thing to solve the situation.
I suggest you talk to the Unit to make sure he know that you appreciate him.
Title: Re:"LOOK at someone when you're speaking to them!"
Post by: Artak on 23 Jul 2004, 10:12:24
Unless you've typed the unit's name wrong or something, it should work for all units just the way Kaliyuga said above.
You can also try dotarget with the same method in addition to the dowatch.

Another exciting fact is that you can actually edit your own posts here in the forums. Just press (http://www.ofpec.com/yabbse/YaBBImages/modify.gif) which can be found in the top right corner of your every post when viewing the topic.  :)
Title: Re:"LOOK at someone when you're speaking to them!"
Post by: macguba on 23 Jul 2004, 11:59:38
The problem with doWatch is that the command is satisfied as long as the target object is within the field of view of the loon who is watching.     Since a loon's field of view is quite wide, this means that he can apppear to be looking in an entirely different direction and still obey the command.

The solution - although you can't let the player see this happening - is to use a setDir command.

In general lines of code work equally well in scripts, triggers, waypoints and init fields.    (There are rare exeptions for init fields.)     Usually when a line of code "doesn't work" the problem is one of syntax.   Always check it with the command reference.