Is it easy to bind dev tools to a key press?

Started by togfox, January 30, 2019, 09:27:31 PM

Previous topic - Next topic

togfox

There is a dev tool built into the game to instantly send pawns into a berserker rage. I'd like to bind that to a key or link it to an icon on the screen.

Is that a lot of coding or a little?

I'd like to build a gladiator pit, stick two prisoners in there and see which should join my personal bodyguard force.  :)

Pelador

Or watch them both break free from the prison in their mental state and begin to decimate your colonists? ;)

Going to be C# coding and you are likely going to have to write your own contextual GUI to hook into the sub-routine that adds the rage.

Unless anyone knows the specifics and can help with the details you may wish to get a tool like dnSpy to be able to look at the game code routines to use, check the tools section in these forums for details. There are also some tutorials/guides around about GUIs.

LWM

Surely someone can point to a mod that has a button that links to C# code?

Then once you have that...tying it to the correct function should be fairly easy.

I have not yet figured out how to handle custom key-presses.

--LWM

Jaxxa

The easiest way to trigger it that I could think of is to use a building with a Gizmo, that will then make any prisoners close by fight.

Here is a mod where I use a Gizmo:
https://github.com/jaxxa/ED-Prometheus/blob/master/Source/ED-Prometheus/LaserDrill/Comp_LaserDrill.cs