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

Blood and Honor

I have been thinking about using Blood and Honor and I am wondering if anyone has made a video of how to get it set up.  I am a java noob and looking for some videographic help.   Thanks in advance
No video as far as I know. But the setup isn't that hard to be honest. Send me a PM if you still need help.
There is the wiki here . Scroll down to the bottom for the video
Doug E. said: There is the wiki here . Scroll down to the bottom for the video Blargh, I forgot to check the wiki. :P
That video link doesn't seem to work anymore. "Video Unavailable" 
Ok now I'm getting this error&nbsp; For reference, the error message generated was:&nbsp; Error: toFront() must be given an object either from an event or getObj() or similar. undefined ///////////////////////////////////////////////// /***********************************************/ var BloodAndHonor = { author: { name: "John C." || "Echo" || "SplenectomY", company: "Team Asshat" || "The Alehounds", contact: "<a href="mailto:echo@TeamAsshat.com" rel="nofollow">echo@TeamAsshat.com</a>" }, version: "0.8.2", // The Aaron - Patched for playerIsGM(), createObj(), and randomInteger() crash. gist: "<a href="https://gist.github.com/SplenectomY/097dac3e427ec50f32c9" rel="nofollow">https://gist.github.com/SplenectomY/097dac3e427ec50f32c9</a>", forum: "<a href="https://app.roll20.net/forum/post/1477230/" rel="nofollow">https://app.roll20.net/forum/post/1477230/</a>", wiki: "<a href="https://wiki.roll20.net/Script:Blood_And_Honor:_Automatic_blood_spatter,_pooling_and_trail_effects" rel="nofollow">https://wiki.roll20.net/Script:Blood_And_Honor:_Automatic_blood_spatter,_pooling_and_trail_effects</a>", /***********************************************/ ///////////////////////////////////////////////// // This value should match the size of a standard grid in your campaign // Default is 70 px x 70 px square, Roll20's default. tokenSize: 70, // If you have it installed, this will plug in TheAaron's isGM auth module, // which will make it so only the GM can use the !clearblood command // Change to "true" if you want to check for authorization &nbsp; &nbsp; &nbsp; &nbsp; // NOTE: Changed this to use the now built in playerIsGM() useIsGM: false, // YOU MUST ADD YOUR OWN SPATTERS AND POOLS TO YOUR LIBRARY // AND GET THE IMAGE LINK VIA YOUR WEB BROWSER. // FOLLOW THE INSTRUCTIONS HERE: // <a href="https://wiki.roll20.net/API:Objects#imgsrc_and_avatar_property_restrictions" rel="nofollow">https://wiki.roll20.net/API:Objects#imgsrc_and_avatar_property_restrictions</a> // You can add as many as you'd like to either category. // Spatters are also used for blood trails. spatters: [ &nbsp; &nbsp; "<a href="https://s3.amazonaws.com/files.d20.io/images/63227914/5OlIckZQvMRuklifC3gvBg/max.png?1537581847" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63227914/5OlIckZQvMRuklifC3gvBg/max.png?1537581847</a>", &nbsp; &nbsp; "<a href="https://s3.amazonaws.com/files.d20.io/images/63227900/Bd5Dl71FfAsZZc6_EOUxiw/max.png?1537581832" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63227900/Bd5Dl71FfAsZZc6_EOUxiw/max.png?1537581832</a>", //"<a href="https://s3.amazonaws.com/files.d20.io/images/6993500/mAA-8agYIwkhEciVVSCFmg/thumb.png?1420411542" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/6993500/mAA-8agYIwkhEciVVSCFmg/thumb.png?1420411542</a>", ], pools: [ &nbsp; &nbsp; "<a href="https://s3.amazonaws.com/files.d20.io/images/63228013/s0CV1P7ikzG-NhEOdjsjaw/max.png?1537581940" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63228013/s0CV1P7ikzG-NhEOdjsjaw/max.png?1537581940</a>", //"<a href="https://s3.amazonaws.com/files.d20.io/images/6993478/77YowTZze57mGAHfSaxwYg/thumb.png?1420411480" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/6993478/77YowTZze57mGAHfSaxwYg/thumb.png?1420411480</a>", ], chooseBlood: function chooseBlood(type) { if (type == "spatter") return BloodAndHonor.spatters[randomInteger(BloodAndHonor.spatters.length) - 1]; if (type == "pool") return BloodAndHonor.pools[randomInteger(BloodAndHonor.pools.length) - 1]; }, getOffset: function getOffset() { if (randomInteger(2) == 1) return 1; else return -1; }, bloodColor: function bloodColor(gmnotes) { if (gmnotes.indexOf("bloodcolor_purple") !== -1) return "#0000ff"; if (gmnotes.indexOf("bloodcolor_blue") !== -1) return "#00ffff"; if (gmnotes.indexOf("bloodcolor_orange") !== -1) return "#ffff00"; else return "transparent" }, createBlood: function createBlood(gPage_id,gLeft,gTop,gWidth,gType,gColor) { gLeft = gLeft + (randomInteger(Math.floor(gWidth / 2)) * BloodAndHonor.getOffset()); gTop = gTop + (randomInteger(Math.floor(gWidth / 2)) * BloodAndHonor.getOffset()); setTimeout(function(){ toFront(createObj("graphic",{ imgsrc: gType, gmnotes: "blood", pageid: gPage_id, left: gLeft, tint_color: gColor, top: gTop, rotation: randomInteger(360) - 1, width: gWidth, height: gWidth, layer: "map" })); },50); }, timeout: 0, onTimeout: function theFinalCountdown() { if (BloodAndHonor.timeout &gt; 0) { BloodAndHonor.timeout--; } else { return; } } }; on("ready", function(obj) { setInterval(function(){BloodAndHonor.onTimeout()},1000); on("change:graphic:bar1_value", function(obj, prev) { if (obj.get("bar1_max") === "" || obj.get("layer") != "objects" || (obj.get("gmnotes")).indexOf("noblood") !== -1) return; // Create spatter near token if "bloodied". // Chance of spatter depends on severity of damage else if (obj.get("bar1_value") &lt;= obj.get("bar1_max") / 2 &amp;&amp; prev["bar1_value"] &gt; obj.get("bar1_value") &amp;&amp; obj.get("bar1_value") &gt; 0) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var m=parseInt(obj.get('bar1_max'),10)||1, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v=parseInt(obj.get('bar1_value'),10)||1, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r=randomInteger(m); if (r&gt;v) { var bloodMult = 1 + ((obj.get("bar3_value") - prev["bar3_value"]) / obj.get("bar3_max")); BloodAndHonor.createBlood(obj.get("_pageid"), obj.get("left"), obj.get("top"), Math.floor(BloodAndHonor.tokenSize * bloodMult), BloodAndHonor.chooseBlood("spatter"), BloodAndHonor.bloodColor(obj.get("gmnotes"))); } } // Create pool near token if health drops below 1. else if (obj.get("bar1_value") &lt;= 0) { BloodAndHonor.createBlood(obj.get("_pageid"), obj.get("left"), obj.get("top"), Math.floor(BloodAndHonor.tokenSize * 1.5), BloodAndHonor.chooseBlood("pool"), BloodAndHonor.bloodColor(obj.get("gmnotes"))); } }); //Make blood trails, chance goes up depending on how injured a token is on("change:graphic:lastmove", function(obj) { if (BloodAndHonor.timeout == 0) { if (obj.get("bar1_value") &lt;= obj.get("bar1_max") / 2 &amp;&amp; (obj.get("gmnotes")).indexOf("noblood") == -1) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var m=parseInt(obj.get('bar1_max'),10)||1, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v=parseInt(obj.get('bar1_value'),10)||1, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r=randomInteger(m); if (r&gt;v) { BloodAndHonor.createBlood(obj.get("_pageid"), obj.get("left"), obj.get("top"), Math.floor(BloodAndHonor.tokenSize / 2), BloodAndHonor.chooseBlood("spatter"), BloodAndHonor.bloodColor(obj.get("gmnotes"))); BloodAndHonor.timeout += 2; } } } }); on("chat:message", function(msg) { if (msg.type == "api" &amp;&amp; msg.content.indexOf("!clearblood") !== -1) { if (BloodAndHonor.useIsGM &amp;&amp; !playerIsGM(msg.playerid)) { sendChat(msg.who,"/w " + msg.who + " You are not authorized to use that command!"); return; } else { objects = filterObjs(function(obj) { if(obj.get("type") == "graphic" &amp;&amp; obj.get("gmnotes") == "blood") return true; else return false; }); _.each(objects, function(obj) { obj.set("left",0); obj.set("top",0); }); } } }); });
Sorry to jump into your thread and not being able to help, but I have a question. I am completely&nbsp;illiterate about this type of thing. I understand I need URLs from my own library, where does one find those URLs? Sorry again I just don't want to make another help thread since one is active. Thanks ahead of time for any help I can get.
1537831459
Kirsty
Pro
Sheet Author
There is probably a faster way, but until someone teaches me otherwise, here's what I do. Upload the image that you want to use. Drag the image onto your tabletop (skip step 1 if the image is already in your library). Select the image and press "z" to have the image display on your screen. Right click on the blown-up image and select "copy image address".
Kirsty said: There is probably a faster way, but until someone teaches me otherwise, here's what I do. Upload the image that you want to use. Drag the image onto your tabletop (skip step 1 if the image is already in your library). Select the image and press "z" to have the image display on your screen. Right click on the blown-up image and select "copy image address". Thank you!
1537833517

Edited 1537839839
Kismet,&nbsp; After doing a lot of old thread diving I got it to work. I think you might be having the same problem I was. This is the code you posted: &nbsp;" <a href="https://s3.amazonaws.com/files.d20.io/images/63227914/5OlIckZQvMRuklifC3gvBg/max.png?1537581847" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63227914/5OlIckZQvMRuklifC3gvBg/max.png?1537581847</a> ", &nbsp; &nbsp; " <a href="https://s3.amazonaws.com/files.d20.io/images/63227900/Bd5Dl71FfAsZZc6_EOUxiw/max.png?1537581832" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63227900/Bd5Dl71FfAsZZc6_EOUxiw/max.png?1537581832</a> ", //" <a href="https://s3.amazonaws.com/files.d20.io/images/6993500/mAA-8agYIwkhEciVVSCFmg/thumb.png?1420411542" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/6993500/mAA-8agYIwkhEciVVSCFmg/thumb.png?1420411542</a> ", ], Make sure that at the end of the code where it says /max.png? you change it to thumb.png And on the third line remove the //&nbsp; &nbsp;at the beginning&nbsp;of the code. They need to be thumb.png and the // are comment markers. I have no idea what I am doing to be honest but I made those changes after seeing some comments in some dead threads and it now works for me.&nbsp; Here is mine for an example: spatters: [ "<a href="https://s3.amazonaws.com/files.d20.io/images/63459401/HxRT4c-Pey3i8Mw1jrW33A/thumb.png?1537828421" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63459401/HxRT4c-Pey3i8Mw1jrW33A/thumb.png?1537828421</a>", "<a href="https://s3.amazonaws.com/files.d20.io/images/63464632/D1KX7lWdqqFMhRntboP4MQ/thumb.png?15378337515" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63464632/D1KX7lWdqqFMhRntboP4MQ/thumb.png?15378337515</a>", "<a href="https://s3.amazonaws.com/files.d20.io/images/63464704/pLc0sgaj2E78H6GXfa2q7A/thumb.png?15378338505" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63464704/pLc0sgaj2E78H6GXfa2q7A/thumb.png?15378338505</a>", "<a href="https://s3.amazonaws.com/files.d20.io/images/63464793/WLL_33IA0_GxDdLXRH7Bpg/thumb.png?15378339395" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63464793/WLL_33IA0_GxDdLXRH7Bpg/thumb.png?15378339395</a>", "<a href="https://s3.amazonaws.com/files.d20.io/images/63465101/K8dHG87PMYTMtvsF7a5UeA/thumb.png?15378341605" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63465101/K8dHG87PMYTMtvsF7a5UeA/thumb.png?15378341605</a>", "<a href="https://s3.amazonaws.com/files.d20.io/images/63470677/Rg9fQCRGK4gbNEdgH23kcQ/thumb.png?15378344405" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/63470677/Rg9fQCRGK4gbNEdgH23kcQ/thumb.png?15378344405</a>", ],
Thank you all for the comments, and help. &nbsp;I appreciate it. &nbsp;There is a faster way. &nbsp;Someone wrote an API that snags image urls that you have highlighted in game, it’s nice. &nbsp;I’ll link it here when I get a chance currently on my mobile.&nbsp;
I changed them to thumb.png and this is what is popping out now Error: Firebase.set failed: First argument contains NaN in property 'left' Error: Firebase.set failed: First argument contains NaN in property 'left' at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:186) at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:207) at Aa (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:462) at J.set (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:146:98) at createObj (/home/node/d20-api-server/api.js:2703:26) at Timeout._onTimeout (apiscript.js:59:12) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5) at Timer.listOnTimeout (timers.js:214:5)
1538121554
Ziechael
Forum Champion
Sheet Author
API Scripter
I believe the script defaults to checking bar 1 for the hitpoints, are you using that bar for something else? Potentially something text based rather than numerical? What other scripts do you have installed?
Well, I did try switching the default to bar 3, because i have hp set up there on all my tokens.&nbsp; And I am testing blood and honor in a Copy of my campaign at the moment because it would be shutting everything down.&nbsp; haha
1538386684
Ziechael
Forum Champion
Sheet Author
API Scripter
Ok, it could be that you need to make more changes to the code to switch over to bar 3... try rolling back your changes to bar 1 in the copy and make sure it works ok like that, using bar 1 for hit points. If that works then the changes can be put back... the issue being that since the number of splatters and pools you use affects the numbering of the scripts lines it makes it hard to guess where the bar 3 changes would need to come in lol, it should be in 17 places though :/
Ahh thanks I’ll try that