Game logic - Entity template – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
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 then 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.




----
----
{{Ylands scripting navbox}}
{{Ylands scripting navbox}}

Revision as of 18:18, 2 December 2018

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 then 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

Spawn Entity From Template



Template:Ylands scripting navbox