PDA

View Full Version : Putting input controls in chat?



celestian
February 24th, 2018, 04:16
Is it possible to put an input control into chat window? I am looking to solicit basic input from the users from in the chat window.

Anyone have a high level view how to do that? Anything else done it before I might could go over?

Andraax
February 24th, 2018, 04:22
Try "/vote".

celestian
February 24th, 2018, 04:24
Try "/vote".

That was the first thing I looked for but seems to be "in" FG.exe ... I couldn't find it in CoreRPG.

Moon Wizard
February 24th, 2018, 06:55
There's a "/vote <question>" command built into the client for a basic poll with yes/no/unanswered options.

Also, there is no way to customize the chat window other than as a standard window control. If you wanted to pop up some sort of input dialog to get feedback from the user, you would need to pop up a separate window to query the user. This is similar to how the manual dice rolling works with the "manualrolls" window class.

Regards,
JPG

celestian
February 24th, 2018, 07:07
There's a "/vote <question>" command built into the client for a basic poll with yes/no/unanswered options.

Also, there is no way to customize the chat window other than as a standard window control. If you wanted to pop up some sort of input dialog to get feedback from the user, you would need to pop up a separate window to query the user. This is similar to how the manual dice rolling works with the "manualrolls" window class.


I was thinking about something that worked like vote but was more like /readycheck and had a checkbox+user's name list and the players can only click their name-check. To make it easier to see who was actually there and who wasn't.

I chronically don't really know who is actually there w/o asking over discord.

Creating a popup wouldn't be to bad, I just liked the chat window version with /vote.

Thanks, I'll see what I can come up with.

damned
February 24th, 2018, 07:43
Moon Wizard an option that might be worth thinking about is a Campaign Option to toggle votes to private or public?
Public votes would display the voters name.

LordEntrails
February 24th, 2018, 19:36
Would their be anything in the DOE Alignment Graph that you could use?

celestian
February 26th, 2018, 02:46
I was thinking about something that worked like vote but was more like /readycheck and had a checkbox+user's name list and the players can only click their name-check. To make it easier to see who was actually there and who wasn't.

I chronically don't really know who is actually there w/o asking over discord.

Creating a popup wouldn't be to bad, I just liked the chat window version with /vote.

Thanks, I'll see what I can come up with.

So, I've been poking around at this and have a question. How does the host force all connected users to Interface.openWindow()?

For the dice/manual roll it's more the user initiated it because they click the option that requires a dice roll and it flips through code that eventually loads the window. For this, it's a command the DM runs (User.isHost()) and needs it to also load on every user connection.

I've been able to capture logins/outs and store their info in a node so that I can access when I run /readycheck. I did this because it's more elegant and also "drops" a user entry from the readycheck menu if they drop (or adds them if they connect while its up). I've got a simple window popup and show the users with checkboxes. I just need to be able to force the user's version and I'll make sure all the checks are read only except for their own.

damned
February 26th, 2018, 03:24
When the PC is keyboard inactive for a period of time they get zzzs on their portrait. Is that not working for you?

celestian
February 26th, 2018, 03:38
When the PC is keyboard inactive for a period of time they get zzzs on their portrait. Is that not working for you?

You mean as a "they are here and ready"? Not really.

Mostly I want to do this for after a break. We have a 10 minute break and I run a check and I can immediately tell who is there and ready.

The only time I can think of something that actually does this already is... when you share a map it forces the client side to load the map window. So the option is there it just might not be exposed for rulesets. If it turns out not, that's ok. I've had a good learning experience sorting out login/connections and it's given me some ideas on how to deal with some initiative issues (specifically for games that roll initiative every round and you're not sure whom you are waiting for to roll).

damned
February 26th, 2018, 04:00
You mean as a "they are here and ready"? Not really.

Mostly I want to do this for after a break. We have a 10 minute break and I run a check and I can immediately tell who is there and ready.

The only time I can think of something that actually does this already is... when you share a map it forces the client side to load the map window. So the option is there it just might not be exposed for rulesets. If it turns out not, that's ok. I've had a good learning experience sorting out login/connections and it's given me some ideas on how to deal with some initiative issues (specifically for games that roll initiative every round and you're not sure whom you are waiting for to roll).

Yes... the downside to playing games with people remotely...
sorry my cat needed to go outside
sorry was feeding my dog
sorry was watching this video on youtube
sorry what did you say?

LordEntrails
February 26th, 2018, 06:18
Does not just throwing up a /vote ready? wok well enough for you? That's what I do after a break.

celestian
February 26th, 2018, 06:30
Does not just throwing up a /vote ready? wok well enough for you? That's what I do after a break.

I don't know who is voting. It's just a tick box, no clue who checks it. Was just looking to improve it a bit if I can.

celestian
February 26th, 2018, 06:42
double post

Moon Wizard
February 26th, 2018, 09:51
If you want a pop-up, then you would use OOB message to open the window on the client. (If it was database linked, you could potentially use windowisntance.share().) However, any interactions on the client would need to be passed via OOB messages to the host, and then to the other clients so that they update like the /vote.

Regards,
JPG

Trenloe
February 26th, 2018, 12:51
So, I've been poking around at this and have a question. How does the host force all connected users to Interface.openWindow()?

For the dice/manual roll it's more the user initiated it because they click the option that requires a dice roll and it flips through code that eventually loads the window. For this, it's a command the DM runs (User.isHost()) and needs it to also load on every user connection.
Have a look at the MOTD extension: https://www.fantasygrounds.com/forums/showthread.php?22369-Message-of-the-Day-%28MOTD%29-Extension

