-
May 21st, 2016, 20:48 #1
Core+5E - Altering NPC names in the combat tracker
Hi,
I'm looking into altering the NPC names in the combat tracker, as pr. this post: https://www.fantasygrounds.com/forum...combat-tracker
As far as I can tell, the added number to the NPCs name (e.g. Thug 87) is done in the addNPCHelper in the core combat_manager.lua script.
The 5e ruleset then uses the setCustomAddNPC function to add 5e specific stuff to the NPC node, doing this after calling addNPCHelper directly.
If I want to change the name of the NPCs after this, I'm unsure of how to go about it.
I can't really use the setCustomAddNPC, since that would replace the 5e function, correct? And I don't really want to override the 5e function, since that would tie the extension to the 5e ruleset and require an update each time the function changes.
Any suggestion on how to go about this?
Regards,
Tideturner
-
May 22nd, 2016, 03:49 #2
No matter what you do and how you do it your changes can be affected by changes to Core/5e.
I havent looked at the code but if the code is partly set in Core and further modified in 5e then you ay end up with a 5e only extension.
The way to make an extension that has the least ongoing maintenance required is to only modify those functions from those files that actually directly relate to your task.
Create a new folder in your /extensions directory called /extensions/npcnames and create an extension.xml file
this file will link to / include all your additional files for this extension.
If you create a new function/template/etc with the same name as an existing one - then this one will be used (depending on exactly how it is called).
Then you would just need to check what files were updated in CoreRPG/5e when a new release comes out.
-
May 22nd, 2016, 10:27 #3
Right, thanks, that got me started.
If I just copy the entire CoreRPG/scripts/manager_combat.lua and add the following at the bottom:
Code:function getCustomAddNPC() return fCustomAddNPC; end
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks