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

[Script] Need Help! HP (bar1) change tracker

Hello all! I created a script that will announce to all that a bar value has changed. The only problem is, every time it runs, it displays 6 times! I tried disabling each of my other scripts running to make sure they are not interfering, and none are. Is there some way to stop this from happening? Thanks <a href="https://gist.github.com/anonymous/329dbe3a6eaf6f23d32c" rel="nofollow">https://gist.github.com/anonymous/329dbe3a6eaf6f23d32c</a>
I have gotten it to work!&nbsp; Note: It requires you to have names your attribute 'Hp'. <a href="https://gist.github.com/DarokinB/5708569" rel="nofollow">https://gist.github.com/DarokinB/5708569</a>
1370377491
Konrad J.
Pro
API Scripter
Good job, another user playing with scripts. &nbsp;Its been a bit dead around here for new scripts!
lol I have a lot of experience programming (my field) and I do it for fun on top of that. Still remembering javascript but this seems pretty easy to learn. I already made a tracker for movement, using scale on the page, and a resting script that brings all characters to full after a night sleep. Gonna keep playing around and once I get more them I will package them together. I'm playing in DnD Next so there is already a limited field.
1370390904
Konrad J.
Pro
API Scripter
What does your tracker for movement do? &nbsp;I've got one that tracks how much you have moved and enforces your limit. &nbsp;It shows a diminishing aura on how far you can move and it puts a marker down where you moved from last. &nbsp;And it puts a bubble up next to the tracked token stating how much it moved.
Mine also announces the amount moved in chat. I am adding the marker for path moved and aura next. The problem I am having is that I use aura 2 right now for a intitiative tracker I found (it flashes an aura the players turn on initiatitive) and aura 1 I use for actual auras.
1370451230
Konrad J.
Pro
API Scripter
I'm actually using a marker for where the token was last and where it is now. &nbsp;The later marker I use the aura on so I don't have to change the tokens aura. &nbsp;One reason for this is then the aura doesn't move with the token so you can see how much you still have to move while you are moving the token. &nbsp;I like the bubble like a speech bubble I'm using. &nbsp;I've got a video of it working. &nbsp;It then all hides away off the map (-280,-280) so no one sees it or fiddles with it. &nbsp;Another bonus of the "speech" bubble is it doesn't clutter up the chat window. &nbsp;My next script will be to make speech bubbles appear whenever certain things happen with the chat. &nbsp;So you can make it look like different tokens are speaking right on the table top. &nbsp;Another thing I'd like to do is to track more than one token for movement at a time. &nbsp;RIght now because I have the extra markers and speech bubbles it only works on one token at a time. &nbsp;But it works really nicely! &nbsp;I also was thinking of adapting some Initiative order into the script so the token that is up next is the one that is getting their movement tracked automatically.
Yea, thats the problem I am facing now. Is there a function for calling who's turn it is now? The initiative tracker is not documented anywhere that I can see.
1370453932
Konrad J.
Pro
API Scripter
Ryan L did a script to highlight a token who's initiative it is. &nbsp;I was going to adapt his ideas. &nbsp;There is no easy way with a function yet. &nbsp;You gotta do it a little more manually. <a href="https://app.roll20.net/forum/post/148939/script-initiative-highlighter#post-149153" rel="nofollow">https://app.roll20.net/forum/post/148939/script-initiative-highlighter#post-149153</a>
Got it to work! All I need to do is then add a past movement token marker. Man it would be a lot better if you could just add and delete drawings, but I will make it work. Edit: here is the link to the code&nbsp; <a href="https://gist.github.com/DarokinB/5715738" rel="nofollow">https://gist.github.com/DarokinB/5715738</a> NOTE: I updated it to clear all aura2s on the player map so it does not get confusing! EDIT2: I hate that I keep editing but I keep finding problems! I realized that with the old, if you moved one diagnal, and then moved another as two separate moves, it counted each as 5, but we play the 3.5 rules so that means that we need to account for each second being 10. I have fixed it. Now, if the map is set to 3.5, then it counts every other diagonal as 10 ft.
1370458000
Konrad J.
Pro
API Scripter
I made mine simply count every diagonal as 1.5. &nbsp;That's the same as 1 then 2. &nbsp;So at the very end you just need a little code to figure out if they have a .5 left or not. &nbsp;Or you can count diagonals like you were doing. &nbsp;I need to add some code to make it work when there is no grid and when the scale is different (so the bubble text is still put the correct amount of pixels above and to the right of a token), but thats not hard. Since we can't create tokens it does make it harder, but I've got it so you just add three tokens and one text. &nbsp;Set their names and the text colour to predefined names and colour and the script finds everything. &nbsp;Then when you want it to work on another page you simply copy those four items to another page and they work without any setup. &nbsp;I like that when you aren't tracking everything hides itself off the map so its not in the way. I'll PM you mine if you like, I'd love for someone to give it some tests if they had time. &nbsp;Not ready to put it public just yet since its part of a collection of commands I'm working on (movement tracker, timer, no rotate, no move, noresize, auto defaults, timestamp, and logging to the chat window). &nbsp;Basically I need to document everything since there are lots of options for each command. :( &nbsp;I'm just a hobby programmer, don't do it for work, although I am in the computer business as a consultant and have always played with programming. Hey if you had time to help me with a problem I'm having I'd love to explain it to you, it involves trig and programming. :) &nbsp;I'm wanting to do some carwars scripts for doing maneuvers automatically. &nbsp;I've got straight forward at any angle and sideways at any angle, but I'm having trouble with rotating around a corner. &nbsp;I can explain why in more detail via a PM if you like. &nbsp;I'm sure I'll get it figured out in time, but I don't have time right now so I've put it aside since I hit a wall with it a while ago. &nbsp;It could be useful for other games as well since most wargames need rotating at the corners and not at the centre which Roll20 does. &nbsp;There are some other reasons why its hard to figure out mainly because of the way Roll20 defines the x,y and the angle. Anyways, back to work!
Not a problem. I took your idea of the tokens and hid them off screen. It worked great, though it's a little pain to move them from map to map (you can't easily copy things off map to paste them).&nbsp; For the diagonals, not all gaming systems use the "second is double" standard. In 4th edition, each diagonal is still 5 feet. It makes math nerds like me freak, but it is easier to use for sure. I wanted my code to take that into account. Now, it checks the setting of the map the players are on, and it uses that standard. I think at this point I have my script done. I will do a separate script post for people to look at and criticize. If you want to PM me I will happily look at yours.&nbsp; Thanks for all your help!
1370480982
Konrad J.
Pro
API Scripter
I made a special command just for that purpose, !fw track show. &nbsp;It simply puts all the special tokens needed at 280,280. &nbsp;That way the GM just copy/paste them and the script is working on another page. I had a look at yours, looks good! &nbsp;I was going to add up to ten markers as an upgrade. &nbsp;I need to also add the reset you have. You might want to simply use one of the marker tokens to do the aura and not the aura of the token that is moving. &nbsp;Two reasons why, first is then you don't screw up aura's already in place, but more importantly when the token moves the aura stays in place showing the user where the max movement is. &nbsp;Here is an examlpe of my script. <a href="http://www.youtube.com/watch?v=NEvt0JTRH7Y" rel="nofollow">http://www.youtube.com/watch?v=NEvt0JTRH7Y</a> It also automatically resizes the markers to the same size as the token being moved. I can't wait to do some more work on the script, but it will have to wait a week or two until I get a few major projects out of the way for clients.
Konrad Have you thought about adapting it to work with hexes too?
1370529426
Konrad J.
Pro
API Scripter
LochaberAxe said: Konrad Have you thought about adapting it to work with hexes too? I'll see what I can do when I get back to working on it.
Holy crap I love the idea of using the auras on the pins instead! I'll give it a shot.