Priority: Low
world.lua is a good thing. I am using its WorkQueue to construct and build.
Sadly, it lacks a much-needed API for us to get objects by their type no matter where they are.
A workaround is as follows:
1. Spawn an anchor object to do nothing
2. Use .GetNearbyObjects of the anchor and pass a range parameter large enough (say 9999) to cover the whole map
3. After initialization, find and delete the old anchor when a save is loaded.
(Use .GetNearbyObjects('Anchor', 9999), returns two, keep this new one and delete the other.)
However, this anchor object will be annoying. Even .Hidden = true, it still can be hovered and has shadow when outdoors.
An improvement is:
2.5. Find the warden, make it play the role of anchor
3. Delete the initial anchor if a warden if found.
I will be glad if an API like World.GetObject() is added to save me from above ugly codes. But this workaround is quite fine, so the Priority is Low.
- Board index Games Prison Architect Prison Architect Modding
- Search
-
- It is currently Fri Apr 19, 2024 12:31 pm
- All times are UTC+01:00
[Trick and API Request] Get objects in world.lua
Discussion about Mods for Prison Architect
Moderator: NBJeff
Jump to
- Introversion
- Introversion News
- Introversion Lounge
- Introversion Blog
- Games
- Scanner Sombre
- Prison Architect
- Prison Architect
- General
- Community Members
- Campaign
- Escape Mode
- Modding
- Tablet Testing
- Introversion
- Subversion
- Multiwinia
- Multiwinia
- General
- Gameplay Discussion
- Strategy and Tactics
- Mods and Maps
- The Future
- Introversion
- Support
- Windows Troubleshooting
- Defcon
- Defcon
- General
- Strategic Air Command
- The Debriefing Room
- Mod Projects
- Think Tank
- AI Bots
- DEFCON VR
- Introversion
- Support
- Windows Troubleshooting
- Linux Troubleshooting
- Darwinia
- Darwinia
- General
- Mod Projects
- Introversion
- Technical Support
- Windows Issues
- Mac Issues
- Linux Issues
- Translation Issues
- Uplink
- Uplink
- General
- Latest Patch
- Hints and Tips
- The Full Game
- The Future
- Uplink in Moderation
- Introversion
- Nakatomi
- Bug Reports
- The Bonus Disk
- The Latest Patch
- Mac Uplink
Who is online
Users browsing this forum: Google [Bot] and 13 guests