Thread: Avoiding extension collisions...
-
March 16th, 2015, 19:52 #1
Avoiding extension collisions...
So I'm working on my first mod and I pretty well have it functioning like I want it to. However, because it overrides what I believe are some pretty major pieces of the ruleset, I'm worried about it being incompatible with other extensions. I'm pretty new to FantasyGrounds so I'm not sure how this should best be handled.
For instance, my mod modifies the scripts/data_common.lua. I imagine that this is a fairly common piece of lua to overwrite so my concern is how I keep my modification from conflicting with others.
Is there are a clean way to do this? A way were I insert only the change code in my new data_common.lua instead of completely replacing it?
(for what it's worth, I've added a 7th attribute to 3.5E and updated all the character sheets and scripts to go with it)
-
March 16th, 2015, 20:58 #2
See this post for some examples of how to add to the LUA tables in data_common.lua without changing the base file: https://www.fantasygrounds.com/forum...l=1#post168814
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!
-
March 16th, 2015, 21:27 #3
I saw that thread, and it was helpful but you appeared to be adding completely new functionality. I'm talking about modifying the way existing functions work, such as, from data_common.lua:
Code:-- Abilities (database names) abilities = { "strength", "dexterity", "constitution", "intelligence", "wisdom", -- Mod by QC for Comeliness Attribute Support -- added , "charisma", -- added entire line "comeliness" -- End QC Mod };
Sorry if I'm being dense. I'm new to LUA/XML and FantasyGrounds.
Though I do have a my extension fully functional atm so I'm pretty happy about that!
https://game.tall-tales-racing.com/ADnD/sample.jpg
-
March 16th, 2015, 23:12 #4
Hmm, looks like something ate my reply. In short, I looked at that once before... That seemed to be for a new function. I'm adjusting existing functions like:
Code:-- Abilities (database names) abilities = { "strength", "dexterity", "constitution", "intelligence", "wisdom", -- Mod by QC for Comeliness Attribute Support "charisma", "comeliness" -- End QC Mod };
OR
*edit* I could just be dumb. I'm going to try it now that I've re-re-re-re-read it.Last edited by Quiverclaw; March 16th, 2015 at 23:16.
-
March 16th, 2015, 23:31 #5
That worked great for data_common.lua thanks!
Any equivalent for replacing entire functions from the manager_actor2.lua and manager_ps2.lua?
-
March 17th, 2015, 01:07 #6
Cool. No worries.
As long as the script is a global script package they you can override it - i.e. it is defined in the ruleset base.xml using a <script> parameter, so it is "global" to the whole ruleset.
Both of these scripts are defined in the ruleset base.xml:
Code:... <script name="PartyManager2" file="ps/scripts/manager_ps2.lua" /> ... <script name="ActorManager2" file="scripts/manager_actor2.lua" /> ...
If you're using the 3.5e ruleset, you could override the getPercentWounded function in manager_actor2.lua with:
Code:Function onInit() ActorManager2.getPercentWounded = myGetPercentWounded; end function myGetPercentWounded(sNodeType, node) ... My custom code to replace this function. ... end
You can only do this in global script packages, you can't do this for LUA attached directly to a control.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!
-
March 17th, 2015, 01:58 #7
Sweetness. I think that will work for me!
I think this actually just got easier!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks