STAR TREK 2d20
  1. #1

    Is there a reason why holder/owner of NPC cannot end turn?

    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?

    Code:
    -- 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.getActiveCT());
    	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]
    Last edited by SilentRuin; July 22nd, 2020 at 18:25.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,831
    I think it's becasue the player doesn't actually 'own' the character; it's still owned by the DM.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3
    Quote Originally Posted by Zacchaeus View Post
    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.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  4. #4
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    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?

  5. #5
    Quote Originally Posted by damned View Post
    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...

    Code:
    							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...

    Code:
    							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).
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in