-
October 3rd, 2022, 18:00 #31
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
No problems ...
thank you to all for the help and guidance.Thanks In Advance,
D
-
October 3rd, 2022, 18:03 #32
The _100_string._100_string_initialised boolean variable is available globally.
You could do this in your earlier loaded extensions to trigger the _100_string.onInit function when first needed:
Code:if not _100_string._100_string_initialised then _100_string.onInit(); end
Code:function onInit( ) if not _100_string._100_string_initialised then _100_string.onInit(); end Debug.chat("INITIALISING 105") Debug.chat(string.concat('---','one','two','three')) end
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
October 3rd, 2022, 18:05 #33
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
Yes I have come up with something similar as my solution.
I have removed all onInit( ) functions and replaced them with an initialise( ) function.
I then manually call the initialise( ) functions triggered on the extension onInit( ).
This means that overridden code is only executed after all extensions are loaded and hence 105 will find the common library code after 110 has overridden it.
Achieves basically what you describe and works in my end.Thanks In Advance,
D
-
October 3rd, 2022, 18:08 #34Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
October 3rd, 2022, 18:10 #35
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
I find it a little kludgy, however it lets me keep my common code base which as a developer makes me happy.
Thank you once again for all of your help.Thanks In Advance,
D
-
October 3rd, 2022, 18:12 #36Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
October 4th, 2022, 00:59 #37
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,566
This is why I defined a separate StringManager script in CoreRPG to avoid this issue of initialization order.
Regards,
JPG
-
October 4th, 2022, 01:54 #38
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
@Moon Wizard ...
My original question was answered by your description of the overwrite phase of the extension loading overwriting an onInit() which then was not executed in the space of one extension when another "replaced" the code with the exact same code.
Your StringManager script does not have an onInit() and other rulesets that layer on top do not overwrite your StringManager but rather create another one with another name - so it avoids what happened in my extensions.
I specifically wanted to share the same code base with all of my extensions and because I did not 100% understand the overwriting concept during load/execution I was essentially hampering my own work.
Now that you clearly explained everything, I have a better grasp of this subsystem and was able to work around it and successfully achieve what I wanted/needed.
In the end I had to remove all the onInit() code my common code base and manually initialise everything to solve the problem.
Thank you once again for all the help.Thanks In Advance,
D
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks