Game logic - Entity template – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|19}}}}" to "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|13}}}}")
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Description=
=Description=
Template for spawning new entities - either items, NPCs or vehicles. All atributes (HP, color etc) set in entity template will be carried over to newly spawned entity.
Template for spawning '''new entities''' - either items, NPCs or vehicles. All atributes (HP, color etc) set in entity template will be carried over to newly spawned entity. New entities are spawned using [[Ylands:Tile - Spawn entity template|'''Spawn Entity''']] instruction.


*All atributes picked to the entity template will be transfered to the spawned entity.
*All atributes picked to the entity template will be transfered to the spawned entity.
*Template remembers the entity in state when it was picked. Thus the entity can be removed after being picked. When editing once picked entity, it must be repicked to the template for applying changes.
*Attributes of picked entity can be modified directly in the Template
*The template itself can be used to modify the picked entity while spawning it.
*Template remembers the entity in state when it was picked. Thus the entity can be removed after being picked.
*Other logics/scripts are used to execute the entity spawning with two script tiles called "Spawn Entity Template"


=Events=
= Properties =
* On Entity Spawn - Called when entity from the template is spawned.
=== Entity ===
*Entity to be spawned
*Click to edit entity properties


=Literals=
= Entity template events =
*Entity - The concrete entity that is being spawned.
*[[Ylands:Tile - Entity Template On Entity Spawn|On Entity Spawn]]


=Entity Template In Use=
= Related instructions =
# Select Entity Template from the game logic.
*[[Ylands:Tile - Spawn entity template|Spawn Entity From Template]]
# Open its Object Properties and select the entity you want to save to the template.
# Use the "On Entity Spawn" event and add some logic you want to happen when an entity spawns from the template. In this case, we are using "Play Particle" to add some sparks on position, where the entity spawns.
# Set up trigger to spawn the entity. There are multiple types of logic and entity scripts by which can be the template called. In this case, we are using time trigger.


Calling the template can be done with two script tiles "Spawn Entity Template". One spawns the entity inside a container, the second one on a particular position. Use the first slot to choose the template you want to use for the trigger.


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


{{Game logic list}}
[[Category: Ylands 0.10]]
[[Category: Game Logic]]

Latest revision as of 14:21, 24 November 2023

Description

Template for spawning new entities - either items, NPCs or vehicles. All atributes (HP, color etc) set in entity template will be carried over to newly spawned entity. New entities are spawned using Spawn Entity instruction.

  • All atributes picked to the entity template will be transfered to the spawned entity.
  • Attributes of picked entity can be modified directly in the Template
  • Template remembers the entity in state when it was picked. Thus the entity can be removed after being picked.

Properties

Entity

  • Entity to be spawned
  • Click to edit entity properties

Entity template events

Related instructions