Prison-Architect-API icon indicating copy to clipboard operation
Prison-Architect-API copied to clipboard

Callouts understanding

Open t1a2l opened this issue 8 years ago • 3 comments

Hi, I'm trying to understand how to access the vehicle property of a callout i created in the material in the lua scripting (like callout.vehicle or somthing like that).

t1a2l avatar May 13 '17 19:05 t1a2l

From vague memory you can't - as the vehicle might take a while to appear on the map (it doesn't always appear immediately). If you've got a specific type of vehicle associated with your callout, you could potentially just keep scanning for vehicles until you spot the vehicle of specific type? I've not played or modded PA for ages so don't know if they've added a better way by now (I very much doubt it).

originalfoo avatar May 14 '17 17:05 originalfoo

There is nothing for you to directly access callouts, but you can always get vehicles as normal objects.

Use Object.GetNearbyObjects(target, Vehicle_Name, 9999) to scan for vehicles.

PS:

This answer is simple. However, you need to know much before you can get things done right.

Scripting PA is very hard. Prepare to be frustrated.

grandsong avatar May 15 '17 01:05 grandsong

Thank you for answering, antyhor question: I created a remote door - it works ok, the problem is that a guard can open the door with keys and I want to prevent that like the normal remote door. As I saw in the settings the door it self isn't a wired object but the servo that connects to it. I don't see any reference about it - not here and not in the lua guide on steam. Thanks anyway.

t1a2l avatar May 19 '17 20:05 t1a2l