Twitch Plays Tweaks - Help Request

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
YokuPlays
Posts: 2
Joined: Tue Jun 16, 2020 1:12 pm

Twitch Plays Tweaks - Help Request

#1 Post by YokuPlays »

Hello Guys,

I am working on a little project to make TomE4 viable for Twitch Plays. In twitch plays, the chat controls the game and tries to beat it collaboratively. With much help of a kind programmer (see https://github.com/christ0pher/twitch-p ... controller for his bot), I managed to make my own Bot Version which can make all my keyboard inputs (triggered by the chat votes) in TomE. Now basically, the chat can play Tome4 with my bot and it works fine. But I need some little changes to the game. At the moment, viewers cant mess around with access to all parts of the game too much. Because at the moment, viewers can close the game and exit to windows etc. I wrote a script to restart the game automatically if it closes.. But you see the point.. They could even change the resolution of the game or remove addons etc. Now, I am hoping to create an addon which solves this problems.

What do I need:

Most important:
1) Hide the Menu (when you press "escape" ingame) or at least core options like "Exit game, video settings, etc." Unbinding the "Escape" button does not solve this problem, because viewers / players need to hit esc to close windows etc.

2) On death: Remove the option to go back to main menu

Nice to have, but not core:
On death: Restart the game with new (random) character automatically


There are several additional tweaks which would make my project smoother. But the first two are most important.. However, I am pretty new to lua modding. I tried to find the lua files I need to modify.. I found a "GameMenu.lua" in engines/engine/dialogs and I tried to overwrite this with the "overloading" function (I just removed some parts which sounded like Menu options in this lua file ^^). But this does not work at all.. I am totally stuck :D Maybe someone of you has an idea where to look for the files. Or - even better has a simple solution for at least some of my problems. I would be really happy about it! :)

Greetings
Yoku

RootOfAllThings
Wayist
Posts: 23
Joined: Tue Feb 21, 2017 3:53 am

Re: Twitch Plays Tweaks - Help Request

#2 Post by RootOfAllThings »

This sounds really neat! So I took thirty minutes or so and threw together a quick addon that should hopefully accomplish what you need. I've just trimmed the main and death dialog boxes so that they look something like thisand this. Disregard the "Resurrect by cheating" message, that's due to me testing the addon in developer mode and won't show up in your games. Note that Alt-F4 will still take you back to the main menu, so you may need to manually intercept that specific command from your Twitch bot. Since I wanted to leave some way of actually accessing the settings and modifying the boot screen requires a separate addon, I left the main main menu untouched.

I wasn't sure if you wanted the "Restart the same character" dialogue still present, so I left it in. It's trivial to remove if you need it gone. Note that this menu will also have alternative revive options like Blood of Life and Re-assembly; they shouldn't be removed by this addon if your character has them available.

At the moment, there's not a neat way in the game's code to "restart the game as a random character." That might be worth an addon in and of itself, but will require more than thirty minutes tinkering with dialogue options. Haven't spent much time looking at the character creation process.

You can get it here:
https://te4.org/games/addons/tome/twitch_menu_tweak

If you have other requests or this doesn't quite hit the mark, hit me up on the ToME Discord. I'm almost always there.

YokuPlays
Posts: 2
Joined: Tue Jun 16, 2020 1:12 pm

Re: Twitch Plays Tweaks - Help Request

#3 Post by YokuPlays »

This looks awesome!
Thank you so much for working on it! I also managed to somehow "break" the main menu, but your mod is way more elegant and viewers still have acess to interesting options like achivements. Alt +F4 is great because viewers can't hit key combinations at the moment (which is a bit problematic due to the big skill bars). I will test your mod as soon as possible :)

I assumed that random creating / restart is not that easy. Maybe you have an idea how to change the creating screen? As far as i could see its the "birther.lua" file. I managed to disable the "cancel" button. But I got stuck at disabling all critical buttons / options. For example people should not be able to delete pre-defined characters, or start the tutorial. Maybe even the "explorer" game mode should not be visible. My way of "modding" means to break code :D I have no clue of real coding.. Thats why I run into many "lua errors" when just breaking code of some buttons. Basically, it only worked for the "cancel" button in the birther.
Again, thanks alot for your effort! I think we / the viewers will have alot fun with playing TomE :)

Greetings,
Yoku

RootOfAllThings
Wayist
Posts: 23
Joined: Tue Feb 21, 2017 3:53 am

Re: Twitch Plays Tweaks - Help Request

#4 Post by RootOfAllThings »

Enjoy your exceedingly ominous dialogue box. The illusion of choice is real.

Image

https://te4.org/games/addons/tome/random-restart

This was actually way easier than I expected. It probably also exists somewhere as an addon, but never hurts to do it again I suppose.

Post Reply