-
March 4th, 2021, 21:07 #1
Module using "Session.isHost" gets nil?
I've a very simple extension that lets the DM, on demand, get the "manual roll" menu popup. However I've noticed that "Session.isHost" within this extension doesn't work on CoreRPG and 5e? I tried this with the Live and Test channels. Both give me "nil"
Code:Runtime Notice: s'manager_action_attack_onDemandManualDice.lua' | s'adnd_roll' | nil | bTRUE
Code:function onInit() -- replace default roll with adnd_roll to allow -- control-dice click to prompt for manual roll Debug.console("manager_action_attack_onDemandManualDice.lua","onInit","Initializing"); ActionsManager.roll = adnd_roll; -- end -- replace default roll with adnd_roll to allow -- control-dice click to prompt for manual roll function adnd_roll(rSource, vTargets, rRoll, bMultiTarget) -- Debug.console("manager_action_attack_onDemandManualDice.lua","adnd_roll",rSource,vTargets,rRoll,bMultiTarget); if #(rRoll.aDice) > 0 then Debug.console("manager_action_attack_onDemandManualDice.lua","adnd_roll",Session.isHost,Input.isControlPressed()); if not rRoll.bTower and (OptionsManager.isOption("MANUALROLL", "on") or (Session.isHost and Input.isControlPressed())) then local wManualRoll = Interface.openWindow("manualrolls", ""); wManualRoll.addRoll(rRoll, rSource, vTargets); else local rThrow = ActionsManager.buildThrow(rSource, vTargets, rRoll, bMultiTarget); Comm.throwDice(rThrow); end else if bMultiTarget then ActionsManager.handleResolution(rRoll, rSource, vTargets); else ActionsManager.handleResolution(rRoll, rSource, { vTargets }); end end end
Last edited by celestian; March 4th, 2021 at 21:44.
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
March 4th, 2021, 21:37 #2
Fast check in my extension to MoreCore for S&W - yup, same result:
Runtime Notice: s'IS HOST=' | nil
When I threw it into a roller method for quick test:
function createRoll(sParams)
Debug.console("IS HOST=", Session.isHost)
local rRoll = {}
...
This is with CLASSIC though and a couple months old version too. So if it is new, my input if meaningless
-
March 4th, 2021, 22:00 #3
To throw further info in the pot -
I searched on isHost in CORE to see if my version uses it. Found some and where it was I said... hmmm... it really needs to work there.
Tested by adding this to Core's manager_combat:
Code:function onCharDelete(nodeChar) Debug.console("delete IS_HOST=", Session.IsHost) if not Session.IsHost then return; end ...
Runtime Notice: s'delete IS_HOST=' | bTRUE
So... visibility? I'm curious and will look if no answer is posted here by time off from work and eat dinner and can look at this stuff again
-
March 4th, 2021, 22:26 #4
You have a typo, it is a very subtle problem: Session.IsHost, not Session.isHost The i has to be capital
My extensions for 3.5e and Pathfinder
Bug reports please here
-
March 4th, 2021, 22:37 #5bmos' extensions
he/them
-
March 4th, 2021, 22:47 #6---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
March 4th, 2021, 22:55 #7bmos' extensions
he/them
-
March 4th, 2021, 22:57 #8---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
March 4th, 2021, 23:56 #9
Typically that sort of thing is supposed to make code more clear.
Like this.bmos' extensions
he/them
-
March 4th, 2021, 23:59 #10
OMG - didn't see that lol - since I by habit use camel-case.
The casing preferences (speaking from old days - not up with current languages) was usually (ignoring the old Microsoft so-called-Hungarian notation system - an abomination - not to be confused with Moon's Hungarian because 1) it is more sensible than ulongVarName or what have you super specific stuff that actually CHANGED as bits changed and they could not DARE go back and change it since it's compiled and APIs with DLLs etc...but I digress - it always annoyed me when something that is an int was called a long etc....) camel case for C++ variables and methods with Pascal case for Classes and CTORs (and properties in languages with such things) - Pascal case I cannot recall who primarily used it (besides one assumes Pascal but that was 80s, I remember none of that) for members.
I personally stuck to camel with Pascal only for classes/class-like things and by extension CTORs because they have to match.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks