Thanks so much for this awesome module! I have been trying to figure out a way to activate a terminal when clicked rather than when a token enters the tile. Is this possible?
There sure is, Terminal includes macros that can do this for you. This does require the use of Monk’s Active Tile Triggers as there currently is no way to supply arguments to macros in Foundry
I’ve written up a guide that can walk you through how to run the included macros here
Idea: Would it be possible to get it to handle more than one secure shell? I'm thinking like doors. That way we could make it network and have like terminal-dungeons. :D
The simplest is to chain the Terminals together. So, each Terminal can Secure Shell to the next one.
The more complicated way requires some scripting but I’ll walk you through it. This way also requires using Foundry V12+, since it uses Regions. This will create a one-to-many relationship of Terminals. You’ll need to create a new Region. Keep the Region in an area players can’t get to, it will only be used for scripting. Then create a “Run Script” Behavior. For an example see the screenshot below. I created 2 Run Script Behaviors and renamed them to “Open Terminal 1” and “Open Terminal 2”. I have the code later which you’ll want to enter for each Behavior.
You’ll want to have each of your behaviors use a separate “Subscribed Event”. For mine I used “Token Enters” & “Token Exits”.
Now we need to link these Event Behaviors to the parent Terminal. Open the tile config for your main Terminal tile. Then open the Trigger Regions window (see screenshot below of the opened window). Add the new Region. You’ll want to add it multiple times (since I’m only linking two Terminals, I’ll add that same Region twice).
Then to finish the link, we need to edit the “Simulated Event” field to match, one to one, with those Behaviors we created. So, for me that’s the “Token Enters” & “Token Exits” events.
I know this gets a pretty complicated and likely confusing. Try and match what I have in the screenshots as best you can to just get it working.
What this does is every Region that’s added here will become a button in the main Terminal. The button will simulate your chosen Region event. This trigger all Behaviors that are subscribed to that event (in our case it’s one-to-one). Since the Behaviors are script Behaviors this runs the code you have in the Run Script field.
Now, that everything is linked let’s go back to your “Run Script” Behavior. You need to actually define the code to run. Copy this code into a notepad:
const TILE_UUID = "PUT_YOUR_TARGET_TILE_UUID_HERE"
const terminalOpen = Array.from(foundry.applications.instances.values()).find(a =>
TILE_UUID === a.context?.tuid
)
if (!terminalOpen) {
new Terminal(TILE_UUID).render(true)
}
Replace the TILE_UUID variable with any one of the target child Terminal’s UUID. Then enter your edited code into the Behavior’s Script field. That finishes one Behavior’s “Run Script” but we have multiple. For each child Terminal you want to link, update the TILE_UUID each time and paste your code into a different “Run Script” Behavior.
That should be it. There are only a few extra considerations. This bypasses validation on your Terminal settings. This bypasses the initial Item and Skill checks (password should still work).
Eventually I’m sure Foundry will support running Macros with arguments from Regions and this will be simpler but that isn’t happening anytime soon.
Love the mod! Love it to bits. One problem with latest update though. If one demands a password to log in, the window gets borked. I will provide an image. This is regardless of style or theme. (Seems to work still with Alien Wayland, but afaik that's the only one)
Fixed it right up! Thanks a ton for the fast reply. Campaign starts on sunday. <3 Got this error when I updated the mod, don't know if it's a biggie, since the mod works.
Hey I reached out on discord because of an issue I am having. I cannot get the select journal dialogue to open when I try linking the terminal tile to a journal
I just wanted to say, this is exactly what I was looking for. I've been struggling to find a terminal type asset that was customizable and I'm not a programmer by any means, this has taken care of all of that. Thank you, thank you, thank you!
Would the splash screen be able to also display images (whether in ascii art or just normal)? or allow for custom animations/designs to be imported into it?
I could see this working like a book/dream/vision for the player and they will see the title of the book, or have some neat image/animation for the splash screen (when dream/vision) then the information will be presented to them.
That would allow for more system agnostic setup as well, and allow for some fun roleplay and information gathering or backstory reveals, etc.
The modules supports a large amount of customization. These are some of the things already in the module:
You can set the background to an image or video
you can define your own ASCII for the splash
you can define the colors for most things
you can set your own border for the window.
the audio for click, login, logout and ambient can be set
With these you should be able to get a theme close to what your describing.
I could put it on my list of things to look into for specifically defining a splash video. Which is only shown on startup and then would change to the standard background in use now.
I have added a splash media setting that you can find on the style form. It has two “modes”.
If you upload a video it will replace the loading bar and ASCII entirely
If you upload an image it will use that as a background while keeping the standard ASCII and loading bar
I still need to add more layouts, text animation, and default styles but it’s getting there.
EDIT (4 months later update): this behavior is NO LONGER TRUE as of 3.1.6+ (October 2024). Showing the ASCII art + Loading bar is now its own configurable setting in the style editor. Regardless of the file type used for the splash.
I wonder if you could shed some light on a little problem I'm having. I'm trying to set up a terminal with a macro button that switches the enabled status of two other terminals sharing the same space, one for "power offline" and the other for "power restored". So the Generator terminal would execute something like
canvas.tiles.get("id of tile").document.flags.terminal.enabled = true/false
to turn on one and disable the other. And this works, but only so long as a token remains on the generator terminal. I can't seem to make the change stick once the token moves off.
Hey, with your advice and a *little* help from the foundry discord I got it working to the point where I can even switch on a terminal in another scene:
const tile1 = game.scenes.get("other scene ID").tiles.get("tile ID");
Yes, when configuring the Terminal inside the Tile config. There will be a checkbox to add a button for any user that views the Terminal UI. This button when clicked will explore all the Fog of War for the current scene for all connected players.
Let me know if you have another other questions 🙂
As a warning if you like to stay on the latest Foundry version I have yet to find a way to make this feature work on the unreleased version 12 (Which won’t come out for another couple months). I reached out the Foundry devs but it doesn’t seem like they are going to help me find a solution to it. There are APIs I can hook into but they get complicated very fast.
So, just something to be aware of. This feature may only be here for a year if you stay on latest Foundry.
Thank you for the answer! I hope you'll find a way to port the feature over to v12, as while it may be a while before i update to that (i'm the kind of guy who will update to v12 once v13 is around the corner basically), i will eventually do it at some point.. Hopefully the devs or someone else will be able to point you to the right direction!
This is great news! Do you have any plans for new features to add maybe? i was thinking the other day it would be fun to have a foundry module that could provide some "hacking minigame" for the players to resolve, such as the ones that you can see in Alien Isolation, but i have no idea how feasible that would be lol
I have a couple things brewing for new features. The three certain ones are related to cameras, passwords/keycards and lights.
I’m implementing/taking some ideas from Starfinder. Which I’ve never played but find their mechanics around terminals to be interesting. This includes things like: lockouts, alarms, data wipes, encrypted pages, accessing other computers from your current one.
I’m going to be spending some time to see what is feasible from these ideas.
As far as puzzles or minigames I’m a bit torn because that is a great idea. Even one I listed as a stretch goal on my github page for this.
However, it runs into a problem I haven’t really thought of a solution for. It steps on whatever game system’s solution for accessing computers is. I don’t know a good solution around this, which has halted my progress on that.
You can go to the setup screen of your Foundry instance. Go to the Add-on Modules tab. Click install modules button. Search “Monk’s active tile triggers”. Click install button.
Then in a world as a GM activate the module on the settings sidebar.
You can now place a tile and a new tab will be shown in the tile config. It’s called triggers and there are numerous settings for how things can be configured at that point.
I see what you mean. Well there wasn’t until today. I’ve pushed a 1.3.3 version that can support this.
I am now exporting an instance of Terminal to the window. That means it can be opened with a macro and triggered with that by Monk’s Active Tiles.
This is a bit experimental since it loses a few features this way compared to having your players just walk onto the Terminal tile, so proceed with caution.
~~So, here is what you’ll need to do. You should create a macro and give it this contents (replacing the journal and tile ID)
Then add a trigger onto whatever tile your using to run the macro and it should open it. Keep in mind this macro must be ran by whoever you intend to have see the Terminal. It only opens up for the client that triggered the macro.~~
EDIT: I now have a supported macro which comes in an included module Compendium. For steps on how to use that. Read through the rest of the thread
← Return to module
Comments
Log in with itch.io to leave a comment.
Thanks so much for this awesome module! I have been trying to figure out a way to activate a terminal when clicked rather than when a token enters the tile. Is this possible?
There sure is, Terminal includes macros that can do this for you. This does require the use of Monk’s Active Tile Triggers as there currently is no way to supply arguments to macros in Foundry
I’ve written up a guide that can walk you through how to run the included macros here
Idea: Would it be possible to get it to handle more than one secure shell? I'm thinking like doors. That way we could make it network and have like terminal-dungeons. :D
You could do this in one of two ways.
The simplest is to chain the Terminals together. So, each Terminal can Secure Shell to the next one.
The more complicated way requires some scripting but I’ll walk you through it. This way also requires using Foundry V12+, since it uses Regions. This will create a one-to-many relationship of Terminals. You’ll need to create a new Region. Keep the Region in an area players can’t get to, it will only be used for scripting. Then create a “Run Script” Behavior. For an example see the screenshot below. I created 2 Run Script Behaviors and renamed them to “Open Terminal 1” and “Open Terminal 2”. I have the code later which you’ll want to enter for each Behavior.
You’ll want to have each of your behaviors use a separate “Subscribed Event”. For mine I used “Token Enters” & “Token Exits”.
Now we need to link these Event Behaviors to the parent Terminal. Open the tile config for your main Terminal tile. Then open the Trigger Regions window (see screenshot below of the opened window). Add the new Region. You’ll want to add it multiple times (since I’m only linking two Terminals, I’ll add that same Region twice).
Then to finish the link, we need to edit the “Simulated Event” field to match, one to one, with those Behaviors we created. So, for me that’s the “Token Enters” & “Token Exits” events.
Now, that everything is linked let’s go back to your “Run Script” Behavior. You need to actually define the code to run. Copy this code into a notepad:
Replace the TILE_UUID variable with any one of the target child Terminal’s UUID. Then enter your edited code into the Behavior’s Script field. That finishes one Behavior’s “Run Script” but we have multiple. For each child Terminal you want to link, update the TILE_UUID each time and paste your code into a different “Run Script” Behavior.
That should be it. There are only a few extra considerations. This bypasses validation on your Terminal settings. This bypasses the initial Item and Skill checks (password should still work).
Eventually I’m sure Foundry will support running Macros with arguments from Regions and this will be simpler but that isn’t happening anytime soon.
Love the mod! Love it to bits. One problem with latest update though.
If one demands a password to log in, the window gets borked. I will provide an image.
This is regardless of style or theme. (Seems to work still with Alien Wayland, but afaik that's the only one)
Looking into this!
EDIT: should be fixed now in v3.1.7 thanks for the report
Fixed it right up! Thanks a ton for the fast reply. Campaign starts on sunday. <3
Got this error when I updated the mod, don't know if it's a biggie, since the mod works.
Nice, no rush on this but if you have a GitHub account can you open up an issue here. That way we can get all the details.
Hey I reached out on discord because of an issue I am having. I cannot get the select journal dialogue to open when I try linking the terminal tile to a journal
I changed the way journal linking works. You’ll need to click the journal in the sidebar.
I just wanted to say, this is exactly what I was looking for. I've been struggling to find a terminal type asset that was customizable and I'm not a programmer by any means, this has taken care of all of that. Thank you, thank you, thank you!
😎
Would the splash screen be able to also display images (whether in ascii art or just normal)? or allow for custom animations/designs to be imported into it?
I could see this working like a book/dream/vision for the player and they will see the title of the book, or have some neat image/animation for the splash screen (when dream/vision) then the information will be presented to them.
That would allow for more system agnostic setup as well, and allow for some fun roleplay and information gathering or backstory reveals, etc.
The modules supports a large amount of customization. These are some of the things already in the module:
With these you should be able to get a theme close to what your describing.
I could put it on my list of things to look into for specifically defining a splash video. Which is only shown on startup and then would change to the standard background in use now.
I have added a splash media setting that you can find on the style form. It has two “modes”.
If you upload a video it will replace the loading bar and ASCII entirely
If you upload an image it will use that as a background while keeping the standard ASCII and loading bar
I still need to add more layouts, text animation, and default styles but it’s getting there.
EDIT (4 months later update): this behavior is NO LONGER TRUE as of 3.1.6+ (October 2024). Showing the ASCII art + Loading bar is now its own configurable setting in the style editor. Regardless of the file type used for the splash.
Awesome!, I will have to try it out soon. havent had time to install and setup foundry for sometime now. but will definitely check it out :)
I wonder if you could shed some light on a little problem I'm having. I'm trying to set up a terminal with a macro button that switches the enabled status of two other terminals sharing the same space, one for "power offline" and the other for "power restored". So the Generator terminal would execute something like
canvas.tiles.get("id of tile").document.flags.terminal.enabled = true/false
to turn on one and disable the other. And this works, but only so long as a token remains on the generator terminal. I can't seem to make the change stick once the token moves off.
That’s a cool implementation. I haven’t actually tried placing them on top of each other like that.
For updating the flags you’ll actually want to use Foundry’s setFlag() function. This is present on the document object of the tile.
Here is an example:
canvas.tiles.get("id of tile").document.setFlag("terminal", "enabled", false)
Let me know if that works better.
I am eventually adding a feature to open other Terminals. It’s good to hear there will be some demand for that.
EDIT: this feature has been added by the name “Secure Shell”. There is also included compendium macros that can be used for opening a Terminal.
Hey, with your advice and a *little* help from the foundry discord I got it working to the point where I can even switch on a terminal in another scene:
const tile1 = game.scenes.get("other scene ID").tiles.get("tile ID");
const state1 = tile1.getFlag("terminal", "enabled") ?? false;
await tile1.setFlag("terminal", "enabled", !state1);
Using it again turns the remote terminal back off.Thanks for your help, I love this little module! My Alien games are about to get much more interesting.
Hey, can this be used to reveal the foundry scene map to players? thanks!
Yes, when configuring the Terminal inside the Tile config. There will be a checkbox to add a button for any user that views the Terminal UI. This button when clicked will explore all the Fog of War for the current scene for all connected players.
Let me know if you have another other questions 🙂
As a warning if you like to stay on the latest Foundry version I have yet to find a way to make this feature work on the unreleased version 12 (Which won’t come out for another couple months). I reached out the Foundry devs but it doesn’t seem like they are going to help me find a solution to it. There are APIs I can hook into but they get complicated very fast.
So, just something to be aware of. This feature may only be here for a year if you stay on latest Foundry.
Thank you for the answer!
I hope you'll find a way to port the feature over to v12, as while it may be a while before i update to that (i'm the kind of guy who will update to v12 once v13 is around the corner basically), i will eventually do it at some point..
Hopefully the devs or someone else will be able to point you to the right direction!
I have a prototype of this working in v12. This feature is here to stay!
This was the last feature to be ported to v12 so this module is ready for whenever that happens.
This is great news!
Do you have any plans for new features to add maybe? i was thinking the other day it would be fun to have a foundry module that could provide some "hacking minigame" for the players to resolve, such as the ones that you can see in Alien Isolation, but i have no idea how feasible that would be lol
I have a couple things brewing for new features. The three certain ones are related to cameras, passwords/keycards and lights.
I’m implementing/taking some ideas from Starfinder. Which I’ve never played but find their mechanics around terminals to be interesting. This includes things like: lockouts, alarms, data wipes, encrypted pages, accessing other computers from your current one.
I’m going to be spending some time to see what is feasible from these ideas.
As far as puzzles or minigames I’m a bit torn because that is a great idea. Even one I listed as a stretch goal on my github page for this.
However, it runs into a problem I haven’t really thought of a solution for. It steps on whatever game system’s solution for accessing computers is. I don’t know a good solution around this, which has halted my progress on that.
Is it possible to use this module with Monk's Active Tile?
Yes it is 🌞 I do it all the time and would recommend.
How can I use Terminal with Monk's Active Tiles?
there’s a foundry guide
You can go to the setup screen of your Foundry instance. Go to the Add-on Modules tab. Click install modules button. Search “Monk’s active tile triggers”. Click install button.
Then in a world as a GM activate the module on the settings sidebar.
You can now place a tile and a new tab will be shown in the tile config. It’s called triggers and there are numerous settings for how things can be configured at that point.
I think you misunderstood what I asked. I was asking how can I use Monk with Terminal. As in, is there a way to use Monk's to open the terminal or not
I see what you mean. Well there wasn’t until today. I’ve pushed a 1.3.3 version that can support this.
I am now exporting an instance of Terminal to the window. That means it can be opened with a macro and triggered with that by Monk’s Active Tiles.
This is a bit experimental since it loses a few features this way compared to having your players just walk onto the Terminal tile, so proceed with caution.
~~So, here is what you’ll need to do. You should create a macro and give it this contents (replacing the journal and tile ID)
Then add a trigger onto whatever tile your using to run the macro and it should open it. Keep in mind this macro must be ran by whoever you intend to have see the Terminal. It only opens up for the client that triggered the macro.~~
EDIT: I now have a supported macro which comes in an included module Compendium. For steps on how to use that. Read through the rest of the thread