Is this possible?
Moderators: dorpond, trevor, Azhrei
Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior.
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior.
Is this possible?
I have a "Done with Turn" macro that when the players are done, advances the initiative and handle a bunch of stuff (state checks, damage from bleeding, advances spell duration, etc, etc). Works just fine, except for one thing. I call switchToken during it but that means the players end up NOT having their token selected. And of course, that irritates them, since we use strict token ownership. So each time it goes from one of their turns to someone else's, that player has to re-select his token.
But, from a DM perspective, its great that it switches to the token with initiative because then I'm all set to perform the action for the next NPC.
So my question is...is there some way to switchToken for the DM...but for the players, keep selection on the token they're already on?
This is probably very wishful thinking but I thought I'd ask.
But, from a DM perspective, its great that it switches to the token with initiative because then I'm all set to perform the action for the next NPC.
So my question is...is there some way to switchToken for the DM...but for the players, keep selection on the token they're already on?
This is probably very wishful thinking but I thought I'd ask.
Re: Is this possible?
first of all switchtoken() is a temporary function that only applies to the macro its run in. It has nothing to do with selection of a token.
now just to be clear: you want a macro that does stuff and when it ends it:
1. selects the token of the user that pressed the button and
2. on the GM client it selects the token that is next in initiative?
is that correct?
that is possible. but not really easy.
now just to be clear: you want a macro that does stuff and when it ends it:
1. selects the token of the user that pressed the button and
2. on the GM client it selects the token that is next in initiative?
is that correct?
that is possible. but not really easy.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
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
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
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
Re: Is this possible?
Which tokens other players select are not effected by another players actions. Each client keeps a record of their own selections. But it's possible to force a selected token with Wiki: selectTokens(), but it has to be run from that client, not the person who ran the macro. This can be done by sending a link to chat to that client that makes the select command. You'll end up with some whitespace or you can someone incorporate it in to your end of turn macro.
pseudo-code:
player A selects end of turn
macro runs updating various things for that players token
link sent to player who controls token next in initiative with autoexecute on
macro runs beginning of turn functions including setting the currently token to be selected
pseudo-code:
player A selects end of turn
macro runs updating various things for that players token
link sent to player who controls token next in initiative with autoexecute on
macro runs beginning of turn functions including setting the currently token to be selected
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Is this possible?
Maybe I need to look at my "Done with Turn" macro and see if I'm forcing the "selection" issue due to an error on my part. I had thought the "switchToken" was doing it but if that's not the case, then it must be something I'm doing in the code.
Re: Is this possible?
I did have a "selectToken" in there!
Okay, so I took that out and at the end of my "Done with Turn" macro, I added this...
[h, if(isNPC()), code : {
[h: selectText = macroLink("", "SelectInitNpc@Lib:PC_CombatMacros")]
[broadcast(selectText, "gm")]
}]
The "SelectInitNPC" is pretty simple just...
[h : selectTokens(getInitiativeToken())]
...however, nothing happens. I put in a broadcast in "SelectInitNPC", before the selectTokens, but that never displays either. So I must be doing something incorrect and I'd assume its in the macroLink stuff since I have limited experience with that.
Any ideas?
Okay, so I took that out and at the end of my "Done with Turn" macro, I added this...
[h, if(isNPC()), code : {
[h: selectText = macroLink("", "SelectInitNpc@Lib:PC_CombatMacros")]
[broadcast(selectText, "gm")]
}]
The "SelectInitNPC" is pretty simple just...
[h : selectTokens(getInitiativeToken())]
...however, nothing happens. I put in a broadcast in "SelectInitNPC", before the selectTokens, but that never displays either. So I must be doing something incorrect and I'd assume its in the macroLink stuff since I have limited experience with that.
Any ideas?
Re: Is this possible?
Make sure SelectInitNpc has autorun on. Also, you can't autorun your own macros. You can only autorun for other clients. If the player is the same then use execLink rather than broadcasting it to chat.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Is this possible?
So, tried it like...
[h, if(isNPC()), code : {
[h: selectText = macroLink("", "SelectInitNpc@Lib:PC_CombatMacros")]
[h : execLink(selectText)]
}]
No luck, nothing happens.
And when you say, "Make sure SelectInitNpc has autorun on", I assume you're talking about the "Auto Execute" checkbox. With it checked or unchecked, doesn't work.
[h, if(isNPC()), code : {
[h: selectText = macroLink("", "SelectInitNpc@Lib:PC_CombatMacros")]
[h : execLink(selectText)]
}]
No luck, nothing happens.
And when you say, "Make sure SelectInitNpc has autorun on", I assume you're talking about the "Auto Execute" checkbox. With it checked or unchecked, doesn't work.
Re: Is this possible?
Here's what I did:
It doesn't check all the possible situations like an owner that doesn't exist, but it works for me.
The test campaign allow you to check the owner of the token and it will change the selection when it's their turn. Defaults to the first gm of campaign if no owner selected. Does nothing if owner of token not in game.
Code: Select all
@@ @Next
<!-- advance the initiative to the next token and change the selection to that token for the owner of that token -->
[H: nextInitiative()]
[H: id = getInitiativeToken()]
[H: owners = getOwners("json",id)]
[H, if(json.isEmpty(owners)): owner = json.get(getInfo("server"),"gm"); owner = owners]
[H, if(json.isEmpty(owner)): owner = getPlayerName(); owner = json.get(owner,0)]
[H, if(owner == getPlayerName()): selectTokens(id); broadcast("Select Token" + macroLink("","SelectNext@"+getMacroLocation(),"none",json.append("[]",id),id) + "...",owner)]
!!
@@ @SelectNext
[H: id = arg(0)]
[H: selectTokens(id)]
!!
The test campaign allow you to check the owner of the token and it will change the selection when it's their turn. Defaults to the first gm of campaign if no owner selected. Does nothing if owner of token not in game.
- Attachments
-
- test next select.cmpgn
- (422.45 KiB) Downloaded 99 times
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Is this possible?
I'll play around with this tonight, thanks!
Re: Is this possible?
You the man AM! Minor tweak and its working like a charm!
Thanks!
Thanks!