Redrawing a player's frame

Progress reports and musings from the developers on the current gaming tools.

Moderators: dorpond, trevor, Azhrei

nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

Redrawing a player's frame

Post by nirkedar »

Is it possible for the GM to have a player's frame (character sheet) redrawn from code.

In my situation each player has a frame showing his character sheet. On the sheet, the current movement mode is displayed on it (walk, climb, swim, etc) as well as the movement limit (30 feet, 15 feet, etc).

1. A player may chose to switch his movement to (e.g. from walking to climbing) by clicking on the climb check link on his PC sheet.
2. In the chat menu, his climb check roll is rolled and shown, as well as 2 GM only link buttons: Success & Failure.
3. If the GM clicks on the Success button, the players movement mode changes to Climb and his movement limit is set to 15 (feet per move action).

Is there a way to get the Player's character sheet frame to refresh itself after the GM clicks on the Success link?

User avatar
Bone White
Great Wyrm
Posts: 1124
Joined: Tue Aug 23, 2011 11:41 am
Location: Cornwall, UK

Re: Redrawing a player's frame

Post by Bone White »

Yes, just call the frame again using the macro link. You can find information here [wiki]Introduction_to_Dialogs_and_Frames[/wiki]

nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

Re: Redrawing a player's frame

Post by nirkedar »

I guess I didn't make my self clear:

I know I can refresh a frame on the same machine by simply calling the macro that draws the frame, but I want the GM's action to refresh a frame on the Player's (a different person) computer.

Is there a way to send a command to another computer terminal to refresh it's frame (similar to broadcasting to a select audience).


nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

Re: Redrawing a player's frame

Post by nirkedar »

I think that will do it.
Always a pleasure dealing with you gents.
Thanks.

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: Redrawing a player's frame

Post by Nertht »

Should I get same results of broadcast(link) with two clients running on one PC?

User avatar
aliasmask
Deity
Posts: 8624
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Redrawing a player's frame

Post by aliasmask »

When you broadcast a link that has autoexecute checked it will auto run on all the client computer except the person who ran the macro. They will have to click the link. You can post to all other clients using [wfunc]getAllPlayerNames[/wfunc] and subtract your name from list to avoid double post using [wfunc]getPlayerName[/wfunc]. One way is like this.

Code: Select all

[r: broadcast(link,json.difference(getAllPlayerNames("json"),json.append("",getPlayerName())),"json")]
[H: executeLink(link)]

The broadcast line posts "link" to the chat for the other clients and runs the link on your client. The "link" string value should have a macro link somewhere in there and the macro being called should have autoexec checked to run automatically for the other clients. Otherwise, they will have to manually click the link.

User avatar
wolph42
Deity
Posts: 9805
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Redrawing a player's frame

Post by wolph42 »

note that i have a function available in the bag of tricks (link in sig) that deals with this. cant recall teh exact name of the function, but its documented in the manual.

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: Redrawing a player's frame

Post by Nertht »

Thx for answers.

But this broadcast macro still doesn´t work. I dont have a clue, why.
-Autoexecute is chcecked.
-I´m using last version of MT (1.3.b90).
-I started two clients (Player1 and Player2) on my PC.

Macro should open new frame on client named Player2. But it still execute macro (open farame) on my (Player1) client.

Code: Select all

[h: broadcast(execLink(macroLinkText("[email protected]:Token", "none", "", "Player2Token")),"Player2")]

Are there any other special options or is problem with my macro?

Wolph:
Searching in bag of trick was first thing which i did. Its function called: bot_execAllPlayers(). Anyway thx for your hard work wolph.


Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: Redrawing a player's frame

Post by Nertht »

Nope, it made an -in body of roll- error.
I tried to make an lib:Token with update macro. And use example macro from [wfunc]broadcast[/wfunc].

Code: Select all

[h: bot_execAllPlayer("[email protected]:Token", json.append("","Hello World", 2), "Player2", "all")]

Error was occur anyway. (Doesn´t matter if macro [email protected]:Token was blank, or not.) BoT was implemented right and function bot_execAllPlayer was defined. (I did it explicitly).


User avatar
aliasmask
Deity
Posts: 8624
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Redrawing a player's frame

Post by aliasmask »

Nertht wrote:

Code: Select all

[h: broadcast(execLink(macroLinkText("[email protected]:Token", "none", "", "Player2Token")),"Player2")]


This wouldn't work because there is no output. If you create your link with macroLink you can then post it with broadcast and not use execLink. A link will show up in chat and execute on the other client, but the client who posted the link. You would have to click it yourself or use my code in an earlier post.

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: Redrawing a player's frame

Post by Nertht »

aliasmask:
Ah, ok. I inspired myself in [wfunc]broadcast[/wfunc] tutorial, where stands:
Executing the macro 'update()' located at 'lib:Token', for the token 'Dragon' on the PC of user 'Tim':
[h: link = macroLinkText("[email protected]:Token", "none", "", "Dragon")]
[h: broadcast(execLink(link), "tim")]

wolph:
Of course.
Download here


*Now I see, where can be a problem... Cause, I still speak, about direct running macro from my PC, without clicking on chat. Is it necessary players to click a link? Cause in that case, players can click it repeately and make a lot of mess. I thought, that direct running is possible with broadcast execLink.

User avatar
wolph42
Deity
Posts: 9805
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Redrawing a player's frame

Post by wolph42 »

Nertht wrote:Nope, it made an -in body of roll- error.
I tried to make an lib:Token with update macro. And use example macro from [wfunc]broadcast[/wfunc].

Code: Select all

[h: bot_execAllPlayer("[email protected]:Token", json.append("","Hello World", 2), "Player2", "all")]

Error was occur anyway. (Doesn´t matter if macro [email protected]:Token was blank, or not.) BoT was implemented right and function bot_execAllPlayer was defined. (I did it explicitly).


its
bot_execAllPlayers
if you correct that it works.

Post Reply

Return to “Developer Notes”