Home   Help Search Login Register  

Author Topic: Dowatch = unreliable  (Read 934 times)

0 Members and 1 Guest are viewing this topic.

Gameer_77

  • Guest
Dowatch = unreliable
« on: 17 Dec 2002, 18:30:59 »
Howdi ;D

I'll keep this short and sweet - Does anyone know how to make a unit face another reliably?

Most likely using setdir, but i'm useless at maths and wouldn't know how to make some kind of 'sum'. And please don't say 'unit setdir (getdir unit2 - 180)' cause that would need the other man to be looking at him. ::)

Thanks :P

Gameer
« Last Edit: 17 Dec 2002, 18:32:45 by Gameer »

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Dowatch = unreliable
« Reply #1 on: 17 Dec 2002, 20:16:53 »
With dowatch or commandwatch. Setdir will do you no good. The person will just turn right back and face wherever he was facing before if you use detdir on him.

If you can't get one unit to watch another unit in a cutscene using those the dowatch/commandwatch command, then I suspect there is something wrong with the area.

Are there any 'enemy' units in the area? Soldiers tend to keep and eye on enemy units, even if they are set to captive.

WHat is it that theya are watching that they are not suppsoed to?
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Gameer_77

  • Guest
Re:Dowatch = unreliable
« Reply #2 on: 18 Dec 2002, 01:06:13 »
I would be using a setdir loop to make him face there and stay facing.

Its in quite a built-up area, so he seems to get distracted quite easily ;)

Two people have got to be facing each other, so i guess i could just make it add one degree and check to see if there 'setdir's are similar (minus the 180 degrees).

Thanks

Gameer

MorMel

  • Guest
Re:Dowatch = unreliable
« Reply #3 on: 18 Dec 2002, 16:15:03 »
I had the same problem as u. I needed to have to units facing each other during a cutscene.... The problem: one of them was the player...

I found the solution having two 'gamelogic' at the map position where i needed both units to face eachother. The gamelogics must have opposite directions, i dare say they must be facing eachother. Then I had a script where the units position and direction are the same as the gamelogics...:

Unit1 setpos LOGIC1
player setpos LOGIC2
UNIT1 setdir LOGIC1
player setdir LOGIC2

-----

Remember that both logics shouldn't be too far or too close from eachother!

To increase the probability of having bothunits facing eachother, have the following:

Unit1 setunitpos "up"
Unit1 setbehaviour "careless

(you don't need to have the player set to these options)
--------------

If you still have doubts, message me and i'll give you a mission with the example...

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Dowatch = unreliable
« Reply #4 on: 18 Dec 2002, 22:16:58 »
try using the disableai command on the units.

I think if you do

unit disableai "autotarget"

the unit will no longer be able to look at objects on their own...they will only watch things that they are commanded to watch.

Here is a rundown of the diableai command.

unit disableAI section
Operand types:
    unit: Object
    section: String
Type of returned value:
    Nothing
Description:
    Disable parts of AI behaviour to get fine control over unit. Section is one of "TARGET" (disable watching assinged target), "AUTOTARGET" (disable independed target assigning and watching unknown targets), "MOVE" (disable movement).

Example:
    soldierOne disableAI "Move"
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Gameer_77

  • Guest
Re:Dowatch = unreliable
« Reply #5 on: 18 Dec 2002, 23:02:20 »
Thanks guys  ;D

But....( ::))I just realised why can't i just setdir them (smoothly...) so that they eventually look at one and another.

Stoopid me :o ;D

Thanks anyways guys, now i can get on with this... :)

Gameer
« Last Edit: 18 Dec 2002, 23:03:59 by Gameer »