5E Character Create Playlist
Page 1 of 2 12 Last

Thread: getCTNode

  1. #1

    getCTNode

    Hello

    I have some problem getting the CT node of a player controlled character. Normally I use

    Code:
    ActorManager.getCTNode
    and that works perfectly (for adding strings as effect for example). But when the character is controlled by a player this does not work anymore. I realized by debugging that the host has the informations about all the ct entries like their nodes as long as they are not controlled by someone. When I open the console on the player side then I can see that the player has the information about his node instead of the host (i.e. the console debug lists the player controlled CT node only on the player side). But the problem is that the code seemingly only looks at the host informations

    How can I get the node informations of player controlled characters?

    I hope I have described it well enough

    Best wishes and thanks in advance,

    Kelrugem

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    I can't see how a player controlling a PC would stop the GM instance getting access to their Combat Tracker node - the GM always has access to all DB nodes. The only thing I can think of is if the LUA code is handling it differently.

    Please provide an example of the code you're running and what happens when a PC is controlled and when it's not controlled?
    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!

  3. #3
    okay, I try to rebuild the bit of code here Thanks Basically I do the following:

    Code:
    local rEffectSpell = {};
    rEffectSpell.sName = "test";
    rEffectSpell.nDuration = 1;
    rEffectSpell.nInit = 0;
    rEffectSpell.nGMOnly = 1;
    rEffectSpell.sApply = "";
    EffectManager.addEffect("", "", ActorManager.getCTNode(rActor), rEffectSpell, false);
    rEffectSpell is some variable defining the effect-string "test" and rActor is the character called in some function (here in some save roll function but that should be not important (I guess?)). That bit of code adds the string rEffectSpell as an effect to rActor. When rActor is not controlled by anyone then "test" is added as an effect to the rActor. But when rActor is controlled by a player then nothing happens, also no errors but the effect is also not added then

    EDIT: It might be that I misunderstand the function addEffect. I just review that now, maybe the arguments are wrong there

    EDIT2: Hm, okay, I do not find anyting wrong in my use of addEffect. But doesn't mean anything
    Last edited by Kelrugem; July 4th, 2019 at 20:40.

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    If you put some debug just before the EffectManager.addEffect function call, what does rActor show at that point?

    Where does this code run - on the client, or on the GM side (via OOB messaging)?
    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!

  5. #5
    Quote Originally Posted by Trenloe View Post
    If you put some debug just before the EffectManager.addEffect function call, what does rActor show at that point?

    Where does this code run - on the client, or on the GM side (via OOB messaging)?
    When the character is not controlled by anyone I get:

    Code:
    Runtime Notice: { s'sType' = s'pc', s'sCreatureNode' = s'charsheet.id-00001', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'Test' }
    But when it is controlled by someone then I do not get anything. But when I open the console on the player side then I get this information in that other console.

    Due to this and due to your second question I now read a bit more about OOB messaging and the part of that in the code. It can run on both, client and host depending on the situation, so Comm.deliverOOBMessage(msgOOB, ""); is only being used when it is not a character controlled by a player. Otherwise the function calls Comm.deliverOOBMessage(msgOOB, sOwner); (when an enemy attacks a controlled character) or the function which is triggered by that OOB message is directly called without using deliverOOBMessage (when the owner casts on his owned character). Seemingly this changes the behaviour on controlled characters. When I replace everything with Comm.deliverOOBMessage(msgOOB, ""); then it works as wanted but I am afraid doing that because that is not my part of the code and especially I do not know what else is changed (there must be a reason for this different treatment; one change I can see, is that the portrait at the roll result is then always the GM portrait and not the one of the controlled character).

    I am not that experienced with OOB messaging Is there a simple way to resolve that? The information of rActor is still there, but "somewhere else". So the original code still seems to work of course but not my part then Is there a way to call the information on the player side? (the sOwner in the deliver message above)
    Last edited by Kelrugem; July 6th, 2019 at 03:13.

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    I'm not at my computer now, so can only give a very quick response. OOBMessaging is usually used when the player instance of FG needs some code running and it doesn't have the right access to be able to do that - most commonly the player instance doesn't own a record on the database that needs modifying, so the task of modifying the database is passed off to the GM via OOB Messaging.

    I don't know if that helps you work out what's going on? If not, I may have a little spare time to look at it tomorrow...
    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!

  7. #7
    Quote Originally Posted by Trenloe View Post
    I'm not at my computer now, so can only give a very quick response. OOBMessaging is usually used when the player instance of FG needs some code running and it doesn't have the right access to be able to do that - most commonly the player instance doesn't own a record on the database that needs modifying, so the task of modifying the database is passed off to the GM via OOB Messaging.

    I don't know if that helps you work out what's going on? If not, I may have a little spare time to look at it tomorrow...
    thanks a lot for your answer I try to solve this Thanks for your time and you do not need to look at it when you do not have so much time, I try to solve it somehow (and when I will have found a solution, I will write this here )

  8. #8
    Okay, I understand now what is happening. The client can seemingly not use the addEffect function (and removeEffect, too). The chat message of addEffect is possible but not the effect itself for some reason, therefore there is some notifyApply function for effects using the OOB message to carry over this procedure to the host.

    Thanks again, Trenloe I really needed the information about OOB message and client-host interaction Now I have to see how to solve this because just using notifyApply is too slow (in sense of that the effect is applied too late because that effect is directly used in my code). Interesting, didn't know (and can not see yet, why) that the client can not produce effects directly

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Glad you're making progress!

    Quote Originally Posted by Kelrugem View Post
    Interesting, didn't know (and can not see yet, why) that the client can not produce effects directly
    It'll be because only the GM owns data in the combat tracker and so only the GM can make changes to data in the combat tracker. There's the odd exception (PC wounds, for example, as these aren't actually stored in the CT, they're linked to the data in the PC sheet - which a player can change). So only the GM can add effects as these are stored in the CT records.
    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!

  10. #10
    Quote Originally Posted by Trenloe View Post
    Glad you're making progress!


    It'll be because only the GM owns data in the combat tracker and so only the GM can make changes to data in the combat tracker. There's the odd exception (PC wounds, for example, as these aren't actually stored in the CT, they're linked to the data in the PC sheet - which a player can change). So only the GM can add effects as these are stored in the CT records.
    aaah, okay, that makes sense Thanks again Learned a lot

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
  •  
FG Spreadshirt Swag

Log in

Log in