Trigger Happy (Teleportation Tutorial)

Could you send a screenshot of your Trigger Happy?
I am not quite sure what could be up.

image

It’s the bottom trigger.


Once the token steps on the trigger token, it posts this in the chat and nothing else happens.
image

I have all the needed modules as outlined. Is there a non-standard setting I’m missing that I need to turn on?

1 Like

It seems it can’t connect to the token. Either the token is not connected properly (check if the token’s “Link Actor Data” is on.)

Otherwise, it seems the Macro isn’t properly executed. Make sure You have Dynamic Active effects if you’re on 0.7.9.

If it isn’t that, make sure advanced macros are enabled.
image

If none of this works, I would like you to press f12 and screenshot the “console” section. It should come an error when you walk onto the teleporter.

This is a great tutorial. I got everything working without any issues. One question - Is it possible to set up Trigger Happy based on a specific token? I have 3 characters, and depending on which one clicks, I want them to go to a different room. I can’t seem to work out the Trigger Happy syntax for that. Thanks!

Hello!
Easily. Just make sure the Token isn’t Linked to the actor. Go to the character → Token, to change this.

image

Now you can place the token out on the field.
Double right click the token. This will bring up the Token Menu once again.
Rename the token to something you would like (without spaces).

In Trigger Happy you would do @Token[NAME-THAT-YOU-CHOSE]. Should work the same as character now :smiley:

Hey Kevin,
I love the guide and find it really easy to follow. Good work!
Even though it’s all clearly stated it seems I must have messed up somewhere, as I have pretty much the same issue as rundagger - the only difference being it works neither for teleportation from one scene to the other nor in the same scene. Maybe you could be so kind and point me in a new direction for fixing this? :slight_smile:

For prosperity this is the setup at the moment (Forge 0.8.6):

2021-06-07 17_15_21-Window
2021-06-07 17_20_48-Window
2021-06-07 17_22_37-Window
2021-06-07 17_22_54-Window


Edit: I made sure to log in as a player in a second tab, while the other was logged in as GM. It was the same account though, not sure if that is relevant.
I’ve tested it using both “capture move” and “move” in the Trigger Happy journal.

Hello!
This tutorial isn’t for 0.8.6 yet (Sorry I’ve had a lot to do :smiley: )
In 0.8.6, the Furnace module is lost, please update to Advanced Macros. This should update your issue and hopefully will not cause more issues :smiley:

EDIT
You had advanced macros. I’ll look further into it.
It says you have an error (red X top right) Could you show me what that is?

I personally haven’t updated to 0.8.6 so I haven’t encountered any issues yet. As I am the module guru and use 150 modules, it will be hard to update :wink: For now at least. I’ll try to update the tutorial by next week. Hope it helps and if you run into any issues I’ll try to resolve them with you.

Thank you for all the information though! If all my troubleshooting’s gave me all of this :wink:

Alright, I found the issue.
Advanced macros doesn’t currently work by the looks of it :frowning:

It’s the least I can do, when asking others for help! :smile:

Thanks a lot!
I’ve learned my lesson about updating in reckless abandon. :sweat_smile:

Good news though, I checked the Advanced Macros git and it says that issue was fixed!

I wanted to throw some info in for 0.8.6 users as I spent quite a few hours figuring this out. You no longer need The Furnace, but will need to install Advanced Macros.

I don’t know what the purpose is of passing the 0 0 arguments to the macro, so I changed my macro to just: DAE.teleportToToken(token, args[0], 0, 0); And left the zeroes off of the Journal entry. You can leave existing journal entries as is without any issues, but future ones don’t seem to need it as far as I can tell.

The issue with 0.8.6 is DAE’s teleportToToken passes arguments to its Teleport macro, and is referencing a coordinate that Foundry changed where it is stored. The error that pops up for me is dae| teleport: Invalid co-ords NaN NaN. I imagine the DAE module maker will fix it, but I came up with a suitable workaround until that happens.

Bugs: First, two characters entering the teleporter at the same time messes up it, which is the same as in .7. Secondly if you rapidly click on and off a token after teleporting it seems to sometimes mess up? Not sure why, but its unlikely your players will do this unless trying.

First under your dae\module folder, backup the old GMAction.js file. We are going to just copy that over to the updated version. I did not bother to look and find out what changed, so just go get the 0.7 version!!

Nex tupdate Foundry to 0.8.6, update 5e itself, and update all modules. Then activate them all, disable any that no longer work etc… Setup the teleporters like Kevin above says.

Next, in dae\module rename the GMaction.js file (so you can get it back if necessary) to GMactionbkp.js, and copy your old version here.

Lastly, under the dae\module\ folder there is the daeMacros.js file. Open this in notepad, and find the line with: export let teleportToToken. Scroll down a bit and the last line says “return teleport(token, …)”. This is the line that has the mistake. Where it says “target.token.x” it needs to be “target.token.data.x”. The entire line needs to be replaced with:

return teleport(token, target.scene, target.token.data.x + xGridOffset * target.scene.data.grid, target.token.data.y + yGridOffset * canvas.scene.data.grid);

This worked for me with all my existing teleporters, I recommend backing up your DAE folder encase it updates and breaks the fix. Hope that helps!

Sorry, most of your steps were unnecessary to me. I’ve just modified these as you said:

You no longer need The Furnace, but will need to install Advanced Macros .

