Joe's Ugly Hacks 'Drop-in' macro libraries - v0.2.5 [alpha]

These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Joe's Ugly Hacks 'Drop-in' macro libraries - v0.2.5 [alpha]

Post by JoeDuncan »

UPDATED - Feb 20, 2022
======================

Hey everyone!

I had to move my YouTube channel to my personal gmail account because my work is cancelling our contract with gmail at the end of the year.

I figured I'd take the opportunity to update the videos as well, so the sound was not so low. The new video links are below. I've also added a standalone .zip with just the JUH 0.2.5a lib tokens, as well as a .zip file for assets needed for my new token animation tutorial videos (also in the video links below).

Cheers!

Intro
https://www.youtube.com/watch?v=sJ0Ahv0RfY8

Timers
https://www.youtube.com/watch?v=WIfi3k2S-i0

Local Sound
https://www.youtube.com/watch?v=PCwwGehRBXg

Ambient Sound
https://www.youtube.com/watch?v=ATacrEkbxuI

Background Animations
https://www.youtube.com/watch?v=VaZlfOnCK-o

Mouse Handling
https://www.youtube.com/watch?v=2OLI_LEuADg

Basic Events
https://www.youtube.com/watch?v=SdbiT-v59Ycc

Introduction to JUH Token Animation
https://www.youtube.com/watch?v=vQMWWY-CbAM

Token Image Flipping & Sound
https://www.youtube.com/watch?v=59AV42o6TG4


UPDATED - Feb 15, 2022
====================

Hey all, just wanted to give a short update and also a quick shout out to all my fans out there, thank you! My Youtube videos seem to be gaining traction: 347 views and 9 hours viewing time in the last 40 days! It seems interest in JUH is ramping up lately! :)

I'm more than happy to answer any feedback you have about it's use here (or in the "eventmanager_juh" Discord channel), so please let me know if you have any questions!

In other JUH news, I was *hoping* to release JUHa3 this past weekend, but "life finds a way" (I basically sat on my donkey doing nothing all weekend). This weekend I'm running a game session so won't have time to work on JUH much - but I do plan on releasing a video or two on how to use the JUH procedural animation system in the interim (probably Sunday evening) - so stay tuned!

JUHa3 should likely be released the first week of March (coding is all done, I'm just finishing the demo and docs).

Thanks again everyone! I really appreciate all the interest, and I hope I can build the polyfill features you all need/want!

JUH Roadmap
===========
JUHa4
-----
-investigate integration with BWEventEngine
-de-couple UI & remove Frame dependence
-further performance improvements
-address user requests & feedback

JUHb5
-----
-debug & polish JUHa4 into useable Beta

UPDATED - Dec 29, 2021
======================

JUH alpha 0.2.5 Release
-----------------------

Interim alpha release (files attached)! But first a quick note:

I've decided to try to conform more to the convention around here, and update the OP for new releases, rather than adding posts. I'm also moving the content and attachment from the JUH alpha 2 release post below this one.

Now, to JUH 0.2.5a!!!

Essentially, this is a "progress" release - it's JUH 0.2a, updated for Maptool 1.11.4 (and with a handful of fixes thrown in) but that's about it.

Short list of changes:
-JS, HTML and MTScript now almost completely separated using lib:// URIs
-all JS->MTScript communication now uses XMLHttpRequest calls
-JUH converted to Add-ons
-new build env to build Add-on and lib:token versions of JUH from same source
-callback autoregistration now scans Add-ons as well as lib:tokens
-overlay closing issue fixed

The 0.2.5a demo campaign is using the JUH lib:token build, and the Add-on build is attached in a standalone .zip. To test out the Add-ons, delete the JUH lib:tokens (other than lib:demo!) from the campaign and then add the Add-ons through the Maptool menu.

Small Caveat
------------------

I've set the demo to start when the campaign loads, but for some reason performance sucks if it starts in GM view. To get decent performance you have to stop the demo with "KILL ALL JUH FRAMES NOW!", switch to "View as player" and then re-start the demo with "Start Demo". In future releases I'll have it all off by default...

JUH Future Roadmap
------------------

My next step is to finish JUH alpha 3, which comprises 2 things:
-animated lighting optimization
-completed demo

Let me know what you guys think, all feedback is appreciated!


UPDATED Dec 20, 2021
====================
Spoiler
Hey everyone, I am back!

I died, but then I got better. Seriously though, I just got completely burnt out :( I had to take almost 2 months off (of pretty much everything), and then my AFF2e campaign was on hold for a couple of months, so I didn't think about Maptool much.

I have pretty much recovered from the burn out, and my campaign is up and running again, so I pulled the alpha 2 version of JUH that I was set to release out of mothballs and dusted it off. I had been planning on releasing it the night before I hit max-burnout, and all I had left to do was finish building the new demo - but then I found a bug in the lighting and figured I'd fix it and the demo the following day. But... the next day I completely tanked out, and literally couldn't even *think* of recreational coding for months :(

Regardless - I never finished the alpha 2 demo - and Maptool has made some cool new features I would like to incorporate, so rather than wasting time on the old alpha 2 demo - I am releasing the alpha 2 version of JUH that's been sitting on my drive for months "as is". All I've done since pulling it out of mothballs is cleanup some of the docs and make sure it still works properly with Maptool 1.8.5 (the version I still have on PC LOL).

I have not yet tested it with 1.11.2 (1.11.4?), so I make no guarantees in that regard (my next step is to make an updated release for the new Maptool though).

A short list of the (new) features in alpha 2:
-multi-token animations
-rotation and resize operations for token animations
-multithreading
-true timer based interval threading
-mouse events
-token events
-maptool client events
-custom events
-animated lighting

QuickStart
----------
-in Maptool, goto "Edit->Preferences->Application"
-in the "Save" panel, set your "File Sync Directory" to your maptool asset cache (usually <homedir>/.maptool-rptools/assetcache
-open JoesUglyHacks_0.2a.cmpgn
-with any luck, it should have loaded three windows (JUH Clock, JUH A/V Tranceiver and JUH Agenda) and started the background animations & sounds
-the JUH windows can be docked/minimized BUT MUST REMAIN OPEN FOR JUH TO FUNCTION!!!
-goto "View" and make sure "Show As Player" is selected


Caveats/Known Issues
--------------------
The main issue I've found is when using the JUH with an active server. To use JUH with an active server without issue - you MUST stop all JUH processing *before*: starting a server, disconnecting from a server (as a player) or stopping a server (as a GM). I'll explain.

For the JUH to run automatically, it must be launched from "onCampaignLoad". Maptool calls "onCampaignLoad" when the campaign is loaded, on the server when it's started, on each player's client when they join, and on the server when it is stopped. Additionally, whenever Maptool starts a server, stops a server or connects/disconnects a player from a server - IT CLOSES ALL THE OPEN OVERLAYS IN THE CLIENT WITHOUT TEMRINATING THEIR PROCESSING. Sadly, for the JUH, because we are using indefinite timers running in JS in the HTML overlays, this leaves processes running in an overlay that can no longer be accessed (by any means I have tried). The only solution is close and restart Maptool. So if you are a player, you MUST close all the JUH processes (with the big red KILL ALL button) before disconnecting from a server, or you will have to restart Maptool before reconnecting. Similarly, if you are running a game as a GM, you MUST close all the JUH processes before either starting, or stopping a server, or you will be left with unkillable processes in your Maptool and will be forced to close and restart it.

The animated lighting system is a bit of a hog at the moment (as I haven't yet optimized it) so it is turned off by default. If you want to try it, you can start the animated lights from the JUH A/V Tranceiver window. I will be optimizing the crap out of it in the future by moving most of it's processing to JS, at the moment it's mostly running in MTScript (which is the main bottle neck as it's single-threaded). If you want to try out the animated lighting, it can be started by the "Start Animated Lights" in the A/V Tranceiver, turn turn it off completely you need to clear the light manager process in the JUH Clock.

Lastly - the incomplete demo. This version of JUH has a second map, creatively titled "NotCampsite". It was going to be be called "TrollDisco" or something in the end, and it was primarily supposed to demo the events and animated lighting systems by having lights and music controlled by a set of "stereo button" objects. This is partially implemented on "NotCampsite" - there are 4 knobs originally intended to rotate some lights (but that's where I found my bug) which didn't quite work right, but you can click them and they should run some canned light animations. A fifth knob was going to be for volume etc... but I never got around to it. Anyways, you can see some of the lighting effects by switching to "NotCampsite", viewing "As Player" and starting the light manager.


Roadmap
-------
I will be continuing to support JUH (indefinitely as far as I am concerned - but I'm kind of scrapping my previous roadmap) and my immediate plans for JUH are:

-get JUH working with the new Maptool
-upgrade JUH to use MTXMLHttpRequest JS->MT calls
-convert JUH from a lib:token to an Add-On library
-release a final alpha build

Once I have a final updated alpha release for the new version of Maptool, I am going to focus primarily on bug fixes, usage issues and addressing feedback and requests, in order to produce a stable usable beta version.

I still plan on implementing features that were part of my old roadmap (key/value store, UI overlay widget system etc...) but I will implement them as added features at a later date.

Hope you guys enjoy this release, let me know what you think, what you like, what you don't, things you like to see in the future etc...
ORIGINAL POST
=============
Spoiler
Hi, I'm Joe.

Since this pandemic began over a year ago, I've been using Maptool to run an AFF (Advanced Fighting Fantasy) RPG campaign with a number of old friends remotely over the betweenwebs. Over that time, I've developed a number of macro "hacks" in order to implement features I wanted, like animated spells, local sound files and a true timer.

As a thank you to the Maptool community for providing such an awesome tool to help me deal with the global plague going on - I've packaged up all my hacks into a set of 'drop-in' Maptool macro libraries, and put them into a demo campaign to show the possibilities of using the "Joe's Ugly Hacks" libraries (JUH libs) for your own campaign.

Please enjoy this demo, and give me feedback if you can, it's still alpha and there's TONS of improvements to be made!

Here's a brief overview of the JUH libraries, and a TL;DR quickstart, the demo campaign containing the libs should be attached at the bottom.

(tried to post this in the Drop-in macro forum, but I didn't have permissions?)

Overview
========

What is it?
-----------
"Joe's Ugly Hacks" (JUH) is a set of macro libraries for Maptool that uses Javascript based timers in HTML5 frames to implement token animations, ambient audio and background animations. Additionally the JUH libraries also provide spatial audio clips (sound effects relative to distance of viewer) and a method of including audio assets locally in campaign files and repositories.


Features
--------
-procedural token animation system
-frame operations supported:
-set image
-move position
-set opacity
-trigger audio
-call token macro
==>trigger a *second* animation!
-animations can be different every time!
-Maptool player interaction while running multiple animations
-audio assets included in campaign files/repositories
-audio played locally, offline
-spatial audio: clip volume relative to player distance from source
-ambient audio: static audio loops volume attenuated by distance
-24fps background animations
-true timer implementation
-animated lighting (preview)


QuickStart
----------
-in Maptool, goto "Edit->Preferences->Application"
-in the "Save" panel, set your "File Sync Directory" to your maptool asset cache (usually <homedir>/.maptool-rptools/assetcache
-open JoesUglyHacks_0.1a.cmpgn
-with any luck, it should have loaded two windows (JUH Clock and JUH A/V Tranceiver) and started the background animations
-goto "View" and make sure "Show As Player" is selected
-select a player token, and either impersonate it or give yourself ownership of it
-you should hear sound playing now
-open the "Campaign" window
-try out the green buttons!


Basic Troubleshooting
---------------------
-make sure you have set your "file synchronisation directory" to point to your Maptool assetcache!
-make sure you are a GM, and are either impersonating, or own and have selected one of the player tokens (Player McZappy or Player McGoodie)
-make sure you have "Show as Player" selected (for instance the animated lighting preview only works from a player's perspective)
-both the JUH Clock and JUH A/V Tranceiver windows need to be open for the demo to work
-they can be started by clicking the "timerForm" macro on lib:timer


Caveats
-------
Please be aware this is an *ALPHA* release - it is what I considered *just* feature complete enough to share. I have not tested it extensively or on all platforms, and I know there's bugs in there somewhere.

Some possible "gotchas" I do know about:
-glitch in the stream sound loop (not seamless)
-rotation and positioning not implemented yet for token animations
-Maptool positions by top left, but rotates by center :(
-not tested with hex maps
-not tested on Apple computers
-background animations run centrally from the GM's client
-if there are two or more GMs they will all wind up running the same background animations, which will conflict
-in future releases it will be restricted by ownership as well
-token animation frames less than 100ms will make the system bog down (and then run super speed!)
-I am not an artist, the demo is just to show the capabilities, I know it is very "programmer art" - because I am a programmer!
-there's a couple of spots on the map where the sound seems to just "die"
-not sure why, could be a math bug or a weird VBL thing

What's Next for JUH?
-------------------
Things already partly finished for the beta:
-rotation and size frame operations for token animation
-multi-token animation
-animated lighting system
-custom event system
-onMapChange? easy!
-onMyTokenFellAndCantGetup? also easy!
Attachments
TokenAnim-FrameSound_assets.zip
(1.24 MiB) Downloaded 111 times
JoesUglyHacks-LibTokens_0.2.5a.zip
(228.03 KiB) Downloaded 133 times
JoesUglyHacks-AddOns_0.2.5a.zip
(119.6 KiB) Downloaded 128 times
JoesUglyHacks_0.2.5a.cmpgn
(11.33 MiB) Downloaded 153 times
JoesUglyHacks_0.2a.cmpgn
(11.28 MiB) Downloaded 49 times
JoesUglyHacks_0.1a.cmpgn
(8.93 MiB) Downloaded 98 times
Last edited by JoeDuncan on Sun Feb 20, 2022 11:49 pm, edited 8 times in total.
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by Full Bleed »

First, thanks for sharing this. Looking forward to checking it out. :)
JoeDuncan wrote:
Mon Apr 05, 2021 10:35 pm
-in Maptool, goto "Edit->Preferences->Application"
-in the "Save" panel, set your "File Sync Directory" to your maptool asset cache (usually <homedir>/.maptool-rptools/assetcache
Second, I'm unfamiliar with this setting and do not recall ever seeing it discussed.

Do you (or anyone reading this) know what this setting is actually doing and what potential impact it might have?
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by JoeDuncan »

The purpose of the "file sync directory" is to sync third party campaign assets between clients. It's an optional feature.

Please give it a shot and let me know what you think.
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by aliasmask »

I haven't seen any documentation on file sync either. I'm not sure file syncing your asset cache is a good idea, if I understand it correctly. Some of our asset caches have gigs of data and if the client has their own asset cache and a different file sync folder, then you're dumping a lot of data on them.

I'm still looking for a way to reference local assets like sound files that could be sync'd up with the clients rather than relying referencing online sources. Could this do the trick?

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by JoeDuncan »

Yes, this absolutely does the trick. It's one of the basic features.

The audio assets are already in the campaign file and are shared to the asset cache automatically.

The "file sync directory" is an optional feature that doesn't do anything unless you choose to use it. Nothing ever gets written to it by Maptool, it is read only.

Since the audio assets I am looking for are *already* in your asset folder, JUH just uses it to get the local file path to the audio so it can be played.

I could accomplish the exact same thing with like a "settings" token (or something) that you put your asset cache filepath in, but that would be SUPER clunky, and besides - accessing and reading shared assets is the entire purpose of the FSD! The only difference is I am using it to access Maptool shared assets and not third party shared assets.

I have tested this with multiple computers and clients and it works just fine.
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by JoeDuncan »

aliasmask wrote:
Tue Apr 06, 2021 8:24 pm
I'm not sure file syncing your asset cache is a good idea, if I understand it correctly. Some of our asset caches have gigs of data and if the client has their own asset cache and a different file sync folder, then you're dumping a lot of data on them.
To answer your concerns more directly: setting the "file sync directory" has no functional effect in Maptool. It DOES NOT cause all the clients to mirror each other's assets!!!

All it does is provide a way to get the file path so you can READ assets from macros that are normally shared with a third party tool. For instance if you had images you wanted to use, but didn't want to include them in the campaign file or repo (for whatever reason), you could share them with OneDrive or something, and then use the FSD setting to load those assets in your Macros.
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by JoeDuncan »

"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by wolph42 »

ok, that's frikkn cool, nicely done!

Note that I've already created soundpads, which appear to work similar to what you made. They've been thoroughly tested and work great. (check out hte BoT, link in sig). The animations though....awesome, it looks a bit clunky still, but awesome feature. Im curious how you did that!
Note btw that the spells dont clean up after themselves (so the images remain on screen until you cast a new one) at least this happens with the heal and lightning

edit: are you also on discord? link also in sig

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by JoeDuncan »

wolph42 wrote:
Wed Apr 07, 2021 5:49 am
Note btw that the spells dont clean up after themselves (so the images remain on screen until you cast a new one) at least this happens with the heal and lightning
That's because you haven't selected "show as player"! The GM can always see everything. Each player gets a local copy of the spell sprite. I guess I could move them off map after the spell, not to clutter up the GM screens, instead of just making them invisible to players.

Trust me, the effects will look a LOT better with "show as player", once you set that, try the "animated lighting preview"!
wolph42 wrote:
Wed Apr 07, 2021 5:49 am
edit: are you also on discord? link also in sig
No, sorry, don't do discord.
wolph42 wrote:
Wed Apr 07, 2021 5:49 am
Note that I've already created soundpads, which appear to work similar to what you made.
Yeah, I tried getting those to work, but it was just too complicated and it kept blowing up on me and I couldn't find any good docs (sorry, I just can't sit through youtube tutorials, give me a good "howto" anyday though). They did inspire me to make a simpler ambient sound system though!
wolph42 wrote:
Wed Apr 07, 2021 5:49 am
awesome, it looks a bit clunky still, but awesome feature. Im curious how you did that!
Well, it IS an alpha! Room for improvement for sure, take a look at the code, it's pretty straight forward. I was kind of surprised no one hade made a real timer before this...
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by wolph42 »

lighnting: I had player view on, but that does not mean it leaves clutter afterwards for the gm.

discord: you don't have to install it (its also webbased) and most user have moved to there, so if you want a more interactive community: discord. Note that its nearly only used as forum (so text, no speech).

soundpads: then I guess you're my age :D. I have EXACTLY the same issue, I do NOT like youtube tutorials and want text over vid anytime, mostly cause the information flow is forced upon you in a speed you can't control.
That said, the world moved on and nobody reads anymore so I after a while (and a LOT of nagging) I decided to quit the documentation and start doing vid tutorials.... the process however is REALLY simple (IF you have the BoT installed):

1. name the token "SoundPad wheteveryoulike"
2. select it and hit the setup soundpad macro
3. fill in form, make sure you the link to the sound file works over the internet
4. run 'initialize maps' macro.

so no, I can't say that its complicated. :D

timer: actually I've build timers in the past but it was never possible to do threading so didn't came far with those. I've also did JS but MT wasn't ready at the time, now the two come together but I don't have the interest to pick those up again...

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by JoeDuncan »

wolph42 wrote:
Wed Apr 07, 2021 9:29 am
lighnting: I had player view on, but that does not mean it leaves clutter afterwards for the gm.
I'm not sure what you mean? I know it definitely DOES leave clutter for the GM, but it should look fine with "show as player" - the tokens should go invisible after the spell. It IS kind of messy for the GM though, so I'll make it so the spell sprites get moved off screen after.
wolph42 wrote:
Wed Apr 07, 2021 9:29 am
discord: you don't have to install it (its also webbased) and most user have moved to there, so if you want a more interactive community: discord. Note that its nearly only used as forum (so text, no speech).
Yeah... still, I just can't stand live chat :( If I'd ever had that inclination, I'd be an IRC god by now. No thanks.
wolph42 wrote:
Wed Apr 07, 2021 9:29 am
soundpads: then I guess you're my age . I have EXACTLY the same issue, I do NOT like youtube tutorials and want text over vid anytime, mostly cause the information flow is forced upon you in a speed you can't control.
Dude! Are you reading my mind?!? Still, I'm not going that route. All my docs will be clear and precisely written howtos. Someone else wants to make a video tutorial - more power to 'em. I'd rather listen to a five year old recite the plot of a movie.
wolph42 wrote:
Wed Apr 07, 2021 9:29 am
so no, I can't say that its complicated.
Probably not your fault. Most of the issues I had were getting the remote sources defined, hooked up and working properly, I got so fed with the remote audio crap I solved aliasmask's problem for him as basically my first act of building JUH. All my sound files are local. The JUH process is:

1. Drop an mp3/wav on the map
2. set it's state to "isAmbientAudio"
3. Add the property string "minDist=10;baseVol=0.9" to it's GM notes

That's it. No fussing with internet sources!
wolph42 wrote:
Wed Apr 07, 2021 9:29 am
timer: actually I've build timers in the past but it was never possible to do threading so didn't came far with those. I've also did JS but MT wasn't ready at the time, now the two come together but I don't have the interest to pick those up again...
The trick is the timer is written in JS and uses the native JS timing methods (I've created macro proxies of setTimeout and setInterval in lib:timer)
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by JoeDuncan »

wolph42 wrote:
Wed Apr 07, 2021 5:49 am
ok, that's frikkn cool, nicely done!
Thanks, BTW. I consider this high praise coming from you. Did you catch your shout out in the JUH credits?
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by wolph42 »

JoeDuncan wrote:
Wed Apr 07, 2021 10:08 am
wolph42 wrote:
Wed Apr 07, 2021 5:49 am
ok, that's frikkn cool, nicely done!
Thanks, BTW. I consider this high praise coming from you. Did you catch your shout out in the JUH credits?
i hadnt, but have now, thnx!
1. Drop an mp3/wav on the map
2. set it's state to "isAmbientAudio"
3. Add the property string "minDist=10;baseVol=0.9" to it's GM notes
urgh, you beat me with one step :wink:

couple of things, after looking at the code: really clean and understandable cudo's!! I was wondering though why you don't use userdefined functions, some functions uses make much more sense that way and further clean up your code. Also not sure you know this, but if you use h: option then ALL nested routines are automatically hidden, so you don't need to add the h: to the nestngs as well.

And finally:
[h: "<!-- ================================== -->"]
[h: "<!-- The function takes an audio token name (e.g. audio:fire) -->"]
[h: "<!-- gets its asset id (e.g. asset://<blobMD5>), combines that-->"]
[h: "<!-- with the file sync directory (fsd) to create a file: URI that -->"]
[h: "<!-- maptool can use to play the audio directly from the asset -->"]
[h: "<!-- cache. -->"]
how the flying fk did yo figure that one out?!?

o and before i forget I couldn't find an ontokenmove, so what exactly do you use as a handler for the ambient sound?

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by JoeDuncan »

wolph42 wrote:
Thu Apr 08, 2021 2:56 am
o and before i forget I couldn't find an ontokenmove, so what exactly do you use as a handler for the ambient sound?
It's timer based. (see "startSoundManager@lib:media")

I run a half-second interval (1/3 in the newer version) callback, which receives the list of enabled ambient sounds for the map from the AV Tranceiver. Each client then checks if their player's perspective token is in range of any ambient sounds, and then turns them on/off or adjusts the volume.
Last edited by JoeDuncan on Thu Apr 08, 2021 9:53 am, edited 1 time in total.
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Joe's Ugly Hacks 'Drop-in' macro libraries - v0.1 [alpha]

Post by Full Bleed »

JoeDuncan wrote:
Wed Apr 07, 2021 9:58 am
wolph42 wrote:
Wed Apr 07, 2021 9:29 am
discord: you don't have to install it (its also webbased) and most user have moved to there, so if you want a more interactive community: discord. Note that its nearly only used as forum (so text, no speech).
Yeah... still, I just can't stand live chat :( If I'd ever had that inclination, I'd be an IRC god by now. No thanks.
I know I haven't made the move to discord either because it seems to me that despite how nice quicker feedback and discussions might flow (sometimes), the loss of a quality record of said discussions and the loss (potentially) of greater community participation and consumption isn't worth it. I just can't see how a live chat/teamwork app can replace the functionality of a forum and I suspect a lot of good info is being lost in the shift to it (like the release announcement of 1.8.4).

I don't have a hate-on for discord so much as I think it's a poor forum substitute.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Post Reply

Return to “Drop-In Macro Resources”