Jump to content

A19 NPCs DMT Mod


xyth

Recommended Posts

Sphereii, sometimes I get some red message in console, but it's always pushed away very fast by the stats messages. Is there any way I can temporarily turn off the stats messages so that when this red message shows up again, I will be able to read it and find it in the log?

 

Alternatively, here's the last log full of these stats, but also the error messages:

output_log

 

I can review the log tonight; media fire is blocked at my work.

Link to comment
Share on other sites

I can review the log tonight; media fire is blocked at my work.

 

Sorry for that, but the log was really huge, pastebin.com wouldn't accept it, so I had to compress it.

 

Oh, one more thing. For some reason, my companion just disappeared like maybe after 3-4 days or so and we weren't even at trader's base. First I thought that he got stuck somewhere and stopped following me, but then I realized that we have the teleport now so this shouldn't be an issue, so I checked the map and he was really gone. Could it be that the game eventually despawns some entities? Assuming that this is the case, maybe you could put something there to protect at least hired NPCs from being auto-despawned by the game itself?

Edited by mr.devolver (see edit history)
Link to comment
Share on other sites

Sorry for that, but the log was really huge, pastebin.com wouldn't accept it, so I had to compress it.

 

Oh, one more thing. For some reason, my companion just disappeared like maybe after 3-4 days or so and we weren't even at trader's base. First I thought that he got stuck somewhere and stopped following me, but then I realized that we have the teleport now so this shouldn't be an issue, so I checked the map and he was really gone. Could it be that the game eventually despawns some entities? Assuming that this is the case, maybe you could put something there to protect at least hired NPCs from being auto-despawned by the game itself?

 

No worries about the log file. I appreciate providing them.

 

The NPCs do change their spawner so they shouldn't despawn. I will look at putting in some kind of notification for when they despawn, then maybe we can figure out why. Something that won't get lost in log files.

Link to comment
Share on other sites

Update pushed for the trader issue. Should work with existing NPCs.

 

Testing of the refactored maslow is going well. Simplies code, and allows usage of med kits, etc

 

Thanks. Anything new regarding the errors in the log I posted the other day?

Link to comment
Share on other sites

I just tested this last update with the existing world and NPCGhost from Dark. NPCGhost did not disappear, but the trader himself did lol

 

I spawned a new trader and that one disappeared as well.

 

It seems like when my follower gets too close to the trader, the trader disappears. I left the NPC outside of the trader's base and spawned a new trader behind the counter and that trader now stays there.

Edited by mr.devolver (see edit history)
Link to comment
Share on other sites

I just tested this last update with the existing world and NPCGhost from Dark. NPCGhost did not disappear, but the trader himself did lol

 

I spawned a new trader and that one disappeared as well.

 

It seems like when my follower gets too close to the trader, the trader disappears. I left the NPC outside of the trader's base and spawned a new trader behind the counter and that trader now stays there.

 

That's odd. I tested it with the npcs individually and with all of them following me into the trader's and didn't have any issues like that. All my npcs were fresh spawns though so that might have something to do with it.

Link to comment
Share on other sites

I just tested this last update with the existing world and NPCGhost from Dark. NPCGhost did not disappear, but the trader himself did lol

 

I spawned a new trader and that one disappeared as well.

 

It seems like when my follower gets too close to the trader, the trader disappears. I left the NPC outside of the trader's base and spawned a new trader behind the counter and that trader now stays there.

 

I was worried about that. The traders compare their entityid to that of all npc's in a radius. If your NPC's entity id is lower than the trader's, the trader will despawn. Any trader that spawns in after your npcs will likely disappear.

 

I can implement the same style of fix for the traders, as I did to prevent the npcs from despawning, but then we may get duplicate traders. I'll think about it and see what kind of solution I can come up with.

Link to comment
Share on other sites

I was worried about that. The traders compare their entityid to that of all npc's in a radius. If your NPC's entity id is lower than the trader's, the trader will despawn. Any trader that spawns in after your npcs will likely disappear.

 

I can implement the same style of fix for the traders, as I did to prevent the npcs from despawning, but then we may get duplicate traders. I'll think about it and see what kind of solution I can come up with.

 

I have another interesting experience: My trader that I spawned as a replacement for the one that disappeared was trader Bob, not sure which one was the original one because he was already gone when I entered his room, so I just picked one randomly. When I asked Bob for a fetch job and came back with the supplies, Bob himself was gone and instead of Bob, trader Jen stood there in front of me! What's even weirder, I was actually able to finish the job by talking to trader Jen!

 

As for the despawn issue, I think it's pretty weird that a static trader actually spawns after your NPCs. I would think that they all just spawn in their base before anything else.

Edited by mr.devolver (see edit history)
Link to comment
Share on other sites

I have another interesting experience: My trader that I spawned as a replacement for the one that disappeared was trader Bob, not sure which one was the original one because he was already gone when I entered his room, so I just picked one randomly. When I asked Bob for a fetch job and came back with the supplies, Bob himself was gone and instead of Bob, trader Jen stood there in front of me! What's even weirder, I was actually able to finish the job by talking to trader Jen!

 

As for the despawn issue, I think it's pretty weird that a static trader actually spawns after your NPCs. I would think that they all just spawn in their base before anything else.

 

They are actually spawned through a block. The code just assumes they should be the only NPC within 10 blocks of it. Trader Jen was probably the original trader.

Link to comment
Share on other sites

