Tile - YEntity - Spawn Entity – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Ylands scripting navbox}}" to "{{Ylands editor navbox}}")
m (Text replacement - "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}" to "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}")
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Image:Ylands_Tile_-_Spawn_entity1.png]]
<!---
*Allows to '''spawn''' selected entity [[Ylands Tile - Entity prototype literal|'''Prototype''']] to world, either at specific position or in to a container.
THIS PAGE WAS GENERATED AUTOMATICALLY; DO NOT EDIT IT, OTHERWISE YOUR CHANGES WILL BE LOST DURING FUTURE UPDATE.
*Item count cannot be higher than entity stack size, instruction will always create only one entity instance.
-->
== Spawn Entity(Type, Item count, Position, Rotation) ==


[[File:YlandsTile-287.png]]


[[Image:Ylands_Tile_-_Spawn_entity2.png]]
[[File:YlandsTile-287-rv.png]]
*Allows to '''spawn''' entity from a [[Ylands Game logic - Entity template|'''Template''']], either at specific position or in to a container.
 
<pre>static spawnEntity(type: YEntityType, count: number, position: YVector3, orientation: YVector3): YEntity;</pre>
=== Parameters ===
 
==== type ====
 
Entity type to spawn
 
==== count ====
 
Stack size
 
==== position ====
 
Target position
 
==== orientation ====
 
Target rotation
 
=== Returns ===
 
'''YEntity'''
 
=== Availability ===
 
[[Ylands:Tile Availability - Server|Server]]
 
=== Description ===
 
Allows to '''spawn''' selected entity '''Prototype''' at specific position in the world.
 
=== Notes ===
 
* Item count cannot be higher than entity stack size, instruction will always create only one entity instance.
 
== Spawn Entity(Type, Item count, Target) ==
 
[[File:YlandsTile-288.png]]
 
[[File:YlandsTile-288-rv.png]]
 
<pre>static spawnEntity(type: YEntityType, count: number, container: YEntity): YEntity;</pre>
=== Parameters ===
 
==== type ====
 
Entity type to spawn
 
==== count ====
 
Stack size
 
==== container ====
 
Target container / inventory
 
=== Returns ===
 
'''YEntity'''
 
=== Availability ===
 
[[Ylands:Tile Availability - Server|Server]]
 
=== Description ===
 
Allows to '''spawn''' entity from a '''Prototype''' to a container.
 
== Spawn Entity(Template, Position, Rotation) ==
 
[[File:YlandsTile-129.png]]
 
[[File:YlandsTile-129-rv.png]]
 
<pre>static spawn(template: YEntityTemplate, position: YVector3, orientation: YVector3): YEntity;</pre>
=== Parameters ===
 
==== template ====
 
Entity template to be spawned
 
==== position ====
 
Spawn position (vector)
 
==== orientation ====
 
Spawn rotation (vector)
 
=== Returns ===
 
'''YEntity'''
 
=== Availability ===
 
[[Ylands:Tile Availability - Server|Server]]
 
=== Description ===
 
Allows to '''spawn''' selected entity '''Template''' at specific position in the world.
 
=== Notes ===
 
* Item count cannot be higher than entity stack size, instruction will always create only one entity instance.
 
== Spawn Entity(Template, Target) ==
 
[[File:YlandsTile-128.png]]
 
[[File:YlandsTile-128-rv.png]]
 
<pre>static spawn(template: YEntityTemplate, container: YEntity): YEntity;</pre>
=== Parameters ===
 
==== template ====
 
Entity template to be spawned
 
==== container ====
 
Target container / inventory
 
=== Returns ===
 
'''YEntity'''
 
=== Availability ===
 
[[Ylands:Tile Availability - Server|Server]]
 
=== Description ===
 
Allows to '''spawn''' selected entity '''Template''' in to a container.
 
=== Notes ===
 
* Item count cannot be higher than entity stack size, instruction will always create only one entity instance.
* Works also for players and NPCs.




----
----
{{Ylands editor navbox}}
{{Navbox/Ylands}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}


[[Category: Instructions]]
[[Category: Instructions]]
[[Category: Ylands 0.10]]

Latest revision as of 14:27, 24 November 2023

Spawn Entity(Type, Item count, Position, Rotation)

YlandsTile-287.png

YlandsTile-287-rv.png

static spawnEntity(type: YEntityType, count: number, position: YVector3, orientation: YVector3): YEntity;

Parameters

type

Entity type to spawn

count

Stack size

position

Target position

orientation

Target rotation

Returns

YEntity

Availability

Server

Description

Allows to spawn selected entity Prototype at specific position in the world.

Notes

  • Item count cannot be higher than entity stack size, instruction will always create only one entity instance.

Spawn Entity(Type, Item count, Target)

YlandsTile-288.png

YlandsTile-288-rv.png

static spawnEntity(type: YEntityType, count: number, container: YEntity): YEntity;

Parameters

type

Entity type to spawn

count

Stack size

container

Target container / inventory

Returns

YEntity

Availability

Server

Description

Allows to spawn entity from a Prototype to a container.

Spawn Entity(Template, Position, Rotation)

YlandsTile-129.png

YlandsTile-129-rv.png

static spawn(template: YEntityTemplate, position: YVector3, orientation: YVector3): YEntity;

Parameters

template

Entity template to be spawned

position

Spawn position (vector)

orientation

Spawn rotation (vector)

Returns

YEntity

Availability

Server

Description

Allows to spawn selected entity Template at specific position in the world.

Notes

  • Item count cannot be higher than entity stack size, instruction will always create only one entity instance.

Spawn Entity(Template, Target)

YlandsTile-128.png

YlandsTile-128-rv.png

static spawn(template: YEntityTemplate, container: YEntity): YEntity;

Parameters

template

Entity template to be spawned

container

Target container / inventory

Returns

YEntity

Availability

Server

Description

Allows to spawn selected entity Template in to a container.

Notes

  • Item count cannot be higher than entity stack size, instruction will always create only one entity instance.
  • Works also for players and NPCs.