PDA

View Full Version : Is there a reason why holder/owner of NPC cannot end turn?



SilentRuin
July 22nd, 2020, 18:19
I loathe overwriting ruleset code but sometimes its the only way I can get something done the way I want it. But this one I just had to overwrite - I'm curious why this is not part of the coreRPG ruleset already. Nobody who controls an NPC can end turn because of this code. Is there any logic to why it is not doing what I've written below?



-- overwritten version of CoreRPG\scripts\manager_combat.lua handleEndTurn() because it would not allow player controlled NPC's to advance next round.
function handleEndTurn(msgOOB)
local rActor = ActorManager.getActorFromCT(CombatManager.getActiv eCT());
local sActorType, nodeActor = ActorManager.getTypeAndNode(rActor);
if sActorType == "pc" then
if nodeActor.getOwner() == msgOOB.user then
CombatManager.nextActor();
end
else
-- Allow holder of npc to advance to next turn.
if nodeActor.getOwner() == msgOOB.user then
CombatManager.nextActor();
else
local aHolders = nodeActor.getHolders();
for _,sHolder in pairs(aHolders) do
if sHolder == msgOOB.user then
CombatManager.nextActor();
break;
end
end
end
end
end


And FYI - not tested the holder part as that requires someone besides me to test it.

[Anything I talk about ever is UNITY and 5E or coreRPG - in this case coreRPG code here]

Zacchaeus
July 22nd, 2020, 22:00
I think it's becasue the player doesn't actually 'own' the character; it's still owned by the DM.

SilentRuin
July 22nd, 2020, 22:25
I think it's becasue the player doesn't actually 'own' the character; it's still owned by the DM.

By that reasoning I should not be able to see it either then? For sure, we do see it and depending on the holder status (true (can unlock), false (stays locked)) we can actually modify the entry itself when its a true holder. But we can't advance the tracker? That sounds... less than optimal :)

Gist being - if I can own it (as a holder or in testing as my same login) I should be able to advance the turn for sure. You can't. I'd argue that even if I'm a holder where its locked (as it is when you control an NPC in my case) I should still be able to end the turn.

Keep in mind it does not work when you "own" it or when you are a holder with ownership privileges. The DM always has to advance to next actor in the combat tracker for you - this seems unreasonable to me.

But - I don't know all the in's and out's of coreRPG just use in 5E - so maybe there is an underlying "owner" reason as you state. If so though, I'm not understanding what it could be.

damned
July 23rd, 2020, 00:06
There are many, many things that could (shoudl?) be included but arent.
It could be because no one has ever asked, or because it just hasnt climbed to the top of anyones list or because it conflicts with something else.
Who knows?

SilentRuin
July 23rd, 2020, 03:09
There are many, many things that could (shoudl?) be included but arent.
It could be because no one has ever asked, or because it just hasnt climbed to the top of anyones list or because it conflicts with something else.
Who knows?

Well, part of this modification was that the NPC was not even considered as something a player could end turn on even if they owned it - was hoping I could add a holder on the combat tracker NPC node for the player is using...



nodeEntry.addHolder(nodeChar.getOwner(), false);


So that they would have access, be able to end turn - but not modify the data.

But something in code I can't see prevents that from ever happening.

You can only do all or nothing. So I'm forced to give the ability to unlock and edit the CT NPC node with...



nodeEntry.addHolder(nodeChar.getOwner(), true);


Which is weird because I can set a holder with false on any of the NPC references - just not in combat tracker. So my change in first post is largely useless (the owner part is still required - but the holder part is useless because you can't use false in CT node).