Thread: Overriding CoreRPG functions
-
June 1st, 2018, 17:01 #11
Overriding functions is only possible with Global script packages because they are ran during initialization of the ruleset code. You can't override individual functions in a control script. You need to overwrite the whole control script LUA file or <script> element.
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!
-
June 1st, 2018, 19:04 #12
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
-
June 1st, 2018, 19:53 #13
If you want to add the new coin type something like this should work.
Code:table.insert(GameSystem.currencies,"CR");
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset FGU Reference Module, or Web.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
June 1st, 2022, 06:54 #14
How would this work for scripts that don't have a "script name" like charwizard.lua?
charwizard.lua is only 'included' in the base.xml for the 5E ruleset and doesn't have a '<script name="...' so I cannot override the function by doing ScriptName.function = newfunction
Specifically, I'm trying to override calcSummaryStats() in charwizard.lua.Last edited by GEONE; June 1st, 2022 at 07:30.
-
June 1st, 2022, 13:53 #15
The character wizard is very complex and is always being updated.
SW recommend that you dont overwrite anything in that area.
-
June 10th, 2022, 14:04 #16
- Join Date
- Apr 2010
- Location
- Australia
- Posts
- 901
Is there a way to override a single global variable/constant in a CoreRPG script file?
Eg.
In the scripts/manager_language.lua, I want to change the following global constant:
CHAR_LANGUAGE_LIST = "languagelist";
to
CHAR_LANGUAGE_LIST = "traits.languagelist";
Presently I do this by copying the manager_language.lua file from CoreRPG into my ruleset, I make the above change, and then overwrite the <script name="LanguageManager" file="scripts/manager_language.lua" /> in my base.xml file.
Is there a better way to do this with respect to layering?Timezone: Australian EST (GMT +10).
Systems/Rulesets: GURPS 4th Edition.
Campaigns (Ultimate License Holder)
GURPS Traveller - The Empty Peace
GURPS Shadowrun - Power Plays
GURPS Banestorm - Dark Clouds Rising
-
June 10th, 2022, 14:17 #17
I think you can just put LanguageManager.CHAR_LANGUAGE_LIST = "traits.languagelist"; inside an onInit() anywhere. Or more preferably create a new LanguageManager script file (something like NewLanguageManager) with only an onInit() that does the same thing and also stores the old CHAR_LANGUAGE_LIST in its own variable called something like OLD_CHAR_LANGUAGE_LIST.
Then make sure to include it in the base xml <script name="NewLanguageManager" file="scripts/new_manager_language.lua" />
-
June 10th, 2022, 16:01 #18
- Join Date
- Apr 2010
- Location
- Australia
- Posts
- 901
Timezone: Australian EST (GMT +10).
Systems/Rulesets: GURPS 4th Edition.
Campaigns (Ultimate License Holder)
GURPS Traveller - The Empty Peace
GURPS Shadowrun - Power Plays
GURPS Banestorm - Dark Clouds Rising
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks