Jump to content

Recommended Posts

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?

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...