order of OnGlobalTopologyCreated
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
I would like a test that shows the order of many OnGlobalTopologyCreated run. Is there a way to predict the order?
Crying is not a proper retort!
-
- Developer
- Posts: 2998
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
I believe the order will be by UNID, but you should *not* rely on that behavior (since it might change).Betelgeuse wrote:I would like a test that shows the order of many OnGlobalTopologyCreated run. Is there a way to predict the order?
For now, assume that the calls are in random order.
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
eep that isn't good
anyway I would have to ask for some time in the future that we have a way of telling what order they get called.

anyway I would have to ask for some time in the future that we have a way of telling what order they get called.
Crying is not a proper retort!
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
well nothing right now but the problem comes in from many people working on a project.
For example we have many people making mini networks and adding them to the network (like the stone soup mod). Well lets just say I am working on the end game mini network. I don't want to add it anywhere so I will only add it to high level systems. If I was called first there is only the origin node and I do not want to connect to that and I can't expect others to connect to my custom made nodes that are not already in the network so now the game doesn't have an ending.
For example we have many people making mini networks and adding them to the network (like the stone soup mod). Well lets just say I am working on the end game mini network. I don't want to add it anywhere so I will only add it to high level systems. If I was called first there is only the origin node and I do not want to connect to that and I can't expect others to connect to my custom made nodes that are not already in the network so now the game doesn't have an ending.
Crying is not a proper retort!
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
Adventure extension topologies don't socket together with other extensions. Each is an individual entire topology. If we were passing around a file to add to the network in pieces we would obviously need to set up some design guidelines to watch out for this type of problem.
Using one event in that case would likely prevent any problems arising from stacking the events. Then the order that the links were made would be readily available.
It also sounds like you are planning to make a lot of rootNodes for random network construction from that example. If the usual network building was happening - as in SS topos, then there would already be a list of the proper nodes to make links to.
Using one event in that case would likely prevent any problems arising from stacking the events. Then the order that the links were made would be readily available.
It also sounds like you are planning to make a lot of rootNodes for random network construction from that example. If the usual network building was happening - as in SS topos, then there would already be a list of the proper nodes to make links to.
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
remember OnGlobalTopologyCreated goes in System and System can go into any extension iirc
edit: I am thinking worst case not the case where you already have a network.
edit: I am thinking worst case not the case where you already have a network.
Crying is not a proper retort!
-
- Developer
- Posts: 2998
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
We should probably split this off into a separate thread.Betelgeuse wrote:well nothing right now but the problem comes in from many people working on a project.
For example we have many people making mini networks and adding them to the network (like the stone soup mod). Well lets just say I am working on the end game mini network. I don't want to add it anywhere so I will only add it to high level systems. If I was called first there is only the origin node and I do not want to connect to that and I can't expect others to connect to my custom made nodes that are not already in the network so now the game doesn't have an ending.
But I'm not sure knowing the order helps you. When you write an extension, you don't know what other extensions exists in the world. Suppose you could ask for the order in which the types get called. Imagine:
(unvGetCallOrder "OnGlobalTopologyCreated")
And that returned a list of UNIDs in the order that they got called:
(0x00001710 0xD5600001 0xE1781010)
How would that knowledge help you?
Probably what you want is a setting on a type that says, "call me first" or "call me last". But then you have to consider that many extensions are going to request the same thing and now you're in the same boat.
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
Yes, well, I thought if I wanted to reuse system elements but avoid getting into trouble with embedded events that could conflict with other topologies that I would remove them and try placing them in a blank system element just in the adventure extension itself... and it works.
Aha! I said- if systems in extensions dont use the event, then there won't be any little surprises and a simple system element can be added to an adventure extension to perform adventure specific events.
Aha! I said- if systems in extensions dont use the event, then there won't be any little surprises and a simple system element can be added to an adventure extension to perform adventure specific events.
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
hmm good point how about a callMeLater function that calls the topology create later after some other topology creates. It would be the modders responsibility to make sure it would eventually go (like I would know that Periculi made some higher level systems so I can link to them)
edit: Periculi you don't know if other modders will use it or not so I don't see that as a workable solution
edit2: split I may have missed a post though
edit: Periculi you don't know if other modders will use it or not so I don't see that as a workable solution
edit2: split I may have missed a post though
Crying is not a proper retort!
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
What are you talking about? You want to put a system in a regular extension that has an event that effects the topology, right? Why would you even want to place it in a generally available system that ALL the mods would use if it is for a specific adventure extension?edit: Periculi you don't know if other modders will use it or not so I don't see that as a workable solution
Systems in regular extensions are used by any topology- so your event would be getting called for a regular vanilla game, and any other adventure extension, whether the system UNID got used or not.
By placing it in the adventure extension only, you get the event only in that topology (where presumably it will make sense)
-
- Developer
- Posts: 2998
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
I'm not sure "callMeLater" is different from "callMeLast". You still have no guarantee that you will be called "late enough". (since any extension can call "callMeLater")Betelgeuse wrote:hmm good point how about a callMeLater function that calls the topology create later after some other topology creates. It would be the modders responsibility to make sure it would eventually go (like I would know that Periculi made some higher level systems so I can link to them)
edit: Periculi you don't know if other modders will use it or not so I don't see that as a workable solution
I really think it depends on what you are trying to accomplish:
1. If you want to modify the base topology, then you should accept any topology state and make sure you leave the topology in a valid state.
2. If you want to dynamically create a topology, you should create an adventure extension.
3. If you want to extend an adventure extension that dynamically generates a topology, then you should coordinate with the adventure extension writer (i.e., the adventure should have plug in points that call out to other extensions).
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
What I want to do has no bearing on what is allowed. You may not like that other modders can do this but you have to allow for it.What are you talking about? You want to put a system in a regular extension that has an event that effects the topology, right? Why would you even want to place it in a generally available system that ALL the mods would use if it is for a specific adventure extension?
As I said the modder will be responsible from making sure it is run. This is not a catch all (infinite loops are still allowed) this is just to allow you to run the event again after some other topology is created.I'm not sure "callMeLater" is different from "callMeLast". You still have no guarantee that you will be called "late enough". (since any extension can call "callMeLater")
I will give an example. Say my event was ran and I saw that there wasn't any high level systems to link to. I would say callMeLater. Then it picks a different event to run and runs that that may or may not create the needed systems. Then it may call my event lets say there are still no systems to link to so I would say callMeLater again. A different event is run and it places the needed systems. Now my event is called a third time but now I have the systems I need so I don't need to call callMeLater.
This doesn't prevent infinite loops but the game allows for infinite loops otherwise so I don't see that as a valid argument against this.
This doesn't mean you need to implement this. This is just a suggestion on a solution to the problem of not knowing what order they run in and would allow mods that can not be made otherwise.
Crying is not a proper retort!
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
hmm if globals are run before topology create then we could get away with having one and still be able to do what I said. 8)
Crying is not a proper retort!