User Tools

Site Tools


request_entity

Request Entity


Prompts the player for an entity using the cursor. The selected entity is returned by this function and can be stored into a property or variable for further action.

Signature:

request_entity(validation_func)
ArgumentDescriptionTypeRequired
validation_funcName of custom function that is called to validate the entity at the current cursor location. If supplied, this function should have one input argument, into which the current entity will be passed.StringNo

Example:

function validate_entity($selected) begin
  $entity_type = $selected.type;
  return $entity_type == OBJECT;
end;
$result = request_entity("validate_entity");

Results: Prompts the player for an entity. The custom “validate_entity” function is called to validate whether or not the entity at the current cursor location is an object.

Use the Request Entity function as a way for the player to dynamically manipulate the scene, for example to pick a decorative object in their house and then rotate or scale it.


Editor Node:

Visual Demo:

request_entity.txt · Last modified: 2022/03/14 21:43 by justin