Prison Architect

Prison Architect

73 ratings
Automatic CCTV Guard Response
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
2.112 KB
14 Sep, 2023 @ 8:03pm
26 Jan @ 8:02am
10 Change Notes ( view )

Subscribe to download
Automatic CCTV Guard Response

Description
Automatically calls nearby available guards when prisoners begin misbehaving and are spotted by CCTV.

Useful when playing with Warden Mode or when you just want to automate radio calls for backup.
43 Comments
✚ I TomBeryman 26 Mar @ 2:37pm 
alr, thanks.
Ater  [author] 24 Mar @ 5:26pm 
@TomBeryman Sadly, that's a bug I could not figure how to solve. Sorry :/

The modding API for PA is very basic, and there's no "move there but stop if anything bad happens" command that I could find. Only this "go there and ignore everything" that you see the mod use.

Obviously the game has a "move and look" function, because you don't see guards just ignoring misbehaving prisoners in vanilla, like you did with the mod. That said, that function is likely C++ only, and not exposed to the Lua API :(
✚ I TomBeryman 12 Mar @ 8:03am 
@Ater Is this a bug? When guards respond to a misbehaving prisoners then they just go to the room batons out, but when the prisoner is next to them running away they just ignore him.
Ater  [author] 30 Jan @ 11:48am 
30 (seconds) / 4 (game speed) = 7.5 (seconds between camera checks), but I guess those random variations on the update timers for the different cameras made the lag more "spread out", hitting at roughly 0.5 a second like you mentioned.

I purposely made it spread out to make the lag spikes minimal and hopefully unnoticeable, as making it just a concentrated big spike really sucked to play with.
Ater  [author] 30 Jan @ 11:39am 
@Lioncat6 I think it might be lagging every half a second because each camera, running the script separately, checks whether there's a prisoner misbehaving every 30 seconds at normal speed. (With a little random variance to reduce lag spikes)

So the more cameras you have and the faster the speed, the more they check.

When I was originally making the mod, I really wanted to make it event-based, as in, only if a prisoner starts misbehaving, have the "world" check if a camera caught sight of it.

But sadly, I had to make them "timed" like that, because the modding API is quite limited. :/
And for some reason you HAVE to have scripts running inside objects physically on the map, instead of just running in the background.

I was experimenting with update timers greater than 30 seconds, but that's usually how long it takes for a prisoner to destroy and open a cell door enough to escape, so it made the mod unreliable for what I wanted to achieve. So I capped it at 30 seconds.
Lioncat6 29 Jan @ 6:36pm 
Yeah, PA mods are very much just behavior or texture modifications to the game... so not much going with any deeper modifications like that unless of course the files could be decrypted and someone was willing to put the effort in.
Sean Diaz 29 Jan @ 8:16am 
yeah and very sadly, that is not something modders could try to fix either. not untill PA2 released, and we might be able to beg them into releasing a open version modkit that lets us mod the games engine for pa1. but they would have to decrypt the game fully so modders with knownledge could attempt fixes and maybe getting it to run on more threads.
Lioncat6 28 Jan @ 3:41pm 
Yeah, the game being single threaded makes a lot of sense considering my PC being heavily CPU bottle-necked...
Sean Diaz 28 Jan @ 5:33am 
do keep in mind, even if you got a powerfull CPU, the game is build to ONLY run on a SINGLE CORE..... so it never will be able to ultiize the CPU really which is partly where the games problems come from. sadly by adding more content your only going to strain the game more and more, esp as these new devs really liked to mess it up even more and break more things which has caused larger prisons to be near impossible. and i find -500 folk too little for having true fun sense. lol game feels so dull after a while with just so little to observe.
Lioncat6 27 Jan @ 8:31pm 
Compared to that, not that large... ~600. With the mod running though, whenever the game is on 4x speed, the game stutters every half second or so. Anyways: here's a video of the stuttering I'm talking about. https://imgur.com/a/DlEi3rk