1
Help section / modding help required! how to stop mob aggro? sccspathfind inquiry
« on: May 28, 2023, 10:17:58 am »
Hi,
I am wondering how to stop the aggro from the mobs. I am retrieving nodes from sccspathfind.cs and trying to move the green snake mob from nodes to nodes, but somehow, at a close distance higher than 1.4, the green snake mob hisses and goes agressive... How can i stop the agressivity from using this
Do i need to use ServerCharacterAiHelper.Proce ssRetreatingAI to stop/stabilize the mob?
I will try using that function and see if i can stabilize/stop the mob from being aggressive.
Also i tried this already but it's as if there is an internal aggro happening. i am unsure because it didn't fix the problem, as if the moment i use ProcessAggressiveAI, i have to use another function to stop the aggressivity. I will retest:
Thank you so much for the help
nine
I am wondering how to stop the aggro from the mobs. I am retrieving nodes from sccspathfind.cs and trying to move the green snake mob from nodes to nodes, but somehow, at a close distance higher than 1.4, the green snake mob hisses and goes agressive... How can i stop the agressivity from using this
Code: [Select]
var character = data.GameObject;
var currentStats = data.PublicState.CurrentStats;
ServerCharacterAiHelper.ProcessAggressiveAi(
character,
targetCharacter: ServerCharacterAiHelper.GetClosestTargetPlayer(character),
isRetreating: currentStats.HealthCurrent < currentStats.HealthMax / 3,
isRetreatingForHeavyVehicles: this.AiIsRunAwayFromHeavyVehicles,
distanceRetreat: 7,
distanceEnemyTooClose: 1,
distanceEnemyTooFar: 3.5,
movementDirection: out var movementDirection,
rotationAngleRad: out var rotationAngleRad);
this.ServerSetMobInput(character, movementDirection, rotationAngleRad);
Do i need to use ServerCharacterAiHelper.Proce ssRetreatingAI to stop/stabilize the mob?
Code: [Select]
ServerCharacterAiHelper.ProcessRetreatingAi(character, distnpctoplayersqrt, out var movementDirection, out var rotationAngleRad);
I will try using that function and see if i can stabilize/stop the mob from being aggressive.
Also i tried this already but it's as if there is an internal aggro happening. i am unsure because it didn't fix the problem, as if the moment i use ProcessAggressiveAI, i have to use another function to stop the aggressivity. I will retest:
Code: [Select]
var character = data.GameObject;
var currentStats = data.PublicState.CurrentStats;
ServerCharacterAiHelper.ProcessAggressiveAi(
character,
targetCharacter: ServerCharacterAiHelper.GetClosestTargetPlayer(character),
isRetreating: currentStats.HealthCurrent < currentStats.HealthMax / 3,
isRetreatingForHeavyVehicles: this.AiIsRunAwayFromHeavyVehicles,
distanceRetreat: 7,
distanceEnemyTooClose: 1,
distanceEnemyTooFar: 1.4,
movementDirection: out var movementDirection,
rotationAngleRad: out var rotationAngleRad);
this.ServerSetMobInput(character, movementDirection, rotationAngleRad);
Thank you so much for the help
nine