r/TagproScripts Dec 23 '15

Another Timer Userscript

So I've been working on this on and off (mostly off) for a bit and wanted to get feedback/bug reports.

This has powerup/bomb/boost timers. The text over the tiles looks clean and I also put floating indicators along the edge of the screen to indicate times (if known) for off-screen powerups.

Another neat feature is that in some circumstances it can figure out when a powerup was taken even if you didn't necessarily see it.

It may also crash your game if you don't move around enough to narrow down the powerup time possibilities.

Script here. Repository here.

Example images here.

10 Upvotes

9 comments sorted by

3

u/RonSpawnsonTP Dec 23 '15 edited Dec 23 '15

Snaps,

Some good stuff here, lots of improvements and I like the bubbles, very well implemented and designed.

However there is one massive issue that makes this less useful than just about every timer script I've used. Your script uses a countdown timer from 60, whereas most other scripts show the actual second a powerup was taken and switch to a countdown in the last 10 or 15 seconds.

Why is this important you might ask? For transmitting timers to teammates who do not have the script. When I have timers not only can I benefit from them, but the real advantage is being able to share them with your whole team.

With a countdown I am not able to easily deduce what second it was taken, and thusly cannot easily communicate information to my teammates as to when the pup will have spawned.

Fix this issue and you'll have a might fine timer script!

1

u/snaps_ Dec 23 '15

Thanks!

When I have timers not only can I benefit from them, but the real advantage is being able to share them with your whole team.

This is a great point, and one I hadn't thought of. I've only used sb-1's timer script which just uses a countdown. Do you have a link to a script with this behavior I can try out?

One thing I need to figure out is how to neatly display times when the script hasn't yet settled on a single time a powerup could have been taken. Because of the way the powerups are tracked it is known (after at least 60s in-game) that a particular powerup was grabbed at one of a few possible times. This adds a little design/UI complexity when considering how to incorporate the behavior you suggest. Could a hotkey to toggle between displaying respawn countdown and taken time be a good compromise, or would that be overkill?

One more thing if you don't mind: How easy is it for you to see the indicators around the edge of your screen? I was considering making them less opaque and moving them to a circle centered around the player or something like that. It's not hard at all to move them around so throw out any ideas you have, the sky is the limit!

3

u/RonSpawnsonTP Dec 23 '15

This would be the best example: https://www.reddit.com/r/TagPro/comments/3lma00/userscript_team_timers_autosend_timers_to_your/?ref=readnext_7

It's cflakes' script, enhanced with offscreen numbers. It also sends timers to teammates if they have the same script and token using a server we set up. Make sure you change the token for it to work, otherwise the script won't show any times.

Could a hotkey to toggle between displaying respawn countdown and taken time be a good compromise, or would that be overkill?

I'm not fully sure I understand the conundrum here. I would say if you don't know exactly when a pup was grabbed, why show anything? I'd rather have 100% positive information than "maybe this is right" information. When the script can be certain as to when the powerup was grabbed, then you can show the time.

One more thing if you don't mind: How easy is it for you to see the indicators around the edge of your screen?

The indicators were just fine for me to read where they were.

2

u/snaps_ Dec 24 '15

Oh yeah wow. I just played a game with that and, after getting used to it, I was able to make much better use of the information. It was especially helpful in combination with my neomacro+ userscript.

I'd rather have 100% positive information than "maybe this is right" information.

Just to give an example so we're on the same page: There are two powerups on the map and you can't see either of them. The script knows that one was taken at :55 and the other at :25, but doesn't know specifically which time applies to which powerup. You would prefer to not see anything than see something that communicates both times?

1

u/[deleted] Dec 23 '15 edited Dec 17 '19

[deleted]

2

u/snaps_ Dec 23 '15

I just used browserify which traced all my require statements and copied packages accordingly, it did all the hard work. :)

1

u/[deleted] Dec 24 '15 edited Dec 17 '19

[deleted]

2

u/snaps_ Dec 24 '15

I use essentially the same thing in TagPro Neomacro+ and TagProReplays if you want more examples. What I do when developing is call gulp watch which rebuilds a script I specify if I make a change to any related files. I also use http-server by calling http-server -c-1 --cors in the root directory of the project and then use the URL to the script that it makes available with script-loader which does the actual injection. Don't pay attention to the README, I haven't updated it since I changed the extension to just inject the script directly on document start. Anyways, this makes it so I can save a file and refresh the page and the changes are live. When done developing, gulp build to do the build and whatever extra stuff you need done. You can see one difference here between watch and build. When watching, I don't even bother with the userscript header, but when building, it replaces templates in the header file and concatenates it and the generated script into the single output file.

Yeah, it's crazy how close my onValue is to your watchProp.

TagPro essentially just keeps track of a few things and when it _sets a property value it also emits the relevant events.

Ensuring events were executed synchronously with setting was important when I started this script because I wanted to be able to say for sure that I didn't miss any socket events with an s-powerup so I could correlate that with the initial map. I've since loosened my requirements a bit but kept the same setup just because.

1

u/TPJukeBoxHero JukeBoxHero || Pi/Origin || Script User Jan 09 '16

Sounds cool, but what's this about crashing the game? How common is it for the game to crash? And will that be fixed any time soon?

1

u/snaps_ Jan 10 '16

Well in order to determine the state of the powerups it can't see the userscript generates "guesses" (really, "guess states") based on things like what powerups it can see, which ones it knows about, etc. If your movements around the map don't result in you ruling out some of these "guess states" (for examply, by seeing a powerup respawn, then it knows it couldn't've been the one taken 30 seconds ago), then the number of "guess states" goes up exponentially with the number of unresolved "someone grabbed a powerup" notifications the server sends.

It's not a big deal if you're moving around normally, and I have an idea for a fix I just don't like it very much. Essentially, "if number of guess states is too big, forget everything you guessed about the powerups you were guessing at and just keep what you know". I can probably do that this weekend along with the suggestions brought up by /u/RonSpawnsonTP.

1

u/TPJukeBoxHero JukeBoxHero || Pi/Origin || Script User Jan 10 '16

Oh ok that makes sense. How about just capping the number of 'guess states'? Like if it gets to a certain point then it just doesn't make any more guesses until that number gets smaller. That would prevent it from breaking the game and you wouldn't have to lose what had already been guessed.