This uses OOB messaging and Interface.openWindow to display a window on the client/s.

celestian
February 26th, 2018, 15:09
Have a look at the MOTD extension: https://www.fantasygrounds.com/forums/showthread.php?22369-Message-of-the-Day-%28MOTD%29-Extension

This uses OOB messaging and Interface.openWindow to display a window on the client/s.

Ah! Okay will check that out, thanks for the tip. My recent work with OOB should make that easy ;)

LordEntrails
February 26th, 2018, 16:15
I don't know who is voting. It's just a tick box, no clue who checks it. Was just looking to improve it a bit if I can.
Ah, you're right. Didn't think of that.

celestian
February 27th, 2018, 04:34
Have a look at the MOTD extension: https://www.fantasygrounds.com/forums/showthread.php?22369-Message-of-the-Day-%28MOTD%29-Extension

This uses OOB messaging and Interface.openWindow to display a window on the client/s.

I looked at the code and unfortunately you're loading the window when they login which is triggered via userLogin on the client side. What I am trying to do is, as DM/Host, type /readycheck and popup a window on the host screen and all the clients.

This is the bit I'm referring to.


function userLogin(username, activated)
if activated then
--Debug.console("User logged in = " .. username);
-- New user logging in - push the MOTD
motd_launch(username);
end
end


That causes the window to load by client login, not by a command issued on the DM side.



If you want a pop-up, then you would use OOB message to open the window on the client. (If it was database linked, you could potentially use windowisntance.share().) However, any interactions on the client would need to be passed via OOB messages to the host, and then to the other clients so that they update like the /vote.


I'll dig into windowisntance.share() and see what it can do, thanks!

damned
February 27th, 2018, 04:41
Hi celestian less elegant but you could create a campaign tool that basically has those same Names/Checkboxes and load it up (and hit reset to clear previous vote) and hit Share?

Trenloe
February 27th, 2018, 14:55
I looked at the code and unfortunately you're loading the window when they login which is triggered via userLogin on the client side. What I am trying to do is, as DM/Host, type /readycheck and popup a window on the host screen and all the clients.
The example code I was referring to is OOB messaging to display a window.

Start the OOB messaging with a slashhandler - the simplest way in FG to start a script in FG.


Register the SlashHandler in the script's onInit function:

Comm.registerSlashHandler("readycheck", startReadyCheck);

When /readycheck is typed in the chat window the startReadyCheck function will run.

celestian
February 27th, 2018, 16:05
The example code I was referring to is OOB messaging to display a window.

Start the OOB messaging with a slashhandler - the simplest way in FG to start a script in FG.


Register the SlashHandler in the script's onInit function:

Comm.registerSlashHandler("readycheck", startReadyCheck);

When /readycheck is typed in the chat window the startReadyCheck function will run.

Yeap, that part I'd already got. IT's the part where typing /readycheck on the host side starts it up on the clients also thats the problem. I might should just post the code I have so far later tonight.

I'll re-review the oob stuff in the motd extension, I must have missed a crucial part you meant for chat text. I will be soliciting input from the users tho so might be why I didn't see what I needed. If it's just read only output to chat...

Trenloe
February 27th, 2018, 16:16
You can deliver OOB messages to clients too - see the recipients argument here: https://www.fantasygrounds.com/refdoc/Comm.xcp#deliverOOBMessage

Trenloe
February 27th, 2018, 16:17
And if all you want is just to do a chat message from the DM side then you don't need OOB messaging.

https://www.fantasygrounds.com/refdoc/Comm.xcp#deliverChatMessage

celestian
February 27th, 2018, 17:24
And if all you want is just to do a chat message from the DM side then you don't need OOB messaging.

https://www.fantasygrounds.com/refdoc/Comm.xcp#deliverChatMessage

That's not what I'm going for.

I want to have a new "/vote ReadyCheck" with /readycheck and it popup a menu with every user connected and a tic box for each. Each user can only tic their own check box. This way I can see which actual user is there and ready.

Trenloe
February 27th, 2018, 17:36
That's not what I'm going for.
Sorry, I was getting confused with you mentioning chat text, and wondered what you were asking for.


I want to have a new "/vote ReadyCheck" with /readycheck and it popup a menu with every user connected and a tic box for each. Each user can only tic their own check box. This way I can see which actual user is there and ready.
So you have what you need.

A slashhandler for readycheck which would start OOB messaging to start a function on all of the clients to open the window.

You'd then need OOB messging triggered when a player clicked a tic box - to pass to the GM so that the GM can update the database field the tick box is anchored to.

damned
February 27th, 2018, 22:59
You can deliver OOB messages to clients too - see the recipients argument here: https://www.fantasygrounds.com/refdoc/Comm.xcp#deliverOOBMessage

celestian I think this is the bit you need....

celestian
February 28th, 2018, 04:50
Okay, so I got it working. I still wanna do a few more things (like DING the player side when the check is run, and DING the DM when all the players are ready) but here is the screenies of what is working so far.

https://i.imgur.com/2S5EcMX.png

And here is one after "Celestian" clicked ready (the readycheck window closes when you do that).

https://i.imgur.com/mqLxdI9.png

It's not in the chat box as I had originally wanted but I have something that does what I need and was pretty fun figuring out.

Once I finalize how things work I'll set this up as a CoreRPG based extension incase anyone else would like to use it.