Lastly, under the dae\module\ folder there is the daeMacros.js file. Open this in notepad, and find the line with: export let teleportToToken . Scroll down a bit and the last line says “ return teleport(token, …) ”. This is the line that has the mistake. Where it says “target.token.x” it needs to be “target.token.data.x”. The entire line needs to be replaced with:

return teleport(token, target.scene, target.token.data.x + xGridOffset * target.scene.data.grid, target.token.data.y + yGridOffset * canvas.scene.data.grid);

I’ve tried almost everything above and I’ve still not managed to get teleportation to work. Thanks to those that posted solutions, though. Unfortunately they just didn’t work for me. I might need to wait for an update since I started on the newest version of Foundry so I don’t have anything else to fall back on.

As it stood, Trigger Happy seemed to run everything except the macro itself since it kept displaying the last as a chat message quite literally. Like the macro just wasn’t running. I’m nowhere near savvy enough to begin to pick that whole thing apart, but I thought I’d at least mention that much.

To get my old teleporters to work I had to make the changes as mentioned above, but also change the following lines, since the code that deleted the old token didn’t work anymore:

modules/dae/module/GMActions.js (line 224 - 236)

let deleteToken = async (userId, data) => {
//@ts-ignore
let scenes = game.scenes;
let startScene = scenes.get(data.startSceneId);
//@ts-ignore
await startScene.deleteEmbeddedDocuments(“Token”, [data.tokenData._id]);
};
export async function createToken(userId, data) {
//@ts-ignore
let scenes = game.scenes;
let targetScene = scenes.get(data.targetSceneId);
return await targetScene.createEmbeddedDocuments(‘Token’, [mergeObject(duplicate(data.tokenData), { “x”: data.x, “y”: data.y, hidden: false }, { overwrite: true, inplace: true })]);
}

1 Like

any updates with this ive tried few things the

return teleport(token, target.scene, target.token.data.x + xGridOffset * target.scene.data.grid, target.token.data.y + yGridOffset * canvas.scene.data.grid);

Partially worked but just ended up making clones of token in end and keeping the OG

Try the solution by @philip_niewold this seems to remove this behaviour.

Updated the tutorial, notified the creator about the current issue.

Hi Kevin, I had originally followed your tutorial on 0.7.10, mainly for just transportation and everything worked great (also, fantastic work on the tutorial). Like some of the others that have been commenting recently, I’ve been having trouble with it all after updating to core 0.8.8. I do have a backup of my 0.7.10 so reverting is always an option, but I figured I’d report some of the issues I’ve been seeing as well on 0.8.8. I’ve tried some of the above solutions and haven’t seen been able to see stable results like back on 0.7.10. The below cases are on a fresh install of 0.8.8 and with the appropriate modules in your tutorial for 0.8.* installed.

Tokens/actors transporting within different parts of the same scene seem to have no issue whether I (as the GM) move them onto triggers, or the players do (tested with a “test” player and actor on a separate tab). The issues I’ve observed come from when Actors are meant to be transported to different scenes.

I’ve observed 2 main cases:

  1. When a PLAYER moves their actor onto a token and it triggers to take them to a new scene, they get a log message stating “they do not own a token with any vision in this scene” but they are still able to move the actor and everything and see normally. If I move their token around as GM on the foundry client afterwards, it also seems to be an acceptable state.

  2. If I as the GM take any actor and move it to a token to trigger transportation within the same scene, everything is fine. If I as the GM take any actor and move it to a token to trigger transportation to a different scene, then I get the message pictured below. It also repeats whenever I try to move the same actor either as the respective player, or as a GM. I’ve also tried to include the logs to the right. If anyone has any insight or further ideas, I’d appreciate any help…

EDIT: Just for clarification, both a tab on browser for the player, and the Foundry Client (as the GM) were up at the same time.

Hi Kevin, I setup everything per the instructions (thanks btw), and installed all mods as indicated. However, the teleportation isn’t working for me at all, not even within the same scene. All I get is a chat message with the wording from the @ChatMessage portion, instead of having the macro activate. Am I missing something in the setup?

Edit: Nevermind! It seems my Advanced Macros module was out of date.

Glad you found the issue! Good job and glad both my tutorials are doing their Job! Enjoy your traps and teleportation :smiley:

If you need anything else I’ll try my best to answer :wink:

1 Like

Hi Kevin, first off many many thanks for this tutorial and for being so helpful with people asking questions. I was able to get the basic teleportation working for the most part, but I’m having trouble with the Random Room Teleporter.

I’m on Foundry 0.8.9, 5e 1.5.5, and I have Advanced Macros 1.12, Dynamic effects using Active Effects 0.8.70, and Trigger Happy 0.8.20, along with the dependencies (I think).

The trouble I’m running into is that every time the token steps onto the teleport token, it just puts “/RandomMap” into chat instead of executing the macro. If I go to the macro and activate it manually, “There was an error in your macro syntax” pops up.

I set up a test after my initial attempts at the exact wording you have in the tutorial and still having the same issue. I also tried changing the start of the RandomMap macro to DAE instead of DynamicEffects, to no avail. I have some screenshots below of everything I think is relevant, but am happy to send more screenshots if helpful.

And again, thanks very much in advance for your time and energy!

Screen Shot 2021-12-04 at 11.40.26 AM
Screen Shot 2021-12-04 at 12.01.36 PM
Screen Shot 2021-12-04 at 11.40.42 AM
Screen Shot 2021-12-04 at 11.48.50 AM


Screen Shot 2021-12-04 at 11.50.17 AM
Screen Shot 2021-12-04 at 12.06.33 PM