Ноды «Entity»
Материал из CryWiki Russia
Статью пометил сам автор статьи.
Содержание |
Ноды «Entity»
Entity:EntityPos
Описание
This node handles all position related manipulations of the owner entity. All position information of the target entity can be read from the output ports.
Unlike the Entity:GetPos node the output ports of this node are triggered whenever one of the target entities properties changes. It is not possible to manually trigger the Entity:EntityPos node.
Файл:Sandbox RefFlowgraphEntityNodes image001.jpg
In this example the position output port is used with a Vec3:AddVec3 node to perform a simple vector operation.
Inputs
entityId
Used when changing the attached entity dynamically. Displays the name of the node.
pos
Entity will be set to the position entered here.
rotate
Entity will be set to the rotation entered here.
scale
Entity will be scaled to the scale entered here.
Outputs
pos
Position of the entity is output on this port.
rotate
Rotation of the entity is output on this port.
scale
Scale of the entity is output on this port.
fwdDir
Direction of the Y axis of the entity is output on this port.
rightDir
Direction of the X axis of the entity is output on this port.
upDir
Direction of the Z axis of the entity is output on this port.
Entity:EntityInfo
Description
This node outputs the id, name, class and archetype of the target node when triggered. In cases where entity types need to be compared this node is very useful.
Файл:Sandbox RefFlowgraphEntityNodes image002.jpg
In this example the name of the target entity of the Entity:EntityInfo node is compared to a string using a String:Compare.
Inputs
entityId
Used when changing the attached entity dynamically. Displays the name of the node.
Get
Used to trigger the output ports
Outputs
Id
Id of the entity is output on this port.
Name
Name of the entity is output on this port.
Class
Class of the entity is output on this port.
Archetype
Archetype class of the entity is output on this port.
Entity:EntityId
Description
The Entity:EntityId node outputs the entity id of the target entity. The node does not need to be triggered since the entity id never changes.
Файл:Sandbox RefFlowgraphEntityNodes image003.jpg
The entity id is used to define the target of the Movement:MoveEntityTo node in this example.
Inputs
entityId
Used when changing the attached entity dynamically. Displays the name of the node.
Outputs
Id
The entity id is output on this port.
Entity:BeamEntity
Description
The Entity:BeamEntity node is used to beam objects instantly to any position in the level. When the Beam port is triggered the target entity is moved to the position input on the Position port.
Additionally rotation and scale can be set using the input ports to match the beamed entity to another entity. In contrary to the Movement:MoveEntityTo this node performs the position change instantly, instead over time.
Файл:Sandbox RefFlowgraphEntityNodes image004.jpg
An entity is beamed to the position of a tag point.
Inputs
entityId
Used when changing the attached entity dynamically. Displays the name of the node.
Beam
The Beam port starts the repositioning of the entity.
Position
The entity will be beamed to this position.
Rotation
This rotation will be set when the entity is beamed.
Scale
This scale will be set when the entity is beamed.
Outputs
Done
An output on this port is triggered when the entity has been beamed.
Entity:EntitiesInRange
Description
The Entity:EntitiesInRange node takes the positions of two entities and checks if they are in a certain range to each other. Depending on the result of the check the output ports are triggered.
Файл:Sandbox RefFlowgraphEntityNodes image005.jpg
The positions of the player and a tag point are being compared and a positive output is triggered when they are within range of one meter.
Port Description
Inputs
entityId
Used when changing the attached entity dynamically. Displays the name of the node.
Trigger
The Trigger port starts the distance check.
Entity1
The id of the first entity to be compared is input on this port.
Entity2
The id of the second entity to be compared is input on this port.
Range
The distance to be checked.
Outputs
InRange
This Boolean port outputs true if the entities are in range and false if they are not in range.
True
This output port is triggered if the result of the distance check is true.
False
This output port is triggered if the result of the distance check is false.
Entity:AttachChild
Description
This node attaches another entity to its target entity. The child entity will be linked to the target entity until the link is removed.
Файл:Sandbox RefFlowgraphEntityNodes image006.jpg
The child entity defined in the Child input port is attached to the target entity.
Inputs
entityId
Used when changing the attached entity dynamically. Displays the name of the node.
Attach
Child
KeepTransform
DisablePhysics
Outputs
NA
Entity:GetPos
Description
The functionality of this node is similar to the Entity:EntityPos node but instead of triggering the output ports whenever any position information changes it only outputs when triggered to do so.
The only input port is the ‘ Get ’ port, which when triggered outputs the according information on all output ports.
In situations where a constant update is too expensive the Entityy:GetPos should be used instead of theEntityy:EntityPos node which continuously outputs on all ports when any position value changes.
Файл:Sandbox RefFlowgraphEntityNodes image007.jpg
In this example the position output port is used with a Vec3:AddVec3 node to perform a simple vector operation.
Inputs
entityId
Used when changing the attached entity dynamically. Displays the name of the node.
Get
Used to trigger all output ports.
Outputs
Pos
Position of the entity is output on this port.
Rotate
Rotation of the entity is output on this port.
Scale
Scale of the entity is output on this port.
FwdDir
Direction of the Y axis of the entity is output on this port.
RightDir
Direction of the X axis of the entity is output on this port.
UpDir
Direction of the Z axis of the entity is output on this port.
Entity:BroadcastEvent
Description
The Entity:BroadcastEvent node is used to send an event to one or more entities. The entities that will receive this event are specified by inputting a string to the _name_ port. Each entity that has the string which is input there as a part of their name will receive the event set in the _event_ port.
Файл:Sandbox RefFlowgraphEntityNodes image008.jpg
In this example the Entity:BroadcastEvent node is used to send a Kill event to all entities which have the string ‘Enemy_’ in their name.
Inputs:
entityId
Used when changing the attached entity dynamically. Displays the name of the node.
send
This port sends out the event to the target entities.
event
The event name is defined here.
name
The string input here defines which entities will get event.
Outputs
NA
Entity:DetachThis
Description
The Entity:DetachThis node is used to detach entities from its parent entity. Usually the Entity:AttachChild node has been used before to link the target entity to another entity.
The node has two additional ports to set transform an physics settings. When «KeepTransform» is set, the entity will keep its transformation in world space when detached. When «EnablePhysics» is set, physics will be re-enabled again when the entity is detached.
Файл:Sandbox RefFlowgraphEntityNodes image009.jpg
First «MyEntity_1» is attached to «MyEntity_2» using the Entity:AttachChild node. The ID of the child entity is defined using the _Entity:EntityId node. Five seconds later the Entity:DetachThis node is used to detach it again from its parent.
Inputs:
entityId
Used when changing the attached entity dynamically. Displays the name of the node.
Detach
Detaches the target entity from its parent.
KeepTransform
When checked the entity will keep it transformation.
EnablePhysics
Re-enabled physic on the entity when detached.
Outputs
NA
Entity:GetPlayer
Description
The Entity:GetPlayer node is used to detect the player. Unlike the Game:LocalPlayer node, it can be used in Multiplayer once it’s being used by the client. (Will only work for clients. Not servers) Usually, the Entity:GetPlayer node is used to get the Player ID, for example getting the player ID to teleport the player. The node only has one port, the one that outputs the entity ID. («Player»)
Файл:EntityGetPlayer.JPG
First the destination of «Destination» is sent to Entity:BeamEntity, and then the Players ID is sent to the Entity:BeamEntity node. Then, when the game is started, an signal is sent to the Beam input of Entity:BeamEntity so that the chosen player is teleported to the «Destination»
Outputs
Player
The Players entity id is output on this port.