Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions addons/interactive/props/object/object.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ extends Node3D

@export var highlight_material: StandardMaterial3D
@export var new_scene_path: String = "res://addons/interactive/props/window/window.tscn"
@export var game_url: String = "https://play2helpgamesserver.onrender.com/tetrixGame/?to=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM2MDYxMzMwLCJpYXQiOjE3MzU5NzQ5MzAsImp0aSI6IjZmYzlmZDk3MzY0OTQzM2JiOTAwOGM0YWU5MzQxOTUyIiwidXNlcl9pZCI6MTF9.ymAgeQl2e7FxUfe5LWJx8pNvBPvhhnOj_3Qq5T6yTfw"

@onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var chest_meshinstance: MeshInstance3D = $Armature/Skeleton3D/top_Chest_0
Expand All @@ -10,7 +11,11 @@ extends Node3D
var is_open: bool = false
var loaded_scene: Node = null # Store the reference to the loaded scene

# Function to load a new scene
# Function to open the specified URL in the default web browser
func open_game_url() -> void:
OS.shell_open(game_url) # Opens the URL in the default web browser

# Function to load a new scene (if needed)
func load_new_scene() -> void:
var new_scene = load(new_scene_path) # Load the new scene
if new_scene:
Expand All @@ -23,7 +28,7 @@ func unload_scene() -> void:
loaded_scene.queue_free() # Free the loaded scene
loaded_scene = null # Reset the reference to the loaded scene

# Open the chest and load the new scene
# Open the chest and open the game URL
func open() -> void:
is_open = true
animation_player.play("Open")
Expand All @@ -32,13 +37,10 @@ func open() -> void:
tween.tween_property($OmniLight3D, 'light_energy', 11.5, 0.5)
tween.tween_property($OmniLight3D, 'light_energy', 0, 2)

# Load the new scene after opening
load_new_scene()

# Ensure chest remains interactable even after opening
$Interactable.is_interactable = true # Make sure it's interactable
# Open the game URL
open_game_url()

# Close the chest and unload the new scene
# Close the chest and unload the scene
func close() -> void:
is_open = false
animation_player.play("Close")
Expand All @@ -49,9 +51,6 @@ func close() -> void:
# Unload the scene after closing
unload_scene()

# Keep the chest interactable even when it's closed
$Interactable.is_interactable = true # Ensure it's still interactable

# Add highlight effect to the chest
func add_highlight() -> void:
chest_meshinstance.set_surface_override_material(0, chest_material.duplicate())
Expand All @@ -61,9 +60,9 @@ func add_highlight() -> void:
func remove_highlight() -> void:
chest_meshinstance.set_surface_override_material(0, null)

# Toggle the chest's state (open/close) and load/unload the scene on interaction
# Toggle the chest's state (open/close) and open the URL on interaction
func _on_interactable_interacted(_interactor: Interactor) -> void:
# No need to check if the chest is open or closed; simply toggle interaction
# Remove highlight and toggle the chest's state
remove_highlight()
if is_open:
close()
Expand Down
11 changes: 10 additions & 1 deletion addons/interactive/props/object/object.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[gd_scene load_steps=6 format=3 uid="uid://k4kikx3kx4qn"]
[gd_scene load_steps=7 format=3 uid="uid://k4kikx3kx4qn"]

[ext_resource type="PackedScene" uid="uid://bhlk3jlpfm1h0" path="res://addons/interactive/props/chest/source/chest.glb" id="1_w3qd4"]
[ext_resource type="Script" path="res://addons/interactive/props/object/object.gd" id="2_kkw3q"]
[ext_resource type="PackedScene" uid="uid://mwqqyoo76wvc" path="res://data/bots/sophia/sophia_skin.tscn" id="3_sicjq"]
[ext_resource type="PackedScene" uid="uid://bcant1jf3ssg3" path="res://addons/interactive/interaction/Interactable.tscn" id="3_trsna"]

[sub_resource type="BoxShape3D" id="BoxShape3D_clxje"]
Expand All @@ -17,16 +18,21 @@ script = ExtResource("2_kkw3q")
bones/0/rotation = Quaternion(0, 0, 0, 1)
bones/1/rotation = Quaternion(0.75707, 7.00948e-07, 8.12244e-07, 0.653334)

[node name="top_Chest_0" parent="Armature/Skeleton3D" index="0"]
visible = false

[node name="StaticBody3D" type="StaticBody3D" parent="." index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.251476, 0)

[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 2.26042, 0, 0, 0, 1, 0, 0.321079, 0)
shape = SubResource("BoxShape3D_clxje")

[node name="Interactable" parent="." index="3" instance=ExtResource("3_trsna")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.251476, 0)

[node name="CollisionShape3D" parent="Interactable" index="0"]
transform = Transform3D(1, 0, 0, 0, 2.35586, 0, 0, 0, 1, 0, 0.34886, 0)
shape = SubResource("BoxShape3D_frebs")

[node name="OmniLight3D" type="OmniLight3D" parent="." index="4"]
Expand All @@ -35,6 +41,9 @@ light_color = Color(1, 0.972549, 0.345098, 1)
light_energy = 0.0
omni_range = 1.287

[node name="SophiaSkin" parent="." index="5" instance=ExtResource("3_sicjq")]
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -0.0896995, 0.198917, 0.0520527)

[connection signal="focused" from="Interactable" to="." method="_on_interactable_focused"]
[connection signal="interacted" from="Interactable" to="." method="_on_interactable_interacted"]
[connection signal="unfocused" from="Interactable" to="." method="_on_interactable_unfocused"]
Expand Down
70 changes: 70 additions & 0 deletions addons/interactive/props/object/snake.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
extends Node3D

@export var highlight_material: StandardMaterial3D
@export var new_scene_path: String = "res://addons/interactive/props/window/window.tscn"
@export var game_url: String = "https://play2helpgamesserver.onrender.com/snakeGame/?to=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM2MDYxMzMwLCJpYXQiOjE3MzU5NzQ5MzAsImp0aSI6IjZmYzlmZDk3MzY0OTQzM2JiOTAwOGM0YWU5MzQxOTUyIiwidXNlcl9pZCI6MTF9.ymAgeQl2e7FxUfe5LWJx8pNvBPvhhnOj_3Qq5T6yTfw"

@onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var chest_meshinstance: MeshInstance3D = $Armature/Skeleton3D/top_Chest_0
@onready var chest_material: StandardMaterial3D = chest_meshinstance.mesh.surface_get_material(0)

var is_open: bool = false
var loaded_scene: Node = null # Store the reference to the loaded scene

# Function to open the specified URL in the default web browser
func open_game_url() -> void:
OS.shell_open(game_url) # Opens the URL in the default web browser

# Function to load a new scene (if needed)
func load_new_scene() -> void:
var new_scene = load(new_scene_path) # Load the new scene
if new_scene:
loaded_scene = new_scene.instantiate() # Create an instance of the new scene
get_tree().current_scene.add_child(loaded_scene) # Add the new scene to the current scene

# Function to unload the scene
func unload_scene() -> void:
if loaded_scene:
loaded_scene.queue_free() # Free the loaded scene
loaded_scene = null # Reset the reference to the loaded scene

# Open the chest and open the game URL
func open() -> void:
is_open = true
animation_player.play("Open")
# Fade the light in
var tween: Tween = get_tree().create_tween()
tween.tween_property($OmniLight3D, 'light_energy', 11.5, 0.5)
tween.tween_property($OmniLight3D, 'light_energy', 0, 2)

# Open the game URL
open_game_url()

# Close the chest and unload the scene
func close() -> void:
is_open = false
animation_player.play("Close")
# Fade the light out
var tween: Tween = get_tree().create_tween()
tween.tween_property($OmniLight3D, 'light_energy', 0, 2)

# Unload the scene after closing
unload_scene()

# Add highlight effect to the chest
func add_highlight() -> void:
chest_meshinstance.set_surface_override_material(0, chest_material.duplicate())
chest_meshinstance.get_surface_override_material(0).next_pass = highlight_material

# Remove highlight effect from the chest
func remove_highlight() -> void:
chest_meshinstance.set_surface_override_material(0, null)

# Toggle the chest's state (open/close) and open the URL on interaction
func _on_interactable_interacted(_interactor: Interactor) -> void:
# Remove highlight and toggle the chest's state
remove_highlight()
if is_open:
close()
else:
open()
70 changes: 70 additions & 0 deletions addons/interactive/props/object/tetrix.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
extends Node3D

@export var highlight_material: StandardMaterial3D
@export var new_scene_path: String = "res://addons/interactive/props/window/window.tscn"
@export var game_url: String = "https://play2helpgamesserver.onrender.com/tetrixGame/?to=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM2MDYxMzMwLCJpYXQiOjE3MzU5NzQ5MzAsImp0aSI6IjZmYzlmZDk3MzY0OTQzM2JiOTAwOGM0YWU5MzQxOTUyIiwidXNlcl9pZCI6MTF9.ymAgeQl2e7FxUfe5LWJx8pNvBPvhhnOj_3Qq5T6yTfw"

@onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var chest_meshinstance: MeshInstance3D = $Armature/Skeleton3D/top_Chest_0
@onready var chest_material: StandardMaterial3D = chest_meshinstance.mesh.surface_get_material(0)

var is_open: bool = false
var loaded_scene: Node = null # Store the reference to the loaded scene

# Function to open the specified URL in the default web browser
func open_game_url() -> void:
OS.shell_open(game_url) # Opens the URL in the default web browser

# Function to load a new scene (if needed)
func load_new_scene() -> void:
var new_scene = load(new_scene_path) # Load the new scene
if new_scene:
loaded_scene = new_scene.instantiate() # Create an instance of the new scene
get_tree().current_scene.add_child(loaded_scene) # Add the new scene to the current scene

# Function to unload the scene
func unload_scene() -> void:
if loaded_scene:
loaded_scene.queue_free() # Free the loaded scene
loaded_scene = null # Reset the reference to the loaded scene

# Open the chest and open the game URL
func open() -> void:
is_open = true
animation_player.play("Open")
# Fade the light in
var tween: Tween = get_tree().create_tween()
tween.tween_property($OmniLight3D, 'light_energy', 11.5, 0.5)
tween.tween_property($OmniLight3D, 'light_energy', 0, 2)

# Open the game URL
open_game_url()

# Close the chest and unload the scene
func close() -> void:
is_open = false
animation_player.play("Close")
# Fade the light out
var tween: Tween = get_tree().create_tween()
tween.tween_property($OmniLight3D, 'light_energy', 0, 2)

# Unload the scene after closing
unload_scene()

# Add highlight effect to the chest
func add_highlight() -> void:
chest_meshinstance.set_surface_override_material(0, chest_material.duplicate())
chest_meshinstance.get_surface_override_material(0).next_pass = highlight_material

# Remove highlight effect from the chest
func remove_highlight() -> void:
chest_meshinstance.set_surface_override_material(0, null)

# Toggle the chest's state (open/close) and open the URL on interaction
func _on_interactable_interacted(_interactor: Interactor) -> void:
# Remove highlight and toggle the chest's state
remove_highlight()
if is_open:
close()
else:
open()
70 changes: 70 additions & 0 deletions addons/interactive/props/object/yum_bot.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
extends Node3D

@export var highlight_material: StandardMaterial3D
@export var new_scene_path: String = "res://addons/interactive/props/window/window.tscn"
@export var game_url: String = "https://play2helpgamesserver.onrender.com/yumGame/?to=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM2MDYxMzMwLCJpYXQiOjE3MzU5NzQ5MzAsImp0aSI6IjZmYzlmZDk3MzY0OTQzM2JiOTAwOGM0YWU5MzQxOTUyIiwidXNlcl9pZCI6MTF9.ymAgeQl2e7FxUfe5LWJx8pNvBPvhhnOj_3Qq5T6yTfw"

@onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var chest_meshinstance: MeshInstance3D = $Armature/Skeleton3D/top_Chest_0
@onready var chest_material: StandardMaterial3D = chest_meshinstance.mesh.surface_get_material(0)

var is_open: bool = false
var loaded_scene: Node = null # Store the reference to the loaded scene

# Function to open the specified URL in the default web browser
func open_game_url() -> void:
OS.shell_open(game_url) # Opens the URL in the default web browser

# Function to load a new scene (if needed)
func load_new_scene() -> void:
var new_scene = load(new_scene_path) # Load the new scene
if new_scene:
loaded_scene = new_scene.instantiate() # Create an instance of the new scene
get_tree().current_scene.add_child(loaded_scene) # Add the new scene to the current scene

# Function to unload the scene
func unload_scene() -> void:
if loaded_scene:
loaded_scene.queue_free() # Free the loaded scene
loaded_scene = null # Reset the reference to the loaded scene

# Open the chest and open the game URL
func open() -> void:
is_open = true
animation_player.play("Open")
# Fade the light in
var tween: Tween = get_tree().create_tween()
tween.tween_property($OmniLight3D, 'light_energy', 11.5, 0.5)
tween.tween_property($OmniLight3D, 'light_energy', 0, 2)

# Open the game URL
open_game_url()

# Close the chest and unload the scene
func close() -> void:
is_open = false
animation_player.play("Close")
# Fade the light out
var tween: Tween = get_tree().create_tween()
tween.tween_property($OmniLight3D, 'light_energy', 0, 2)

# Unload the scene after closing
unload_scene()

# Add highlight effect to the chest
func add_highlight() -> void:
chest_meshinstance.set_surface_override_material(0, chest_material.duplicate())
chest_meshinstance.get_surface_override_material(0).next_pass = highlight_material

# Remove highlight effect from the chest
func remove_highlight() -> void:
chest_meshinstance.set_surface_override_material(0, null)

# Toggle the chest's state (open/close) and open the URL on interaction
func _on_interactable_interacted(_interactor: Interactor) -> void:
# Remove highlight and toggle the chest's state
remove_highlight()
if is_open:
close()
else:
open()
36 changes: 18 additions & 18 deletions data/assets/meshes/grass_mesh_library.tres

Large diffs are not rendered by default.

272 changes: 136 additions & 136 deletions data/assets/meshes/nature_mesh_library.tres

Large diffs are not rendered by default.

1,220 changes: 610 additions & 610 deletions data/assets/meshes/terrain_mesh_library.tres

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/bots/gdbot/materials/heart_core_mat.tres
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
albedo_color = Color(0, 0, 0, 1)
emission_enabled = true
emission = Color(0, 1, 0.392157, 1)
emission_energy_multiplier = 2.07073
emission_energy_multiplier = 1.88836
Loading