PDA

View Full Version : Prevent stationary turrets from moving around


WRFan
07-19-2009, 10:45 AM
If you run away from enemies or go into stealth mode, the TSL game AI tells enemies to run around, trying to find you. This is ok, as long as the enemies are supposed to move around. But turrets are stationary objects, they are not supposed to move and it looks absolutely weird when they start moving around. This behaviour is controlled through the include file k_inc_generic.nss, it has to be adjusted to prevent turrets from moving around. We do this by simply including an appearance check, if enemies have the turret appearance, don't move them around:

Example:


int oAppearance = GetAppearanceType(OBJECT_SELF);
if ( oAppearance != 182 && oAppearance != 640 && oAppearance != 183 && oAppearance != 657 )
{
ActionMoveToLocation( newLoc, TRUE );
}


Wrap this around ALL ActionMovement directives in k_inc_generic.nss, everywhere, and then recompile k_ai_master.nss, which uses the generic include

stoffe
07-19-2009, 11:03 AM
If you run away from enemies or go into stealth mode, the TSL game AI tells enemies to run around, trying to find you. This is ok, as long as the enemies are supposed to move around. But turrets are stationary objects, they are not supposed to move and it looks absolutely weird when they start moving around.

Could also set the movement rate of the turret creature to "Immobile" instead of "Default" in their UTC templates. Should prevent them from moving if I remember correctly.