Prison Architect

Prison Architect

Road Sensors
110 Comments
阳台门口 16 Jun, 2021 @ 8:26am 
在你的道路上放置传感器,以检测何时有车辆!

他们就像压力垫,但对道路!

确保在道路大门上方放置两块瓷砖,以便车辆停在上面。

半路传感器只检测一条车道,需要像上面的截图一样放置。

(不过,你不必让两个相邻。)

在您完成远程访问研究后,它们位于实用程序下。
David's Old Acc. 1 Aug, 2019 @ 8:20pm 
I published a fixed version to the workshop here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1822431950
KilledJoy 29 Apr, 2019 @ 9:58pm 
mod is 5 years out of date an multiple posts about a fix an yall still shout "fix your mod" lol
Minty Senior 22 Apr, 2019 @ 3:36pm 
I just noticed that nobrainer already suggested this same fix back in August 2018.
Minty Senior 28 Mar, 2019 @ 5:04pm 
If you don't mind getting your hands dirty with a minor script change, I found a fix that does work (I played several game days with the clock speeded up, with no errors and nothing in the debug.txt log).

Go to the user mod folder for the game, which is usually here:
C:\Users\YOUR_NAME\AppData\Local\Introversion\Prison Architect\mods
Find and edit the Road Sensors mod script (mod id 485302724)
mods\485302724\data\scripts\RoadSensor.lua

At the bottom of the script, in the function named Authorised
Replace this line:
return Get( vehicle, "Pos.y" ) - OurY <= Proximity;
with:
return Get( vehicle, "Pos.y" ) - this.Pos.y <= Proximity;

The OurY variable defined further up the script wasn't being preserved (nil value). Someone with a better knowledge of lua scripting would probably know why.
Restart the game for the change to be picked up, mod shouldn't need reactivating.
If the mod creator (Themias) is still around perhaps he can check the fix and post an update.
Wal der Qual 17 Mar, 2019 @ 1:09am 
@Kiano why should asking nicely be an option when you can just scream at someone making free content, right?
Kiano Jajino 17 Dec, 2018 @ 12:31am 
Creator ! Update your mod !
Karachay 8 Dec, 2018 @ 7:41am 
I think themias have a look about the error
Karachay 8 Dec, 2018 @ 7:39am 
I have a error too
Dan B 31 Aug, 2018 @ 3:38am 
same here for that error
Leo 24 Aug, 2018 @ 4:10am 
ScriptSystem Error : (RoadSensor) RUNTIME ERROR : [string "-- vehicle types; add more if desired (reme..."]:84: attempt to perform arithmetic on upvalue 'OurY' (a nil value)
mckzchi 17 Aug, 2018 @ 10:56pm 
@nobrainer. Thank you. I have changed the script accordingly and it works. Thanks @howmanyhoursdoineedtobeclockwork for offering your help.
Alpatron 15 Aug, 2018 @ 8:37am 
@nobrainer
Thank you. I had thought I'd need to reverse engineer the mod myself to get it to work.
nobrainer 15 Aug, 2018 @ 7:13am 
Ok. I've managed to fix it by editing the lua script not to use the local variable 'OurY'.

I changed line 84 from:

return Get( vehicle, "Pos.y" ) - OurY <= Proximity;

to:

return Get( vehicle, "Pos.y" ) - this.Pos.y <= Proximity;

Now it works. For some reason the local variables are not initialized when you load the save, but the object coordinates are correctly available to be used in the code functions.

Most likely the same problem exists in the file halfroadsensor.lua with the variables 'OurY' and 'OurX'.
nobrainer 15 Aug, 2018 @ 6:55am 
I get the same error as of update 15.
Something like this:
ScriptSystem Error : (RoadSensor) RUNTIME ERROR : [string "-- vehicle types; add more if desired (reme..."]:84: attempt to perform arithmetic on upvalue 'OurY' (a nil value)

I've checked the roadsensor.lua script file and it appears that, at line 84, there's an arithmetic operation performed to determine the proximity of the vehicle:
return Get( vehicle, "Pos.y" ) - OurY <= Proximity;

But acording to the error message, this operation is being called with the value of 'OurY' not being a number but a nil value. Aparently the initialization of this variable, at line 28, is not being done sucessfully:
local OurY = this.Pos.y;

I can understand the error that is happening but I don't have knowledge of the modding API to fix it myself, at least not yet.

