[MOD REQUEST] Change prisoner to ___

Discussion about Mods for Prison Architect

Moderator: NBJeff

JASPer.Gamer.9.0
level3
level3
Posts: 380
Joined: Fri Sep 06, 2013 12:29 am

[MOD REQUEST] Change prisoner to ___

Postby JASPer.Gamer.9.0 » Tue Oct 20, 2015 4:09 am

I saw hoosdat guy's Prisoner Suppressor, and I use the dev utility mod.
The dev utility menu mod adds lots of entities to the staff menu. One of them is change prisoner to death row. I was able to make a cline which changed prisoners to super max for myself. But that requires that you go manually through all the prisoners.

I wondered if it was possible to make an object like the prisoner suppressor which when given the green signal by a switch or a pressure plate changes all prisoners nearby to supermax. Then you could do something like place it near armoury/edge of prison, so when prisoners go near it changes them into super max and therefore cuffs them?

It would certainly be a nightmare in Escape Mode!
Anyone who could make it for me?

Jasper
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [MOD REQUEST] Change prisoner to ___

Postby aubergine18 » Tue Oct 20, 2015 5:00 am

The prisoner suppressor is just doing a regular check to find nearby prisoners, and if it finds any it changes their needs / statuseffects. So you could just use that as a base and tweak it to your needs.

the .Category property of prisoners is what you'll need to change - note that when setting it needs to be a number (when getting it returns a string).
JASPer.Gamer.9.0
level3
level3
Posts: 380
Joined: Fri Sep 06, 2013 12:29 am

Re: [MOD REQUEST] Change prisoner to ___

Postby JASPer.Gamer.9.0 » Tue Oct 20, 2015 7:17 am

aubergine18 wrote:The prisoner suppressor is just doing a regular check to find nearby prisoners, and if it finds any it changes their needs / statuseffects. So you could just use that as a base and tweak it to your needs.

the .Category property of prisoners is what you'll need to change - note that when setting it needs to be a number (when getting it returns a string).

Yes, I saw the code for the prisoner suppressor and I saw I'd have to change .category, but I tried making it and it didn't work. Could you give me some pointers on how to acheive this?

Jasper
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [MOD REQUEST] Change prisoner to ___

Postby aubergine18 » Tue Oct 20, 2015 7:20 am

See Category Property section in this guide: http://steamcommunity.com/sharedfiles/f ... =480978426
JASPer.Gamer.9.0
level3
level3
Posts: 380
Joined: Fri Sep 06, 2013 12:29 am

Re: [MOD REQUEST] Change prisoner to ___

Postby JASPer.Gamer.9.0 » Tue Oct 20, 2015 7:33 am

aubergine18 wrote:See Category Property section in this guide: http://steamcommunity.com/sharedfiles/f ... =480978426

That only tells me which is which...
I was wondering if you could give me some help with the code?

Jasper
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [MOD REQUEST] Change prisoner to ___

Postby aubergine18 » Tue Oct 20, 2015 7:43 am

Just change the suppressor code to set the .Category property and then use the relevant number to get the desired category. If you want to make it wired then you'll need to add `Properties Wired` to the object definition and in the script check the .Triggered value.

For example:

Code: Select all

local find = this.GetNearbyObjects
local nearby = 10 -- tiles

function Update()

  if not this.Triggered or this.Triggered == 0 then
    return -- bail out if not triggered
  end

  local prisoners = find( 'Prisoner', nearby )

  for prisoner in next, prisoners do -- set nearby prisoners to MaxSec
    prisoner.Category = 3
  end

end

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 12 guests