RPTools.net

Discussion and Support

Skip to content

It is currently Sat Nov 25, 2017 4:30 am 






Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

Previous topic | Next topic 

  Print view

Author Message
 Offline
Cave Troll
 
Joined: Tue Sep 21, 2010 2:13 pm
Posts: 67
 Post subject: Redrawing a player's frame
PostPosted: Sun Jul 13, 2014 7:19 am 
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?


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Tue Aug 23, 2011 10:41 am
Posts: 1134
Location: Cornwall, UK
 Post subject: Re: Redrawing a player's frame
PostPosted: Sun Jul 13, 2014 8:46 am 
Yes, just call the frame again using the macro link. You can find information here Introduction_to_Dialogs_and_Frames

_________________
How to get around the two code nest limit in MapTool (and MOTE)


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Tue Sep 21, 2010 2:13 pm
Posts: 67
 Post subject: Re: Redrawing a player's frame
PostPosted: Sun Jul 13, 2014 10:10 am 
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).


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9421
Location: Netherlands
 Post subject: Re: Redrawing a player's frame
PostPosted: Sun Jul 13, 2014 10:19 am 
Yup. Broadcast a execlink to that PC. Read Wiki: broadcast() for more info

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Tue Sep 21, 2010 2:13 pm
Posts: 67
 Post subject: Re: Redrawing a player's frame
PostPosted: Sun Jul 13, 2014 10:43 am 
I think that will do it.
Always a pleasure dealing with you gents.
Thanks.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Jul 27, 2014 2:46 am
Posts: 23
 Post subject: Re: Redrawing a player's frame
PostPosted: Tue Aug 19, 2014 7:08 pm 
Should I get same results of broadcast(link) with two clients running on one PC?


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7955
Location: Bay Area
 Post subject: Re: Redrawing a player's frame
PostPosted: Tue Aug 19, 2014 7:25 pm 
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 Wiki: getAllPlayerNames() and subtract your name from list to avoid double post using Wiki: getPlayerName(). One way is like this.

Code:
[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.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9421
Location: Netherlands
 Post subject: Re: Redrawing a player's frame
PostPosted: Tue Aug 19, 2014 7:32 pm 
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.

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Jul 27, 2014 2:46 am
Posts: 23
 Post subject: Re: Redrawing a player's frame
PostPosted: Wed Aug 20, 2014 4:39 am 
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:
[h: broadcast(execLink(macroLinkText("FRAME@Lib: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.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9421
Location: Netherlands
 Post subject: Re: Redrawing a player's frame
PostPosted: Wed Aug 20, 2014 5:09 am 
bot_execAllPlayers()
indeed thats the function. And does it work when you use that?

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Jul 27, 2014 2:46 am
Posts: 23
 Post subject: Re: Redrawing a player's frame
PostPosted: Wed Aug 20, 2014 5:59 am 
Nope, it made an -in body of roll- error.
I tried to make an lib:Token with update macro. And use example macro from Wiki: broadcast().
Code:
[h: bot_execAllPlayer("update@lib:Token", json.append("","Hello World", 2), "Player2", "all")]

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


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9421
Location: Netherlands
 Post subject: Re: Redrawing a player's frame
PostPosted: Wed Aug 20, 2014 6:16 am 
can you link the campaign file here with your bot_execallplayers trial in it, so I can have a look?

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7955
Location: Bay Area
 Post subject: Re: Redrawing a player's frame
PostPosted: Wed Aug 20, 2014 7:00 am 
Nertht wrote:
Code:
[h: broadcast(execLink(macroLinkText("FRAME@Lib: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.

_________________
Downloads:


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Jul 27, 2014 2:46 am
Posts: 23
 Post subject: Re: Redrawing a player's frame
PostPosted: Wed Aug 20, 2014 8:09 am 
aliasmask:
Ah, ok. I inspired myself in Wiki: broadcast() tutorial, where stands:
Quote:
Executing the macro 'update()' located at 'lib:Token', for the token 'Dragon' on the PC of user 'Tim':
[h: link = macroLinkText("update@Lib: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.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9421
Location: Netherlands
 Post subject: Re: Redrawing a player's frame
PostPosted: Wed Aug 20, 2014 9:14 am 
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 Wiki: broadcast().
Code:
[h: bot_execAllPlayer("update@lib:Token", json.append("","Hello World", 2), "Player2", "all")]

Error was occur anyway. (Doesn´t matter if macro update@lib: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.

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman