Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

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.

(1 edit)

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.