Dagobah Posted April 21, 2020 Share Posted April 21, 2020 i'm trying to make a npc that is completely motionless, the engine by default makes that When a player attack a NPC, it will follow the player. i would like to know any way i could make a npc that stand still completely Embedded Video Link Archimago 1 Link to comment Share on other sites More sharing options...
1 Beefy Kasplant Posted April 21, 2020 Share Posted April 21, 2020 Put NPC avoids around it. Maybe movement speed 0? Dagobah and Ainz Ooal Gown 2 Link to comment Share on other sites More sharing options...
0 Ainz Ooal Gown Posted April 21, 2020 Share Posted April 21, 2020 Like Kas said place NPC avoids around it. If you want it to always face the same direction, edit the sprite sheet and make all have same frame. If you dont want to get damaged from NPC, put ts dam at "0". Dagobah 1 Link to comment Share on other sites More sharing options...
0 Dagobah Posted April 21, 2020 Author Share Posted April 21, 2020 Thanks so much for your answers! maybe you guys can teach me how to put my NPCs avoids around it? is it an option in the npc editor? Link to comment Share on other sites More sharing options...
0 Beefy Kasplant Posted April 21, 2020 Share Posted April 21, 2020 16 minutes ago, Dagobah said: Thanks so much for your answers! maybe you guys can teach me how to put my NPCs avoids around it? is it an option in the npc editor? In the map editor you can block NPC's from walkin onto tiles! Dagobah and Ainz Ooal Gown 2 Link to comment Share on other sites More sharing options...
0 Dagobah Posted April 21, 2020 Author Share Posted April 21, 2020 oh i see, well i want to make a sandbox mechanic, my way to do it was to use npcs as blocks, that way i could summon and destroy elements anywhere, but to make them stand still i would be obligated to set every tile in the map as npc's avoids i think i have to enter the source to change the call to attack the player if attacked or something like that, any suggestion? Link to comment Share on other sites More sharing options...
0 Dagobah Posted April 21, 2020 Author Share Posted April 21, 2020 ok i finally get it, i justa have to enter the source and edit in this path: Intersect.Server/Entities/Npc comment the call to void TryFindNewTarget and AssignTarget in line 665 and comment the movement in line 754 this way no npc will follow the player even if is attacked by him if (tgt != null) { AssignTarget(tgt); } else { Check if attack on sight or have other npc's to target TryFindNewTarget(timeMs); } if (CanMove(dir) == -1 || CanMove(dir) == -4) { //check if NPC is snared or stunned statuses = Statuses.Values.ToArray(); foreach (var status in statuses) { if (status.Type == StatusTypes.Stun || status.Type == StatusTypes.Snare || status.Type == StatusTypes.Sleep) { return; } } Move((byte) dir, null); } else { mPathFinder.PathFailed(timeMs); } Link to comment Share on other sites More sharing options...
0 Shenmue Posted April 21, 2020 Share Posted April 21, 2020 1 hour ago, Dagobah said: ok i finally get it, i justa have to enter the source and edit in this path: Intersect.Server/Entities/Npc comment the call to void TryFindNewTarget and AssignTarget in line 665 and comment the movement in line 754 this way no npc will follow the player even if is attacked by him if (tgt != null) { AssignTarget(tgt); } else { Check if attack on sight or have other npc's to target TryFindNewTarget(timeMs); } if (CanMove(dir) == -1 || CanMove(dir) == -4) { //check if NPC is snared or stunned statuses = Statuses.Values.ToArray(); foreach (var status in statuses) { if (status.Type == StatusTypes.Stun || status.Type == StatusTypes.Snare || status.Type == StatusTypes.Sleep) { return; } } Move((byte) dir, null); } else { mPathFinder.PathFailed(timeMs); } No npcs will be able to walk after that right? Maybe you should add an option to the editor to do so instead of blocking every NPC. Archimago and Dagobah 2 Link to comment Share on other sites More sharing options...
0 seethingword Posted April 22, 2020 Share Posted April 22, 2020 Embedded Video Link Dagobah and Archimago 2 Link to comment Share on other sites More sharing options...
0 Dagobah Posted April 23, 2020 Author Share Posted April 23, 2020 On 4/21/2020 at 1:20 PM, Shenmue said: No npcs will be able to walk after that right? Maybe you should add an option to the editor to do so instead of blocking every NPC. Yes that would happen and in the final i use an established option i use this condition: if (t.Despawnable && t.Base.Movement != (int)NpcMovement.StandStill) { //calling movement and attack voids } that makes all the NPCs that are established as Stands Still in its movement will be totally immobile even if you attack them, and the NPCs that are established as turn randomly or move randomly will attack and move with normality. Shenmue 1 Link to comment Share on other sites More sharing options...
Question
Dagobah
i'm trying to make a npc that is completely motionless,
the engine by default makes that When a player attack a NPC, it will follow the player. i would like to know any way i could make a npc that stand still completely
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now