Jump to content
Sign in to follow this  
jaenak

Canceling dowatch

Recommended Posts

If I have a person ordered to "dowatch" a particular object and I wanted to cancel that after a bit, how would I do that? I can change his combat mode and behaviour but he still stares at the object. I can even type in "man1 dowatch nil" and even that doesn't work. Is it even possible to cancel dowatch?

Share this post


Link to post
Share on other sites

Try:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

unit dowatch objNull

RED

Share this post


Link to post
Share on other sites

Or maybe even try:

unit doWatch []

:note - you can either doWatch an object or a position

array - maybe starring at an empty array could free their

unit's head again too.

~S~ CD

Share this post


Link to post
Share on other sites

Sorry about the late reply. I tried both suggestions and neither worked. Any other ideas?

Share this post


Link to post
Share on other sites

How about unit dowatch unit? Getting the unit to watch its self may work.

RED

Share this post


Link to post
Share on other sites

Perhaps if you dont try and call Dowatch directly with a NullObject?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_WatchGuy=Enemy1

Soldier1 DoWatch _WatchGuy

Then when you want to finish:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_WatchGuy=ObjNull

Or for a position you can get him to roughly return to the direction he was last looking?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Dir=GetDir Soldier1

Soldier1 DoWatch (GetPos Enemy1)

Then when you want to finish:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_SinX=Sin(_Dir*50)

_CosY=Cos(_Dir*50)

Soldier1 Dowatch [_SinX,_CosY,5]

You might need to work out the height above sea level for the Z values.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_SinX=Sin(_Dir*50)

_CosY=Cos(_Dir*50)

Soldier1 Dowatch [_SinX,_CosY,5]

Doing this would make the soldier watch this point though, I guess if you looped this it would work. It is a nasty work around though.

RED

Share this post


Link to post
Share on other sites

Things like DoWatch and Scan Horizon seem to be perminent states. Try stopping a unit from scanning the Horizon with anything but the DoWatch command, the same applies for DoWatch called from the menu. I dont think you can?

I think the best you can do is get it to point in the direction it was last looking at, so you would only have to call DoWatch on a X,Y position once. Doing it in a loop would probably be in conflict with OFP's default behaviour.

Or perhaps get him to DoWatch his commander?

Even if you create an object, get the AI to DoWatch it. Then delete it, the AI will still watch the position.

If you then create an object, get the AI to DoTarget it. Then delete it, the AI will still return to the previous DoWatch the position.

P.S For a laugh get him to DoWatch himself smile_o.gif

Share this post


Link to post
Share on other sites
Try:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

unit dowatch objNull

RED

This works fine for me--jaenak I suggest you try it again.

Place a soldier on the map and call him "a"

Place another soldier on the map and call him "b"

place a trigger *activation* radio alpha -- repeatedly

*On activation" a dowatch b

place another trigger *activation* radio bravo -- repeatedly

*On activation" a dowatch objnull

then make the radio calls and watch soldier "a" as he turns to watch soldier "b" and back again.

Note--soldier "a" may not always directly face soldier "b". Soldier "a" will only turn as far as required untill he can get a visual--sometimes this means it looks like he is not actually watching soldier "b", but he actually is.

If you want soldier "a" to accurately watch the exact spot where soldier "b" is then you could use

a dowatch getpos b

This means he will always turn right round and face exactly where you want him to. And once again this command is cancelled with

a dowatch objnull

Hope this helps.

Zay

Share this post


Link to post
Share on other sites

Its been a few weeks since I checked, but make sure the guy do watching ObjNull is not really just watching position [0,0,0].

I dont think thats what OFP's guys do normally, try doing:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Hint Format ["%1",GetPos ObjNull]

You will see what I mean.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×