Welcome, Guest Thursday 24th April 2014, 12:54:50
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: How to disable a Unit's target ability?  (Read 228 times)
0 Members and 1 Guest are viewing this topic.
ahmed117
*
Offline Offline


The 3d!t0R -=I.S.I=-


« on: 01 Feb 2012, 09:43:35 »

Hello Men,
             I have a very weird problem in making a cutscene, the problem is I wanna make my unit to sit on a chair straight, but it watches a man or something, although I have the azimut according to the chair, but still it is not sitting straight on that chair, check out the pic. I want to disable the unit's targeting ability, so that it can sit straight, please tell me if there is any command or any solution, for this...

I would be very thankful for any possible help.

Ahmed117 (A.rogers)


* ColdWarAssault 2012-02-01 00-31-07-31.JPG (83.3 KB, 1024x768 - viewed 38 times.)
Logged

The 3d!t0R            -=O.F.P.E.C=-                                                         -=I.S.I=-
Doktor Headshot
*
Offline Offline



WWW
« Reply #1 on: 01 Feb 2012, 09:58:49 »

Hi pal, it is very simple thing to do but, this time, I would like to invite you to have a peek at COMREF for "disableAI" and "stop" commands Wink
Logged

? (_this == thinkable) : _this == scriptable
Gruntage
Moderator
*****
Offline Offline


How do I get outta this chickensh*t outfit?


« Reply #2 on: 01 Feb 2012, 10:04:30 »

Although what Doktor said is true (the COMREF and the search feature are your best friends  Cheesy) I will tell you that the way to disable a unit's targeting ability is through the use of:

Code:
unitname disableAI "autotarget"

You could also do this:

Code:
unitname disableAI "Move"

Both of these commands should work fine  Smiley

Next time though Ahmed, try using the search feature or the COMREF

Hope this helps

Gruntage
Logged

Some of the most memorable missions made involve the player doing very little...

"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba
ahmed117
*
Offline Offline


The 3d!t0R -=I.S.I=-


« Reply #3 on: 01 Feb 2012, 15:29:16 »

Roger That, Thank you very much by the way.
Logged

The 3d!t0R            -=O.F.P.E.C=-                                                         -=I.S.I=-
Raptorsaurus
Editors Depot Staff
*****
Offline Offline



« Reply #4 on: 24 Mar 2012, 23:13:34 »

Ahmed,

Both of the above replies will work, but there is a disadvantage also. Once an AI ability is disabled it cannot be re-enabled without killing and resurrecting the unit (unit setDamage 1; unit setDamage 0). Killing and resurrecting the unit will then prevent that unit from ever being targeted by another AI unless you first set him to captive before killing him
Code:
unit setCaptive true
~ .1
;delay needed to let the game engine have time to acknowledge the unit is captive
unit setDamage 1
unit setDamage 0
unit setCaptive false
Another way to make him not look at other units is to set his behavior to careless and command him to look at the position in front of him
Code:
unit setBehaviour "careless"
unit doWatch [(getPos unit select 0) + (100 * sin (getDir unit), (getPos unit select 1) + (100 * sin (getDir unit), 0]
To undo him from watching this position and make him behave properly toward enemies you would command him to watch nothing and set his behavior to safe or aware.
Code:
unit setBehaviour "safe"
unit doWatch objNull
« Last Edit: 24 Mar 2012, 23:17:02 by Raptorsaurus » Logged
Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: