Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Help] It's a Trap chat messages and GM-only messages

So, I just started playing around with It's a Trap, and it works really well in general, but there's a couple of things that I can't quite figure out: 1) How would I go about changing the formatting of the messages sent in chat? Some of the applications that I'd like to use It's a Trap for are not really conducive to a big flashy "It's a Trap!!!" text box (I want to use it in conjunction with TokenMod to move tokens to automatically move Tokens between map levels when they move to certain spots). 2) I noticed that the API and TokenMod triggers don't seem to function with GM-only messages. I could easily see it being the case that this is just a limitation of the API, but is there a way to use the TokenMod call without alerting the players to the fact that something happened?
1592715261

Edited 1592715517
Partially resolved, I copied the script from Github, and figured out how to make some of the changes. 1) I still haven't figured out entirely how to change the formatting of the chat messages. I've managed to cut it down a bit, but it isn't remotely pretty or polished, the functions that build the messages are scattered throughout the script, and I'm not familiar enough with JavaScript to try sorting it out. 2) Enabling API and TokenMod triggers for GM-only messages was deceptively simple. Starting at line 1044 is the following: // Display the message to everyone, unless it's a secret. if(this.gmOnly) { ItsATrap.Chat.whisperGM(message); // Whisper any secret notes to the GM. if(this.notes) ItsATrap.Chat.whisperGM(`Trap Notes:<br/>${this.notes}`); } else { ItsATrap.Chat.broadcast(message); // Whisper any secret notes to the GM. if(this.notes) ItsATrap.Chat.whisperGM(`Trap Notes:<br/>${this.notes}`); // Reveal the trap if it's set to become visible. if(this.trap.get('status_bleeding-eye')) ItsATrap.revealTrap(this.trap); // Produce special outputs if it has any. this.playSound(); this.playFX(); this.playAreaOfEffect(); this.playKaboom(); this.playTokenMod(); this.playApi(); // Allow traps to trigger each other using the 'triggers' property. this.activateTriggers(); } } Copying the this.playTokenMod(); this.playApi(); and inserting it before the "Whisper secret notes" comment in the first if statement works just fine. This would probably work with any of the other special outputs.
1592839138
Ada L.
Marketplace Creator
Sheet Author
API Scripter
The script doesn't supported formatted messages.