skittles sour Posted June 4, 2021 Share Posted June 4, 2021 Hi so I discovered that, by the time the game loads the modmain, GLOBAL.PrefabExists to any prefab returns false, as they have not been loaded yet. I have been using GLOBAL.AllReciples[prefab] to check but it only covers craftables. What is the there better way to confirm the existence of certain prefabs? Link to comment Share on other sites More sharing options...
Hornete Posted June 4, 2021 Share Posted June 4, 2021 (edited) 2 minutes ago, Bad Willow said: Hi so I discovered that, by the time the game loads the modmain, GLOBAL.PrefabExists to any prefab returns false, as they have not been loaded yet. I have been using GLOBAL.AllReciples[prefab] to check but it only covers craftables. What is the there better way to confirm the existence of certain prefabs? You can do a AddSimPostInit, when the game runs this postinit all prefabs in the game should have been loaded in by now. AddSimPostInit(function() --All prefabs are loaded in now end) Edited June 4, 2021 by Hornete Link to comment Share on other sites More sharing options...
skittles sour Posted June 4, 2021 Author Share Posted June 4, 2021 (edited) ah kk gotcha. it's just that I'd have to tab the entire code right one tab and it seems somewhat unfortunate. Edited June 4, 2021 by Bad Willow 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