Initiative Output Markup
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.
Initiative Output Markup
Is it possible to markup the text sent whenever a character receives initiative? Mostly I want to bold it so it stands out or perhaps change the color. Thanks in advance.
Re: Initiative Output Markup
yes.nolgroth wrote:Is it possible to markup the text sent whenever a character receives initiative? Mostly I want to bold it so it stands out or perhaps change the color. Thanks in advance.
1. turn the message of in the settings
2.check the wiki for the initiative functions (cause you'll need to write your own)
3.when you've done that create a macro which ends with
Code: Select all
[r:token.name] receives initiative
The most simple variant would be e.g:
Code: Select all
[h:nextInitiative()]
<b>[r:token.name] receives initiative</b>.
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: Initiative Output Markup
Now I feel stupid. Thanks for that insightful post. I plum forgot about using macros to advance the initiative list. Now all I have to do is decide if it is worth the time or not.
- JonathanTheBlack
- Dragon
- Posts: 544
- Joined: Mon Jun 28, 2010 12:12 pm
- Location: I'm the worm...
Re: Initiative Output Markup
Roll Initiative
End Turn
End Combat (Narrator Only)
Code: Select all
[h, if(getInitiative() != "The token is not in the initiative list."): assert(0, "<b style='color: #660000;'>" + token.name + " is already in combat!</b>", 0)]
[h: addToInitiative()]
[h: setInitiative(1d20 + InitiativeBonus + Level)]
[h: sortInitiative()]
[h: abort(0)]
Code: Select all
[h, if(isGM()), CODE:
{
[h: setState("Initiative", 0, getInitiativeToken())]
[h: nextInitiative()]
[h: setState("Initiative", 1, getInitiativeToken())]
};{
[h: Self = currentToken()]
[h: HasInit = getInitiativeToken()]
[h: assert(if(Self != HasInit, 0, 1), "<b style='font-color: #660000'>You do not have initiative.</b>", 0)]
[h: setState("Initiative", 0, getInitiativeToken())]
[h: nextInitiative()]
[h: setState("Initiative", 1, getInitiativeToken())]
}]
[h: abort(0)]
Code: Select all
[h, if(isGM()), CODE:
{
[status = input("EndCombat | 0 | Are you sure you want to end combat | CHECK")]
[abort(status)]
[assert(EndCombat)]
[setState("Initiative", 0, getInitiativeToken())]
[removeAllFromInitiative()]
};{
[assert(0, "<b style='color: #660000;'>You are not the GM.</b>", 0)]
}]
- Attachments
-
- initiative.png (9.06 KiB) Viewed 1143 times
- JonathanTheBlack
- Dragon
- Posts: 544
- Joined: Mon Jun 28, 2010 12:12 pm
- Location: I'm the worm...
Re: Initiative Output Markup
I had another version that tracked combat with a variable on the lib token and wouldn't allow anyone to use a rest macro until after combat was over, but my mom deleted it from her laptop. >_<
Re: Initiative Output Markup
Those are great examples. I will have to use those to adapt my Hero System framework. I already have it doing most of the stuff I need it to. The only thing I would like is the markup at this point. I think, between you and Wolph, that I am well on the way. Thanks for your response.
- JonathanTheBlack
- Dragon
- Posts: 544
- Joined: Mon Jun 28, 2010 12:12 pm
- Location: I'm the worm...
Re: Initiative Output Markup
I blatantly stole the idea from Rumble for the state marking whose turn it is.
Re: Initiative Output Markup
using it too and have improved it by sending a broadcast to the initiative receiver, which centers and selects his/her token on his/her pc.JonathanTheBlack wrote:I blatantly stole the idea from Rumble for the state marking whose turn it is.
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
- JonathanTheBlack
- Dragon
- Posts: 544
- Joined: Mon Jun 28, 2010 12:12 pm
- Location: I'm the worm...
Re: Initiative Output Markup
I thought about doing that, but I dislike taking control of other's screens. However, if there was one person constantly not noticing, I could probably cobble something together that just does it for them and not others.
Re: Initiative Output Markup
Yes you can always create a separate macro for that. I did it cause all my players requested it
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: Initiative Output Markup
The chat messages are part of the localized text file that MapTool uses. So there's one for English, one for Spanish, and so on. You could edit the English one and change the message to contain whatever HTML you wanted it to contain, but using an executable macro is much more flexible of course!
There's a thread in this forum (I think) which talks about how to add a new language translation for MT. It describes how to extract the file and makes changes.
There's a thread in this forum (I think) which talks about how to add a new language translation for MT. It describes how to extract the file and makes changes.
Re: Initiative Output Markup
Okay, I have a follow up question (and the advice I have thus far received has worked great). In HERO, there are states such as Abort and Stunned which effectively remove a person from the initiative for that Segment. I have everything working that does that. It outputs a message and removes an affected token from the list. The problem is, the nextInitiative() command still outputs to chat. Is there a way to suppress that output so that only if the person is NOT affected by those states, it outputs the message? It seems to only do that for the first person in the initiative table.
Here is the code snippet for reference.
Here is the code snippet for reference.
Code: Select all
[h: nextInitiative ()] <!--THIS IS THE CULPRIT I THINK-->
[h: tokID = getInitiativeToken()]
[h: switchToken (tokID)]
[h: name=getName (tokID)]
[h: holdStatus=getState ("hold", tokID)]
[h: abortStatus=getState ("abort", tokID)]
[if (abortStatus==1), CODE:
{
[h: setState ("abort", 0, tokID)]
[h: setState ("dodge", 0, tokID)]
[r: abortMsg=""+name+" Recovers from Aborting"]
[h: removeFromInitiative ()]
};
{
[h: abortMsg=""]
}
]
[h: stunnedStatus=getState ("stunned", tokID)]
[if (stunnedStatus==1), CODE:
{
[h: setState ("stunned", 0, tokID)]
[r: stunnedMsg=""+name+"Recovers from being Stunned"]
[h: removeFromInitiative ()]
};
{
[h: stunnedMsg=""]
}]
[if (holdStatus==1), CODE:
{
[r: holdMsg=""+name+" was Holding but it is their Phase. Hold canceled ."]
[h: setState ("hold", 0, tokID)]
};
{
[h: holdMsg=""]
}
]
[r, if (abortStatus==0 && stunnedStatus==0): "<b>"+name+" receives initiative</b>."]
Re: Initiative Output Markup
Scratch last request. I was able to get around that little detail by setting a couple of campaign properties (currentInit and numInitTokens) onto the Lib:Combat token. From there I set it up to manually set the number of tokens and start the first initiative at offset 0. From there the macro sets the currentInit to currentInit+1. Finally, once the currentInit equals the numInitToken-1, it outputs an error message and clears the initiative table. If you read my previous message, thanks for taking the time to do so and for any possible responses/solutions you may have considered. Got this one handled for now I think.
EDIT: Or not. It seems that Offset 0 always outputs the standard "(token) has received Initiative" message. I think I may well have to go into the guts, as was previously suggested, and remove that output text completely.
EDIT II: Well that worked sort of. By blanking out the init panel message, it gets rid of the "{0} receives initiative" message, but it leaves a blank line in the chat. Better that than the other though. I added a generic message instead. Of course, this won't help anybody downloading the campaign framework for their own use.
EDIT: Or not. It seems that Offset 0 always outputs the standard "(token) has received Initiative" message. I think I may well have to go into the guts, as was previously suggested, and remove that output text completely.
EDIT II: Well that worked sort of. By blanking out the init panel message, it gets rid of the "{0} receives initiative" message, but it leaves a blank line in the chat. Better that than the other though. I added a generic message instead. Of course, this won't help anybody downloading the campaign framework for their own use.
Re: Initiative Output Markup
The "Show Initiative Gain Message" option is a personal preference and only displays for PCs. You can ask all the players to turn it off if they only want to see your message. I wrote an initiative macro for firefly and shadow run, which has it's own complications which requires a lot of re-sorting. Before I sort, I set the Wiki: setCurrentInitiative() to -1, so I don't get any extra "X has gained initiative" message. At the end, I set the initiative to the correct position and gameplay continues.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Initiative Output Markup
Man I really can be such an idiot at times. I almost never hit that tab on the Preferences section. Mostly I set the options on the Interactions and Accessibility tabs. Thanks for posting that aliasmask. Will save me a lot of trouble. Since I am on the topic, what does the "Fill Selection Box" under Performance do?
Tip: Don't replace the jar file with your backup while the program is running. Bad mojo ensues.
Tip: Don't replace the jar file with your backup while the program is running. Bad mojo ensues.