[API Request] WorkQueue in Object

Discussion about Mods for Prison Architect

Moderator: NBJeff

grandsong
level0
Posts: 7
Joined: Sun Oct 09, 2016 10:02 am

[API Request] WorkQueue in Object

Postby grandsong » Wed Nov 02, 2016 12:32 pm

Priority: Low

WorkQueue is very useful. But it is accessible only by world.lua.

Since there is no direct way for a script to communicate with another, I have to take a workaround:

1. Spawn an object
2. Give/set a property ".to_be_build" = true of that object.
3. In Update() at world.lua, anchor.GetNearbyObjects(thatType, 9999)
4. For each ojects which has to_be_build, use WorkQueue to build a copy and delete the old one.

Ugly. And costly in performance if there are many types to check frequently.

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 4 guests