They are actually spawned through a block. The code just assumes they should be the only NPC within 10 blocks of it. Trader Jen was probably the original trader.

 

Just an idea, but if it's 10 blocks around the trader NPC, maybe your NPC could temporarily stop following you right before crossing that line so that they would not move any closer to the trader. I guess in most cases that would be still close enough for player to reach them when needed and once the players are done buying / selling stuff, they could leave and their NPC would start following them again.

Link to comment
Share on other sites

Just an idea, but if it's 10 blocks around the trader NPC, maybe your NPC could temporarily stop following you right before crossing that line so that they would not move any closer to the trader. I guess in most cases that would be still close enough for player to reach them when needed and once the players are done buying / selling stuff, they could leave and their NPC would start following them again.

 

That's one solution. Have the NPC scan around 11+ blocks and see if there's a trader nearby, and just stop moving. I'm still getting used to moving the entities around, and figuring out what they see as barriers and not.

Link to comment
Share on other sites

That's one solution. Have the NPC scan around 11+ blocks and see if there's a trader nearby, and just stop moving. I'm still getting used to moving the entities around, and figuring out what they see as barriers and not.

 

Well, when I saw that screenshot you posted there with baker NPC next to a trader, I was very excited, so to be absolutely honest, I would love if we could safely do that any time.

Link to comment
Share on other sites

Well, when I saw that screenshot you posted there with baker NPC next to a trader, I was very excited, so to be absolutely honest, I would love if we could safely do that any time.

 

Technically, our NPCs are EntityAliveSDX, which are EntityNPCs with more stuff. We could just change all the traders to be EntityAliveSDX, and they should retain all their functionality. But I don't feel that's the right solution, but could be a temporary one.

Link to comment
Share on other sites

Technically, our NPCs are EntityAliveSDX, which are EntityNPCs with more stuff. We could just change all the traders to be EntityAliveSDX, and they should retain all their functionality. But I don't feel that's the right solution, but could be a temporary one.

 

I know that you probably want as few changes to vanilla as possible for better compatibility with other mods, but on the other hand, if the game code that governs traders is not flexible enough to work well with custom NPCs (which kinda defeats all madmole's claims that adding NPC followers should be easy enough for modders), then changing the game code is probably the only possible solution if you want your mod to look and feel natural and perhaps if you create a robust mod that actually works well in all kinds of different scenarios, other mods might benefit more from using this mod as dependency instead of the vanilla code in which case incompatibility wouldn't be an issue.

Link to comment
Share on other sites

I know that you probably want as few changes to vanilla as possible for better compatibility with other mods, but on the other hand, if the game code that governs traders is not flexible enough to work well with custom NPCs (which kinda defeats all madmole's claims that adding NPC followers should be easy enough for modders), then changing the game code is probably the only possible solution if you want your mod to look and feel natural and perhaps if you create a robust mod that actually works well in all kinds of different scenarios, other mods might benefit more from using this mod as dependency instead of the vanilla code in which case incompatibility wouldn't be an issue.

 

Adding followers can be done with vanilla.. they just kind of stand on top of your head. They have effectively set you as their attack target, but aren't allowed to hit you, because you are not configured as a target.

 

To change the traders, it'd just be an xpath swap, and they should work. It may make them vulnerable to attacks, which can be seen as positive for some.

Link to comment
Share on other sites

Adding followers can be done with vanilla.. they just kind of stand on top of your head. They have effectively set you as their attack target, but aren't allowed to hit you, because you are not configured as a target.

 

To change the traders, it'd just be an xpath swap, and they should work. It may make them vulnerable to attacks, which can be seen as positive for some.

 

And that's exactly what I meant, there are many issues you have to deal with, so adding them is not as easy as he portrayed it.

 

As for the change of traders, it might be seen as positive change for some players if they could kill the traders, but I think not all of us would like it that way. I think the way traders work in vanilla should stay as is, because most players expect the traders to be invincible so that their quest won't break just because someone killed their quest giver.

 

If someone wants vulnerable traders for any reason, you could make it an option for server admins to make the traders vulnerable, so it could be set up to work in both scenarios.

Link to comment
Share on other sites

And that's exactly what I meant, there are many issues you have to deal with, so adding them is not as easy as he portrayed it.

 

As for the change of traders, it might be seen as positive change for some players if they could kill the traders, but I think not all of us would like it that way. I think the way traders work in vanilla should stay as is, because most players expect the traders to be invincible so that their quest won't break just because someone killed their quest giver.

 

If someone wants vulnerable traders for any reason, you could make it an option for server admins to make the traders vulnerable, so it could be set up to work in both scenarios.

 

I may have come up with a potential work around. Similar to how I protect the NPCs from despawning, but with slightly different code to handle NPC's duplicate spawn issue.

Link to comment
Share on other sites

I've run across a minor issue with all the NPCs. They work perfectly fine for me but not for my friend when she joins me. She can hire them but they won't follow her at all or follow any orders she gives them. We usually play a game hosted on my computer rather than a dedicated server.

Link to comment
Share on other sites

I've run across a minor issue with all the NPCs. They work perfectly fine for me but not for my friend when she joins me. She can hire them but they won't follow her at all or follow any orders she gives them. We usually play a game hosted on my computer rather than a dedicated server.

 

Interesting problem. Unfortunately I can't confirm this time, because I had no chance to play coop with this mod yet, but I'd like to play coop with it eventually when all the issues are resolved.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...