Game logic - Global storage – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Lou Montana moved page Ylands Game logic - Global storage to Ylands:Game logic - Global storage: Text replacement - "Ylands " to "Ylands:")
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Description=
=Description=
Special game logic which serves for storing variables and instructions. Both are accessible from anywhere in the script and used in same manner as local variables or instructions.
Special game logic which serves for storing variables and instructions. Both are accessible from anywhere in the script and used in same manner as local variables or instructions.


=Local instructions=
'''Storage variables'''
*After creating any local instruction in global storage, you can use it in all other logic's or entity's scripting editor.
*After creating any variable in global storage, you can use it in all other logic's or entity's scripting editor
*Storage data (variables) can be found in '''Variables''' category


=Local variables=
'''Storage instructions'''
*After creating any local variable in global storage, you can use it in all other logic's or entity's scripting editor
*After creating any instruction in global storage, you can use it in all other logic's or entity's scripting editor.
*Storage instructions can be found in '''Instructions''' category


=Events=
'''Storages in compositions'''
There are no specific event for global storage.
*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 Global (2))
*In case of multiple instances of same composition, references in all compositions will be set to one storage


=Global Storage in Use=
# Add global storage and create a variable in it. In this case we made a simple variable for the example scenario called "Restart time".
# Create an instruction in it. If you need a changeable part, just add it in by double clicking the green tile of the instruction. In this case we made an instruction which writes remaining time to console and than, in the called time, it restarts the scenario.
# Create another logic or entity and edit its script using previous variables and/or instructions. Here the instruction is used to by triggered by an event listener using the variable from global storage.


----
{{Navbox/Ylands}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|19}}}}


----
[[Category: Ylands 0.10]]
{{Ylands scripting navbox}}
[[Category: Game Logic]]

Revision as of 17:30, 16 November 2022

Description

Special game logic which serves for storing variables and instructions. Both are accessible from anywhere in the script and used in same manner as local variables or instructions.

Storage variables

  • After creating any variable in global storage, you can use it in all other logic's or entity's scripting editor
  • Storage data (variables) can be found in Variables category

Storage instructions

  • After creating any instruction in global storage, you can use it in all other logic's or entity's scripting editor.
  • Storage instructions can be found in Instructions category

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 Global (2))
  • In case of multiple instances of same composition, references in all compositions will be set to one storage