Any help is appreciated.
putispawn 14 Aug, 2018 @ 2:28pm 
if you tell me your mod list we may do
The Stranger 13 Aug, 2018 @ 6:57am 
Can we get a fix?
putispawn 11 Aug, 2018 @ 5:41pm 
seems like they aint gonna answer so maybe mckzchi if you tell what mods your using i may can help becuase it musts be an unponpability with another mod
mckzchi 6 Aug, 2018 @ 8:14pm 
hello, as of update 15 the road sensors get a script error when loading the game. uninstalling the road sensor and installing them again fixes it. can you fix this?
putispawn 6 Aug, 2018 @ 12:41pm 
fix please error in script update 15 b
berry 20 Nov, 2017 @ 12:44pm 
Can't find them n-game
n1a 10 Sep, 2017 @ 11:18am 
dont even need this
Navarth 27 Aug, 2017 @ 5:15am 
Seem working for me (take 1-2 seconds to detect a vehicles)
It has the same icon of the pressure plate btw
TJ_84 24 Jun, 2017 @ 2:32am 
I play sandbox without utilities, can you place them somewhere else than utilities?
bongerman85 18 May, 2017 @ 10:29pm 
i use to use these on my old account and they use to work. make sure they are correctly hooked up to the servos. my guess is that you arent using the perimeter servos mod which should make this work
PAYSO 13 Feb, 2017 @ 5:27pm 
DOES NOT WORK!
SirGunar 24 Dec, 2016 @ 11:46pm 
Looks like a cool mod, but I can't find the sensors in the game.
>OVƎЯS~70P< 22 Oct, 2016 @ 8:11am 
Pls, update it to the latest version.
Rio 22 Sep, 2016 @ 10:42am 
carnt find them
PlatinumGold 17 Jul, 2016 @ 7:42pm 
This is a very good mod but the problem is that it wont work with murgh's recycling mod, the main recycling desk is replaced with a road sensor.
murgh 7 Jul, 2016 @ 12:15pm 
@ThatSanity prisoners require pressure pads, vehicles require road sensors :)
murgh 7 Jul, 2016 @ 12:14pm 
This mod can work without the use of a sprites.png to save mod space.

Simply use these definitions for the RoadSensor:
Width 5
Height 1
SpriteScale 0.5
BEGIN Sprite x 42 y 4 w 10 h 1 RotateType 0 END

and these for the HalfRoadSensor:

Width 2
Height 1
SpriteScale 0.5
BEGIN Sprite x 42 y 4 w 4 h 1 RotateType 0 END
Barckley 5 Feb, 2016 @ 3:05am 
@Themias
Barckley 5 Feb, 2016 @ 3:05am 
it works??
FaYaY 29 Jan, 2016 @ 3:10pm 
Can you update this mod so it works on update 3?
Themias  [author] 27 Jan, 2016 @ 5:05pm 
@Mikado-Senpai It works like a pressure pad, if you've used one before. Connect the sensor to the thing you want to trigger, e.g. door servo. Make sure the sensor is placed in the road like it is in the screenshots above.
Star Sanctioned Dreamer 25 Jan, 2016 @ 8:47pm 
having a little bit of trouble with this one... Are you supposed to connect the Door Servo TO the Road Sensor or do you have to connect the Road Sensor TO the Door Servo...

Can't seem to get it to work, but i know things like the CCTV cameras and monitors only work if you connect it from the monitor TO the camera, so i was wondering if something like that was happening.
Ardith Prime 5 Jan, 2016 @ 12:40pm 
yes it does.
azairvine 20 Dec, 2015 @ 10:05pm 
Does this still work after update 2?
The Odd Fox 5 Dec, 2015 @ 3:06am 
Nice mod
Dooster 19 Nov, 2015 @ 1:10pm 
Works like a dream!
7Infamous 7 Nov, 2015 @ 9:24am 
i added this one but where do I find I looked in the objects and utilities but couldnt find them
kingdavis45 30 Oct, 2015 @ 7:08am 
@gokberk.yilmaz.ant I found it. it was a different light than the normal one. It turns green when the circuit has power to it and it lets you know if you're getting power. Took me a minute but once you firgure out the layout then it's simple. Someone just needs a video showing you how to do this but it WORKS and WORKS WELL.
***** Player 28 Oct, 2015 @ 12:35pm 
Farted.
BeanSlinger419 24 Oct, 2015 @ 7:19am 
:steamhappy::steamhappy:
BeanSlinger419 24 Oct, 2015 @ 7:19am 
awesome now i can no longer have prisoners going out
Geek Girl 22 Oct, 2015 @ 1:54am 
Thaks, gokberk.yilmaz.ant
kernel sanders 21 Oct, 2015 @ 8:19am 
its in utilities
Geek Girl 21 Oct, 2015 @ 1:34am 
I researched all in "Security" and in "objects" dind't have any road sensors. :/
Vaktare 20 Oct, 2015 @ 3:12am 
i got it to work it was steam that place the files wrong for some reson