[MOD][WIP] Functional Electric Chair A-28

Discussion about Mods for Prison Architect

Moderator: NBJeff

User avatar
Pruvan
level2
level2
Posts: 94
Joined: Mon May 27, 2013 4:11 am

[MOD][WIP] Functional Electric Chair A-28

Postby Pruvan » Mon Oct 13, 2014 1:00 am

Image

========
Description
========


In an effort to make the electric chair have some function outside of the introduction sequence, I figured I might as well push the scripting system to the limit and give it a go. This mod was mostly an experiment to see if something like this could be done, and if (not / so), what expansions the scripting system would need in order for it to (be possible / function better).

At the moment, this mod requires you to build an Electric Chair and an Electric Chair Switch in close proximity to each other. Once both objects are properly powered and the Electric Chair is switched on, my custom script starts running.

Basically, your prison will be searched for Max and SuperMax security level prisoners. These prisoners will then have a 10% chance to be sentenced to execution. Those sentenced are given a random time left to live until their execution, between 2 to 14 in-game days. When the prisoner's time is up, they are sent to the chair to be executed.

Sentenced prisoners will have a handy tooltip on them showing you how much time they have left to live. When a prisoner is being executed, another handy tooltip will appear on the Electric Chair Switch, showing you who's up and how far away he is.

As I expected, the scripting system is still very limited and buggy. So below is a list of all known issues.

=============
Compatibility Notes
=============


Game version: Alpha-28

This mod makes changes to the following files:

materials.txt

Any mods that make alterations to these files may experience conflicts.

==========
Known Issues
==========


Object.NavigateTo() seems to glitch out half the time, resulting in your to-be-executed prisoners occasionally getting stuck when they're supposed to be navigating to the electric chair. Seems to be a path-finding issue, so IV will have to patch this at some point. Switching the electric chair off and on again occasionally resolves the issue.

NavigateTo() also doesn't take into account if your prisoner was doing anything else at the time, which may also have its hand in the glitching issue. As such, your prisoners occasionally get executed while holding their food trays and such.

The electric chair switch does nothing yet, other than enable the electric chair's script. The idea is to have guards flip it at some point. However, there is no "escort" function and NavigateTo(), as mentioned above, glitches out half the time. So I'm holding off on trying to script proper procedures until NavigateTo() is fixed at least.

In line with that, prisoners will simply walk to the electric chair when they're being executed. When they reach the chair, they die, with very little fanfare. WIP is WIP.

There doesn't seem to be a function to check if an object is in a certain room or not, so you don't actually need an Execution room yet. You can place the chair and switch pretty much anywhere you want, as long as they're close enough to each other and receive power.

GetProperty() still doesn't allow you to read prisoners' biographies. Hence why sentencing is left to random chance for now. Once IV "upgrades" this function I can base the sentence on prisoners' actual crimes and such.

The electric chair gets switched off when loading your game, stopping the script from running. So every time you load your game you'll have to turn it back on again.

=============
Useful Information
=============


To uninstall this mod without leaving stray shenanigans in your prison (tooltips and such), just follow these steps:

1) Make sure the script is running first. (If it never ran before, you can skip this.)
2) Switch the Electric Chair off.
3) Dump the Electric Chair Switch and dismantle/dump the Electric Chair.
4) Disable the mod.

ElectricChairSwitch.lua contains some variables that can be modified by end-users at the top of the file. These variables are:

maximumDistanceToChair
categoriesEligibleForExecution
executionChance
minimumTimeToLive
variableTimeToLive
getPrisonersTimer


Most of these are self-explanatory, but in-depth information has been provided inside the file. If you like you can tinker with these to tailor your own custom experience.

=======
Download
=======


Download available on the Steam Workshop only.
Last edited by Pruvan on Wed Jan 14, 2015 7:59 pm, edited 3 times in total.
User avatar
knoest26
level5
level5
Posts: 1380
Joined: Thu Jul 11, 2013 6:55 pm
Location: The Netherlands
Contact:

Re: [MOD][WIP] Functional Electric Chair

Postby knoest26 » Mon Oct 13, 2014 3:37 pm

sounds awesome but I'd prefer for the mod to only search for supermax prisoners
User avatar
Seth2697
level1
level1
Posts: 35
Joined: Thu Oct 16, 2014 10:01 am

Re: [MOD][WIP] Functional Electric Chair

Postby Seth2697 » Thu Oct 16, 2014 9:11 pm

Too bad when they go to the chair you can't make the mod call the tazer animation that plays when prisoners are hit by a tazer so it looks there getting electrocuted for real.
Starzy
level0
Posts: 2
Joined: Wed Apr 30, 2014 2:32 am

Re: [MOD][WIP] Functional Electric Chair

Postby Starzy » Fri Oct 17, 2014 9:19 am

Seth2697 wrote:Too bad when they go to the chair you can't make the mod call the tazer animation that plays when prisoners are hit by a tazer so it looks there getting electrocuted for real.

Possible,

knoest26 wrote:sounds awesome but I'd prefer for the mod to only search for supermax prisoners

You can edit that,
goto
C:\Users\USERNAMEHERE\AppData\Local\Introversion\Prison Architect\mods\

open each of the folders and then click on the data folder to see if it has an electricchair.lua, if none has it then download the mod by starting your game.
Open electricchair.lua with notepad and then find this line of code.

Code: Select all

local allowedCategories = {"MaxSec", "SuperMax"};

copy and paste this into where that is

Code: Select all

local allowedCategories = {"SuperMax"};

There you go.
Ehndras
level0
Posts: 1
Joined: Sun Oct 19, 2014 7:06 am

Re: [MOD][WIP] Functional Electric Chair

Postby Ehndras » Mon Oct 20, 2014 7:42 am

Might I make a suggestion? How about adding after-affects to the execution system? Have the prisoners' moods be negative affected for a certain period of time, after a period of mass / auto-suppression to temporarily calm things down. If one could add / modify a "fear factor," you could possibly increase the chance for drug / alcohol abuse, and other types of fear / depression-based responses either outlasting or immediately following the suppression period. This would allow execution to grant both a temporary calm to your prison - to prepare and put guards into place - before unleashing a wave of unrest guaranteed to bring some much-needed !!FUN!!.

I'm unsure whether any of these mechanics are possible at this point.
JASPer.Gamer.9.0
level3
level3
Posts: 380
Joined: Fri Sep 06, 2013 12:29 am

Re: [MOD][WIP] Functional Electric Chair

Postby JASPer.Gamer.9.0 » Fri Dec 05, 2014 12:27 am

would it be okay if I used this in my next Mods Compilation Update?
User avatar
Pruvan
level2
level2
Posts: 94
Joined: Mon May 27, 2013 4:11 am

Re: [MOD][WIP] Functional Electric Chair A-28

Postby Pruvan » Wed Jan 14, 2015 7:59 pm

Updated to Alpha-28.

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest