Game logic - Game logic storage
Jump to navigation Jump to search
Revision as of 16:35, 16 November 2022 by Lou Montana (Text replacement - "[[Ylands " to "[[Ylands:")
Special game logic to store data specific to another game logic. When assigned trough instruction Add logic storage, it will create a copy witch will be attached to selected game logic instance.
- Storage has to be attached to entity via Add Storage instruction, target becomes storage owner
- Any storage can have unlimited number of owners, each owner will have its unique copy of attached storage
- Game logic can have unlimited number of storages
- Each owner will have unique values in each storage
- Storage data (variables) can be found in Variables category
- Storage instructions can be found in Instructions category
- Instructions in a storage are executed only within currently called storage instance and it will affect only variables of this instance.
Storages in compositions
- When composition using any storage will get exported, it will save with a copy of that storage (even if not selected)
- When such composition is placed in other scenario, it will make new independent copy of included storage under new name (e.g Entity storage (2))
- In case of multiple instances of same composition, references in all compositions will be set to one storage
- In case a script will try to access non-existent storage this will stop the script. So it is crucial to do a storage check using Has storage instruction before accessing storage on unknown entity (e.g Trigger object).