OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ONoSixIsDown on 29 Sep 2007, 00:41:48
-
is there an easy or effective way to ensure that a unit in a guard tower will remain standing and still actively engage enemies from the tower? In one of the missions I'm working on, I have AI bots standing guard in tower which is great and all. But as soon as they spot an enemy they drop prone with just there gun and legs "clipping" through the walls on the tower. I've searched the forums on how to do this but never found what seemed like an effective means to do this...
any suggestions? I hate to think that people will be getting killed in my missions because of a AI bot "glitching" through a wall or something.
-
You might try the setUnitPos "UP" command, but it will not prevent them to try to advance and move and finally drop down from the the tower. You may also try to mix the setUnitPos with disableAI "MOVE" command.
-
or try this setpos [(GetPos this select 0),(GetPos this select 1),5.1]; this setunitpos "UP" the 5 is him in tower and a stop command could work to in w/p ,, it really " as ive found depends on the island too!!!!!!!
-
Use this setpos [(GetPos this select 0),(GetPos this select 1) + 5.1] to set the unit to the height that you like. Then use this SetUnitPos "up" to prevent him from proning, and though is rare that he might move, you can use this DisableAi "Target" (or "move"), so he will keep his position all the time.
-
I suggest you just put him in the tower and then disable his AI Move capability:
http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=d#105
EG:
soldierOne disableAI "Move"
You can put him in the tower using buildingPos:
http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=b#34
EG:
unit setPos ((object 21222) buildingPos 1)