Game logic - Entity label – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "[[Ylands " to "[[Ylands:")
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Description=
=Description=
Entity label is a '''collection of entities'''. Entities can be easily added or removed from a label, either by editing the label properties or trough visual scripting instructions. It is possible to check whenever a entity is part of a label and utilize this information in a game script.


Dynamic list of entities which can be adjusted from script.
= Properties =
=== Entities ===
*List of entities belonging to current Label.
*Click '''+''' to add new entries and then use picker to select entity from scene.


Label is dynamic list of entities. Each entity can be part of any number of Labels. You can target Label in actions. You can constrain Trigger Zones to react only to entities with specific label. You can constraint Event Listener to listen events only on entities with specific Label. Label collection is dynamic. You can add/remove Label from entities during play.
= Notes =
*Each entity can be part of any number of Labels.  
*It is possible to constrain [[Ylands:Game logic - Trigger zone|'''Trigger Zone''']] to react only to entities with specific label.  
*It is possible to constrain [[Ylands:Game logic - Event listener|'''Event Listener''']] to listen events only on entities with specific Label.  
*Label collection is dynamic. It is possible to add/remove entities during play.
*New entities assigned trough script are put at the end of the list.
*Entities removed from the world (destroyed/exchanged for a corpse) will remove themselves from associated Labels automatically.
*Any player after death/respawn is not removed from the world so he keeps himself in all associated Labels.


Entities removed from the world (destroyed/exchanged for a corpse) will remove themselves from associated Labels automatically.
= Entity label events =
*[[Ylands:Tile - Entity label On Entity Added-Removed|On Entity Added / Removed]]
*[[Ylands:Tile - Entity label On Count Changed|On Count Changed]]


Caveat: any player after its death is not removed from the world so he keeps himself in all associated Labels.
= Related instructions =
=== Entity label ===
*[[Ylands:Tile - Add-Remove entity to label|Add / Remove entity]]
*[[Ylands:Tile - Get label entities|Get entities]]
*[[Ylands:Tile - Get label entity count|Get entity count]]


=Settings=
=== Entities ===
*Entities - list of entities belonging to current Label
*[[Ylands:Tile - Attach-Remove entity label|Attach / Remove entity label]]
*New entities assigned trough actions are put at the end of the list. You can use this to work specifically with newest/oldest entities within Label
*[[Ylands:Tile - Get entity labels|Get entity labels]]
*[[Ylands:Tile - Has entity label| Has entity label]]


=Labels in other Game Logic=


==Trigger Zone==
----
You can constraint Trigger Zone to react to entities only with specific Label. Trigger Zone's attribute Is triggered by can be set to Labeled entities and there you can set specific Label. Trigger zone can trigger only when entity with the label enters/exits the trigger zone.
{{Navbox/Ylands}}
 
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|19}}}}
==Event Listener==
You can set Event Listener to listen to change in Label (count of entities with specific Label) or you can constraint target entity in Player Interaction With Entity to be only one with specified Label.
 
*Listen for is set to:
**Player Interaction With Entity/Interaction With Entity - You can set Target to Labeled Entities and there set Label. After that the Event Listener will listen to only entities with specified Label
**Labeled Entities Count Changed - You can perform actions when number of entities with specified Label is changed. Set Label to the one you are interested at. Set Event to the one which serves best to your purpose
**Player Role - You can set initial list of labels of all players with the Player role in Assign Labels


=Events=
[[Category: Game Logic]]
*On Entity Added / Removed
[[Category: Ylands 0.10]]
**Entity - entity added / removed from label
*On Count Changed
**Old count
**New count
 
=Instructions=
*Add / Remove Entity
**Label - target label
**Entity - entity to be added to label
 
 
----
{{Ylands scripting navbox}}

Revision as of 17:36, 16 November 2022

Description

Entity label is a collection of entities. Entities can be easily added or removed from a label, either by editing the label properties or trough visual scripting instructions. It is possible to check whenever a entity is part of a label and utilize this information in a game script.

Properties

Entities

  • List of entities belonging to current Label.
  • Click + to add new entries and then use picker to select entity from scene.

Notes

  • Each entity can be part of any number of Labels.
  • It is possible to constrain Trigger Zone to react only to entities with specific label.
  • It is possible to constrain Event Listener to listen events only on entities with specific Label.
  • Label collection is dynamic. It is possible to add/remove entities during play.
  • New entities assigned trough script are put at the end of the list.
  • Entities removed from the world (destroyed/exchanged for a corpse) will remove themselves from associated Labels automatically.
  • Any player after death/respawn is not removed from the world so he keeps himself in all associated Labels.

Entity label events

Related instructions

Entity label

Entities