Thread: 5e Initiative rolling
-
May 25th, 2020, 21:48 #1
5e Initiative rolling
Maybe someone here can help me out....
I've been chasing my tail for hours trying to figure out what function in what script is called to roll NPC initiative when the NPC is 1st dropped onto the combat tracker.
Any help would be appreciated
Cheers, Steve.
-
May 25th, 2020, 22:00 #2
- Join Date
- May 2007
- Posts
- 84
Is it "addNPC" in scripts/manager_combat2.lua?
-
May 25th, 2020, 22:00 #3
I'll take a look. I'll be annoyed if it is 'cos I'm sure I looked there :P
Cheers, Steve.
-
May 25th, 2020, 22:03 #4
Yeah Gamerhawaii, that looks about right, I must've looked at that a hundred times and missed it completely.
Thanks for the push in the right direction
Cheers, Steve.
-
May 25th, 2020, 22:35 #5O.K., next question... why isn;t the following working to override the addNPC function ?
in the onInit function I have this :
oldaddNPC=CombatManager2.addNPC
CombatManager2.addNPC=addNPC
And this as a function
function addNPC(sClass, nodeNPC, sName)
Debug.console("Before old addNPC")
oldaddNPC(sClass,nodeNPC,sName)
end
But the Debug doesn't fire.
This one is really messing with me :P
Cheers, Steve.
-
May 25th, 2020, 23:00 #6
My prorgramming skills are very limited. But you may have to initialize the function. For fun, try adding:
local oldaddNPC = null;
before the onInit function.
I can't tell you why. I don't understand it. But in my extension, I had to do that to get it to work.
No promises it'll help, but it's an easy test.Fantasy Grounds Unity Lives! Good job, Smiteworks!
-
May 25th, 2020, 23:12 #7
Tried that but no difference. Thanks for replying though
I think I'm going to come back to this after some sleep, it's been a long day and odd behaviour seems to be happening
Cheers, Steve.
-
May 25th, 2020, 23:18 #8
Infact, I think the problem is that that is not the funtion that delas with the initiative when an NPC is 1st dropped onto the tracker :O
I hope I'm right, so I can just keep looking ^^
I appreciate everybodies input so far, thank you all.
Cheers, Steve.
-
May 25th, 2020, 23:36 #9
Aaaaannnnddd anf FYI for those that may need to do this themselves, I missed this in the onInit as I'm an idiot.
CombatManager.setCustomAddNPC(addNPC)
Again, thanks for the help guys.
Cheers, Steve.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks