PotatoEngineer Posted June 13, 2014 Share Posted June 13, 2014 I'm attempting to mark each end of a wormhole with a particular color for easy reference later. (I'm too lazy to memorize where every wormhole goes.) I'm having problems finding the matching wormhole, though. First, I tried AddPrefabPostInit to wormholes, to change their minimap icon. Unfortunately, in Prefab-Post-Init functions, the wormhole's far end (inst.components.teleporter.targetTeleporter) is not yet defined. Now I'm trying AddSimPostInit, using TheSim:FindEntities() to get all wormholes. (Yes, FindEntities only works with tags, and wormholes have no tags. No worries, I added a tag to wormholes so I could use FindEntities.) The problem is that inside the Sim-Post-Init function, "TheSim" is not yet defined. So how can I grab a list of all wormholes here? Alternatively, what can I do to make a function fire one second after the game starts? Link to comment https://forums.kleientertainment.com/forums/topic/37407-how-can-i-use-thesimfindentities-inside-a-sim-post-init-function/ Share on other sites More sharing options...
_Q_ Posted June 13, 2014 Share Posted June 13, 2014 I'm attempting to mark each end of a wormhole with a particular color for easy reference later. (I'm too lazy to memorize where every wormhole goes.) I'm having problems finding the matching wormhole, though. First, I tried AddPrefabPostInit to wormholes, to change their minimap icon. Unfortunately, in Prefab-Post-Init functions, the wormhole's far end (inst.components.teleporter.targetTeleporter) is not yet defined. Now I'm trying AddSimPostInit, using TheSim:FindEntities() to get all wormholes. (Yes, FindEntities only works with tags, and wormholes have no tags. No worries, I added a tag to wormholes so I could use FindEntities.) The problem is that inside the Sim-Post-Init function, "TheSim" is not yet defined. So how can I grab a list of all wormholes here? Alternatively, what can I do to make a function fire one second after the game starts?You could add new component to wormholes that will spawn color marks next to each wormhole after you use that wormhole, then you can use prefabpostinit and get the job done. Link to comment https://forums.kleientertainment.com/forums/topic/37407-how-can-i-use-thesimfindentities-inside-a-sim-post-init-function/#findComment-499240 Share on other sites More sharing options...
Heavenfall Posted June 13, 2014 Share Posted June 13, 2014 AddGamePostInit?Or you can just set up a delayed task and attach it to the prefab "world" Link to comment https://forums.kleientertainment.com/forums/topic/37407-how-can-i-use-thesimfindentities-inside-a-sim-post-init-function/#findComment-499317 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