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

DeathTracker with custom Marker

I use the Death Tracker API in my game, but recently I upload my personnal status marker, but the probleme is :  I Want to delete the default one, but cannot bring the new set of marker in the API. So when a player falls unconscious, it goes straight to the "Dead" status marker instead of the "Sleepy" marker that no longer exist. I try to find the script of the death tracker API, and change the name of the sleepy status marker to my unconscious status marker, but it doesn work. Can you help me ?
I'm sure other people will have better/more efficient ways to do this, but here's what worked for me: First, you have to bring your new markers into your game. That would be through the Token Marker Sets option on the bottom-right side of the main page for your campaign. Once they're in your game (and give them some time -- Roll20 is weirdly slow allowing those markers to show up), install the libTokenMarkers script from the one-click. Then paste in the find token markers code as a separate script and restart your API: on("ready", () => {     const tokenMarkers = JSON.parse(Campaign().get("token_markers"));     const getChatMessageFromTokenMarkers = markers => {         let chatMessage = '';         _.each(markers, marker => {             chatMessage += `<p><img src='${marker.url}'> ${marker.id}: ${marker.name}</p>`;         });         return chatMessage;     };   on("chat:message", msg => {         if(msg.content.split(" ")[0].toLowerCase() === '!markernames') {             let chatMessage = getChatMessageFromTokenMarkers(tokenMarkers);             sendChat("Token Markers", chatMessage);         } else if(msg.content.split(" ")[0].toLowerCase() === '!markerids') {             const markerName = msg.content.split(" ")[1].toLowerCase();             let results = [];             _.each(tokenMarkers, marker => {                 if(marker.name.toLowerCase() === markerName) results.push(marker);             });             log(results);             let chatMessage = getChatMessageFromTokenMarkers(results);             chatMessage = chatMessage || 'Unable to find any matching token markers'             sendChat("Token Markers", chatMessage);         } else if(msg.content.split(" ")[0].toLowerCase() === '!settokenmarker') {             const markerName = msg.content.split(" ")[1].toLowerCase();             if (!msg.selected && msg.selected[0]._type == "graphic") return;             obj = getObj(msg.selected[0]._type, msg.selected[0]._id);             currentMarkers = obj.get("statusmarkers").split(',');             currentMarkers.push(markerName);             obj.set("statusmarkers", currentMarkers.join(','));         } else if(msg.content.split(" ")[0].toLowerCase() === '!gettokenmarkers') {             if (!msg.selected) return;             if (msg.selected[0]._type !== "graphic") return;             obj = getObj(msg.selected[0]._type, msg.selected[0]._id);             currentMarkers = obj.get("statusmarkers");             sendChat("Token Markers", currentMarkers);         }     }); }); Load your game and run the !markernames command. It should spit out a list of all your token marks with image, name, and id.  Copy the ID of the marker you want into the DeathTracker script, relatively near the top: markers = ['none', 'blue', 'brown', 'green', 'pink', 'purple', 'red', 'yellow', '-', 'KnockedOut::1173545', 'StatusBlood::1172799'],