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.
Discussion about Mods for Prison Architect
1 post • Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 1 guest