FurryEskimo Posted November 9, 2022 Share Posted November 9, 2022 Is anyone aware of a method by with an array can be generated that lists all prefabs that have a specific tag? I'd like to be able to reference all hounds, default or modded, which allows me to edit them or summon them etc. I have a suspicion that there is no known way to do this, not unless I summon everything and check their stats every time the game is loaded.. Regardless, I figured I'd ask. Link to comment Share on other sites More sharing options...
Rickzzs Posted November 10, 2022 Share Posted November 10, 2022 runtime: create a hook function AddTagPostInit within EntityScript, or create a function that runs in AddPrefabPostInitAny to gather instances, or hook CreateEntity&RemoveEntity to do things similar to the game. static or runtime: run a string match function for every registered prefab file in scripts/prefabs/ and search for 'AddTag'. But this can be wrong if the syntax is complicated. only once: search in Ents. 1 Link to comment Share on other sites More sharing options...
FurryEskimo Posted November 11, 2022 Author Share Posted November 11, 2022 @Rickzzs Thanks. I spoke with IronHunter about this and they believe it would work, though it sounds like it might require more processing power/code than I was expecting. I was thinking of updating Wirra’s plushies so they could summon modded hounds added by other mods but it sounds like these options might be a bit too taxing. If you disagree feel free to say so. Link to comment Share on other sites More sharing options...
TemporarySolutn Posted November 11, 2022 Share Posted November 11, 2022 i would just check if mods are enabled and then adding a little list of the hounds from those mods, since i dont think there are alot of mods that do that anyways so you'd end up having like uncompromising mode and maybe like 2 other mods Link to comment Share on other sites More sharing options...
Rickzzs Posted November 12, 2022 Share Posted November 12, 2022 11 hours ago, FurryEskimo said: @Rickzzs Thanks. I spoke with IronHunter about this and they believe it would work, though it sounds like it might require more processing power/code than I was expecting. I was thinking of updating Wirra’s plushies so they could summon modded hounds added by other mods but it sounds like these options might be a bit too taxing. If you disagree feel free to say so. If your target is a selected range of mods you can just run a preprocessor with that mod's file or run in game. And you keep updated with these mods. In this case you can manually search in workshop to find all mods that introduces modded hounds and add them. I think there are few. Link to comment Share on other sites More sharing options...
FurryEskimo Posted November 12, 2022 Author Share Posted November 12, 2022 @Rickzzs While that would work I’d prefer not to have to update the mod forever. It’s a good idea, though how do I check if another mod is enabled? Also, can I check if those prefabs exist before I try accessing them? People may rename the prefabs. In general I’d prefer to not be expected to update the mod forever, which is why I was hoping there was an easy way to search all prefabs for tags. Right now I need to maintain the list of available favorite foods and even that’s something I wish could update itself via an array that just references all food items. Link to comment Share on other sites More sharing options...
CarlZalph Posted November 12, 2022 Share Posted November 12, 2022 (edited) @FurryEskimo A slightly less performant method is to do a AddPrefabPostInitAny and check for the "hound" tag. Similar to the AddPlayerPostInit example in modutil. Will rely on mods to have the proper tag for their prefabs, but that's on them to follow proper tagging systems. Though this method would rely on having one out first before being able to store the reference. Might be an interesting quirk to the character's summon limits. For the favorite foods you can player post init, and check for foodaffinity component and see which prefabs have an affinity. It could be assumed that the highest amount is the player's favourite, but mods will probably break this assumption. The foodaffinity component's prefab_affinities is the table of prefabs to bonuses that you can iterate over. Edited November 12, 2022 by CarlZalph 1 Link to comment Share on other sites More sharing options...
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