Thread: getCTNode
-
July 4th, 2019, 19:48 #1
getCTNode
Hello
I have some problem getting the CT node of a player controlled character. Normally I use
Code:ActorManager.getCTNode
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
-
July 4th, 2019, 19:57 #2
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!
-
July 4th, 2019, 20:33 #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);
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 anythingLast edited by Kelrugem; July 4th, 2019 at 20:40.
-
July 4th, 2019, 21:01 #4
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!
-
July 4th, 2019, 22:00 #5
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' }
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.
-
July 4th, 2019, 22:54 #6
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!
-
July 4th, 2019, 23:24 #7
-
July 5th, 2019, 16:52 #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
-
July 5th, 2019, 17:17 #9
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.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!
-
July 5th, 2019, 17:43 #10
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks