@tool classname triggermultiple extends ValveIONode const FLAGCLIENTS = 1; func…
- User
@tool class_name trigger_multiple extends ValveIONode
const FLAG_CLIENTS = 1;
func get_filter_entity() -> filter_entity: var target_entity = get_target(entity.get("filtername", ""));
if not target_entity: return null; return target_entity as filter_entity;func _entity_ready(): $area.body_entered.connect(func(body): var is_client_passed = has_flag(FLAG_CLIENTS) and ValveIONode.aliases["!player"] == body;
var filter = get_filter_entity(); var is_filter_passed = filter.is_passed(body) if filter else false; if is_client_passed or is_filter_passed: trigger_output("OnTrigger"); trigger_output("OnStartTouch"); ); $area.body_exited.connect(func(body): var is_client_passed = has_flag(FLAG_CLIENTS) and ValveIONode.aliases["!player"] == body; var filter = get_filter_entity(); var is_filter_passed = filter.is_passed(body) if filter else false; if is_client_passed or is_filter_passed: trigger_output("OnEndTouch"); );func _apply_entity(e): super._apply_entity(e);
$area/collision.shape = get_entity_shape(); - Assistant
- User
- Assistant
- User
@tool class_name env_fog_controller extends ValveIONode
func _apply_entity(e): pass;
- Assistant
- User
@tool class_name filter_activator_name extends filter_entity
func is_passed(node: Node3D) -> bool: var is_inverted = str(entity.get("Negated", 0)) == "1"; var target_entity = get_entity(node);
if not target_entity: return false; var is_passed = target_entity.entity.get("targetname", "") == entity.get("filtername", ""); return is_passed if not is_inverted else not is_passed; - Assistant
- User
@tool class_name filter_entity extends ValveIONode
func get_entity(node): if node is ValveIONode: return node; if node.get_parent() == null: return null;
node = node.get_parent(); return get_entity(node);func is_passed(node: Node3D) -> bool: return false;
- Assistant
- User
@tool class_name filter_multi extends filter_entity
const FILTERS_FIELDS = [ "Filter01", "Filter02", "Filter03", "Filter04", "Filter05" ];
func is_passed(node: Node3D) -> bool: var is_or = entity.get("filtertype", 0) == 1; var filters_count = 0; var passed_count = 0;
for field in FILTERS_FIELDS: var filter = get_target(entity.get(field, "")); if not filter: continue; filters_count += 1; if filter.is_passed(node) == is_or: passed_count += 1; if is_or: return passed_count > 0; else: return passed_count == filters_count; - Assistant
- User
@tool class_name FuncDetail extends ValveIONode
func _apply_entity(entityData): super._apply_entity(entityData);
$MeshInstance3D.cast_shadow = entityData.get("disableshadows", 0) == 0; $MeshInstance3D.set_mesh(get_mesh()); $MeshInstance3D/StaticBody3D/CollisionShape3D.shape = get_entity_shape(); - Assistant
- User
@tool extends ValveIONode
var FLAG_IGNORE_PICKUP = 8192; var FLAG_MOTION_DISABLED = 32768;
var body = null;
func _entity_ready(): reparent(get_tree().current_scene);
func EnableMotion(_param): $body.freeze = false;
func DisableMotion(_param): $body.freeze = true;
func _apply_entity(e): super._apply_entity(e);
$body.freeze = has_flag(FLAG_MOTION_DISABLED); $body/mesh.set_mesh(get_mesh()); $body/collision.shape = $body/mesh.mesh.create_convex_shape(true); $body.mass = $body/mesh.get_aabb().size.x * $body/mesh.get_aabb().size.y * $body/mesh.get_aabb().size.z * 0.01; - Assistant
- User
@tool class_name info_particle_system extends ValveIONode
func _apply_entity(e): super._apply_entity(e);
var scene_path = 'res://particles/{effect_name}.tscn'.format(e); if not ResourceLoader.exists(scene_path): push_error('Particle effect not found: {0}'.format([scene_path])); return; var scene = load(scene_path); var node = scene.instantiate(); node.name = "particles"; add_child(node); node.set_owner(get_owner());func _entity_ready(): if get_node_or_null("particles") == null: return; $particles.get_child(0).emitting = entity.get("start_active", 0) == 1;
INPUTS
func Start(_param = null): $particles.get_child(0).emitting = true;
func Stop(_param = null): $particles.get_child(0).emitting = false;
- Assistant
- User
@tool class_name info_player_start extends ValveIONode
var player_entity = load("res://objects/player/player.tscn"); var instance: Player;
func _entity_ready(): instance = Player.instance
if Player.instance
else player_entity.instantiate();get_tree().current_scene.add_child(instance); instance.global_transform.origin = global_transform.origin; instance.rotation.y = convert_direction(entity.get("angle", Vector3.ZERO)).y + PI / 2.0; get_parent().remove_child(self); - Assistant
- User
@tool class_name math_counter extends ValveIONode
var value = 0;
func _entity_ready(): value = float(entity.get("startvalue", 0));
INPUTS
func Add(value_to_add): value += float(value_to_add);
if value >= float(entity.get("max", 0)): trigger_output("OnHitMax"); trigger_output("OutValue");func Subtract(value_to_subtract): value -= float(value_to_subtract);
if value <= float(entity.get("min", 0)): trigger_output("OnHitMin"); trigger_output("OutValue");func Multiply(value_to_multiply): value *= float(value_to_multiply);
if value >= float(entity.get("max", 0)): trigger_output("OnHitMax"); trigger_output("OutValue");func Divide(value_to_divide): value /= float(value_to_divide);
if value <= float(entity.get("min", 0)): trigger_output("OnHitMin"); trigger_output("OutValue");func GetValue(_param = null): trigger_output("OnGetValue");
func SetValue(_param = null): value = activator.value; trigger_output("OutValue");
func SetMinValueNoFire(value_to_set): entity.min = value_to_set; trigger_output("OutValue");
func SetMaxValueNoFire(value_to_set): entity.max = value_to_set; trigger_output("OutValue");
- Assistant
- User
@tool class_name TriggerPush extends trigger_multiple;
var acceleration = Vector3.ZERO; var bodies = [];
const FLAG_PHYSICS_OBJECTS = 8;
const CLIENT_CLASSES = ["CharacterBody3D"]; const PHYSICS_CLASSES = ["RigidBody3D", "KinematicBody3D"];
func _entity_ready(): super._entity_ready();
acceleration = float(entity.speed) * get_movement_vector(entity.pushdir) * config.import.scale; $area.body_entered.connect(func(node): if bodies.has(node): return; var is_rigid_body = node is RigidBody3D and has_flag(FLAG_PHYSICS_OBJECTS); var is_character_body = node is CharacterBody3D and has_flag(FLAG_CLIENTS); if not is_rigid_body and not is_character_body: bodies.append(node); ); $area.body_exited.connect(func(node): if bodies.has(node): bodies.erase(node); );func _physics_process(delta): if Engine.is_editor_hint(): return; if not enabled: return; if not has_flag(FLAG_PHYSICS_OBJECTS) and not has_flag(FLAG_CLIENTS): return;
for body in bodies: var is_rigid_body = body is RigidBody3D; var has_velocity = "velocity" in body; if is_rigid_body: body.apply_force(acceleration, Vector3.ZERO); elif has_velocity: body.velocity += acceleration * delta; - Assistant