-
May 31st, 2020, 20:15 #1
(5e) Issue with CombatManager.setCustomTurnEnd ?
I have the following code as a test in an extension :
in the onit I have :
CombatManager.setCustomTurnEnd(turnEnd)
followed by :
function turnEnd()
Debug.console("newturnendfunction")
end
All is working fine until it is a turn end AND a round end, then it seems that the turnend function is called twice. Once before and once after the round end function.
Am I being stupid, or is this happening for others also?
Cheers, Steve.
-
June 1st, 2020, 03:15 #2
- Join Date
- Apr 2020
- Posts
- 36
I just ran your code and I can confirm. It is firing every time a character in the CT turn's is over AS WELL as when the round is over. If I have two characters in the CT and an NPC, it fires after each one and again when the round is over. So if I just click the Next Round button instead of the Next Actor button, it fires FOUR times (one for each actor in the CT and once for when the round is over).
I tried also using CombatManager.setCustomTurnStart(), but that fires the same amount of times. I'm not sure what you are looking to do, but if you want something to fire each ROUND, you should look at CombatManager.setCustomRoundStart() or even setCustomCombatReset().
Hope that helps.Last edited by jackkerouac; June 1st, 2020 at 03:26.
-
June 1st, 2020, 09:20 #3
Thanks for checking for me Jack, although not what I wanted to hear :P
I need something to fire on the end of an actors turn, but also something different to fire on a turn end.
Guess I'll have to find some part of the base functions to override instead of using the 'setCustom' funtions.
I thought the way I had attacked it was the correct way, maybe it is and that part of the code is buggy.
Thanks again for confiming.
Cheer, Steve.
-
June 1st, 2020, 09:27 #4
The turn end gets ran whenever there’s a change in the current unit slot - which happens at the end of the round too. There’s another custom function in the CoreRPG effects package, I can't remember what it’s called as I’m not in front of my computer, it’s something like customActorEndTurn - it has "actor" in the name.
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, 2020, 10:54 #5
I was getting a bit confused. The custom event I was thinking of was fCustomOnEffectActorEndTurn in CoreRPG scripts\manager_effects.lua. But this only gets called if there are effects on the actor.
In the custom turnEnd script you have in post #1, add nodeCT as an event variable. You can check this and if it's the first node in the CT you can assume it's the beginning of the round? I don't know, just thinking out loud...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, 2020, 10:57 #6I had a play with a workaround earlier Trenloe, if I use a temporary flag, I can set/reset it depending on if the round end has been triggered, if it does, then don't trigger the turn end (as it will already have been processed before the round end).
It's a bit messy, but it works
Thanks for you help
Although there is something else you could also maybe help with..... :P
What event is triggered if you manually change the current actor in the CT by using the left hand buttons ?
Cheers, Steve.Last edited by Stv; June 1st, 2020 at 11:00.
-
June 1st, 2020, 11:35 #7Private 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, 2020, 14:02 #8
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks