• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

A19 NPCs DMT Mod

Status
Not open for further replies.
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.

 
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?

 
Last edited by a moderator:
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.

 
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

 
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?

 
Thanks. Anything new regarding the errors in the log I posted the other day?
The error was in maslow AI. That's being refactored, so I hope we can catch the exact cause of the issue, if it even exists in the new code.

 
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.

 
Last edited by a moderator:
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.

 
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.

 
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.

 
Last edited by a moderator:
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.

 
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.

 
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.

 
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.

 
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.

 
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.

 
Status
Not open for further replies.
Back
Top