Thread: Maximum NPC hitpoints
-
November 15th, 2011, 01:41 #1
Maximum NPC hitpoints
Currently in FG there's either the option to use average HP (default) or randomize NPC hp when they're dropped into the tracker.
How hard would it be to add an option for maximum hp?
I'm running a 6 player game and they're steamrolling and dry cleaning everything I throw at them, this seems like a a good way to extend fights slightly.
-
November 15th, 2011, 07:26 #2Originally Posted by GeneralChaos
1) need to change the RHPS code in manager_options.lua to add a Max option :
Code:registerOption("RHPS", false, "House Rules (GM)", "CT: Randomize NPC hit points", "option_entry_radio", { labels = "On|Max|Off", values = "on|max|off", optionwidth = 70, default = "off" });
Code:-- HP if sOptRHPS == "on" then local nRandomHP = StringManager.evalDiceString(NodeManager.get(source, "hd", ""), true); win.hp.setValue(nRandomHP); elseif sOptRHPS == "max" Then -- *** Work out the maximum HP here *** else win.hp.setValue(NodeManager.get(source, "hp", 0)); end
-
November 22nd, 2011, 09:55 #3
-
November 23rd, 2011, 00:03 #4Originally Posted by GeneralChaos
-
November 23rd, 2011, 17:56 #5
Did this work for you? It's something I wouldn't mind having an option of. Especially on big bad fights.
-
November 24th, 2011, 03:17 #6
-
November 24th, 2011, 11:31 #7
It sure worked.
I don't know how to make an extension, but I've uploaded the modified files here
-
November 24th, 2011, 18:41 #8
I was going to do the extension for this, But i am missing something.
If someone with more code levels could look at it.
ERROR:Script Error: [string "ct/scripts/ct.lua"]:22: attempt to call global 'getNextWindow' (a nil value)
Madman
-
November 25th, 2011, 03:51 #9Originally Posted by madman
Basically, having the "<script name="ct" file="ct/scripts/ct.lua"/>" in extension.xml loads that script (and so executes it's onInit function) too early - before the Combat Tracker has been constructed and so getNextWindow fails (as there's no window to get).
So, in this case, we need to add into the extension the xml file that constructs the CT and references ct.lua - which is ct\ct_host.xml. Then we need to reference that file in extension.xml so that it will use any scripts in the extension first (in our case the modified ct.lua). And, we need to remove the ct.lua script reference from extension.xml. Hope my explanation makes sense?
Attached is the extension with the change made, so you can see what I mean in practice. And, it works fine with just this change.
Thanks Madman for putting this together...
Attachment 2187
-
February 18th, 2012, 15:47 #10
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks