All Homes Locations owned by the same NPC?
- The Holy Knight
- Posts: 47
- Joined: Wed Jun 26, 2019 11:51 pm
All Homes Locations owned by the same NPC?
I started to travel to some of the home locations on the map and I noticed all of them have the same NPC "Alabywyr Hawkford" in every location I visited. I don't know if anyone else is experiencing this
- BadLuckBurt
- Posts: 948
- Joined: Sun Nov 05, 2017 8:30 pm
Re: All Homes Locations owned by the same NPC?
Do you happen to have a list of locations you traveled to? I think I know what's going on but would like to check it in classic DF to be sure
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
- The Holy Knight
- Posts: 47
- Joined: Wed Jun 26, 2019 11:51 pm
Re: All Homes Locations owned by the same NPC?
In the Daggerfall Region I went to "The Old Buckingcroft Place" and "The Ashsmith Cabin" and a couple other homes to confirm but it seems its only be happening in the same Interior Model.
- The Holy Knight
- Posts: 47
- Joined: Wed Jun 26, 2019 11:51 pm
Re: All Homes Locations owned by the same NPC?
I already checked in classic DF and the names were different
- BadLuckBurt
- Posts: 948
- Joined: Sun Nov 05, 2017 8:30 pm
Re: All Homes Locations owned by the same NPC?
Thanks, I appreciate it. I've seen the same thing happen while testing World Data stuff and making copies of locations. I wasn't sure if classic had the same behaviour or not. What version of DFU are you using?The Holy Knight wrote: ↑Sun Nov 24, 2019 7:50 pm I already checked in classic DF and the names were different
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
- The Holy Knight
- Posts: 47
- Joined: Wed Jun 26, 2019 11:51 pm
Re: All Homes Locations owned by the same NPC?
I'm using the recent Build 0.10.11
- BadLuckBurt
- Posts: 948
- Joined: Sun Nov 05, 2017 8:30 pm
Re: All Homes Locations owned by the same NPC?
Thanks. I'm still using an older version but I'll have a look at the code that generates the NPC names. It's supposed to take the location's id into account but apparently that's not happening.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: All Homes Locations owned by the same NPC?
Are all these places a single block or multiple?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods
- BadLuckBurt
- Posts: 948
- Joined: Sun Nov 05, 2017 8:30 pm
Re: All Homes Locations owned by the same NPC?
They're all the same interior like we discussed before. Which in itself is fine but the NPCs (and maybe inventories) should be unique.
I dug a bit in the code and at some point in DaggerfallInterior, the static npcs are created at which point they receive their name.
Changing this:
Code: Select all
// Add StaticNPC behaviour
StaticNPC npc = go.AddComponent<StaticNPC>();
npc.SetLayoutData(obj, entryDoor.buildingKey);
Code: Select all
// Add StaticNPC behaviour
StaticNPC npc = go.AddComponent<StaticNPC>();
DFLocation location = GameManager.Instance.PlayerGPS.CurrentLocation;
int key = entryDoor.buildingKey + location.LocationIndex;
npc.SetLayoutData(obj, key);
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: All Homes Locations owned by the same NPC?
Prior to March 2018, this used flat position as well for uniqueness like below.
There must have been an issue with this approach, as it was changed as part of #645 in following commit.
https://github.com/Interkarma/daggerfal ... 76060433ef
When no longer mixing in flat position, it means that every building with the same ID will have the same NPC names.
BadLuckBurt's solution above should be fine if Hazelnut is happy with it. I can't recall why this was changed back in 2018. It's mainly important the seed is deterministic and unique per building in each location. I'd definitely want Hazelnut's take on this first.
Code: Select all
npcData.nameSeed = (int) obj.Position ^ buildingKey;
https://github.com/Interkarma/daggerfal ... 76060433ef
When no longer mixing in flat position, it means that every building with the same ID will have the same NPC names.
BadLuckBurt's solution above should be fine if Hazelnut is happy with it. I can't recall why this was changed back in 2018. It's mainly important the seed is deterministic and unique per building in each location. I'd definitely want Hazelnut's take on this first.