Detecting which Warden the player chooses

Discussion about Mods for Prison Architect

Moderator: NBJeff

CatGut
level0
Posts: 1
Joined: Tue Dec 13, 2016 6:57 am

Detecting which Warden the player chooses

Postby CatGut » Tue Dec 13, 2016 7:06 am

Hi I'm trying to work out how to detect which Warden the player is using so that I can edit the Warden powers in game.
Tried to get the name of the Sprite used, the Name, and the tooltip description in order the work out which one, but they all return "nil".
This has been very frustrating. There must be a way to do it!

-CatGut
S1eepy
level0
Posts: 6
Joined: Thu Jan 05, 2017 2:43 pm

Re: Detecting which Warden the player chooses

Postby S1eepy » Fri Jan 06, 2017 3:32 am

I'm new here, and there's probably a better solution, but here's a dirty trick you can use when you can't grab the name of a sprite:

Target a pixel on the middle of the Warden's chest and pull the color value of that pixel and store that color value with the name of the Warden.
Do this for every Warden.
Now when you want to determine which Warden the player has chosen: you can pull the color value from the same sprite (x,y), reference your list of values, and boom, you know which Warden it is without needing an explicit reference.

Note: like I said, this is dirty: this will not work unless the pixel location you select returns a different value on every warden. I would not suggest this as an end-all-be-all solution, but if you're looking to test something in a pinch: this is fine until you've worked out something better.

Return to “Modding”

Who is online

Users browsing this forum: dsdude123 and 2 guests