main #2
@@ -6,17 +6,17 @@ class_name ChunkInfo
|
||||
@export_group("Set Piece Rules (Unique pieces)")
|
||||
@export var exclusive_biome: String = "" # Es: "Forest"
|
||||
|
||||
@export_group("Base exit (no roation)")
|
||||
@export_group("Base exit")
|
||||
@export var north: bool = false
|
||||
@export var est: bool = false
|
||||
@export var south: bool = false
|
||||
@export var west: bool = false
|
||||
|
||||
@export_group("Margin heights (level 0, 1, 2)")
|
||||
@export var height_north: int = 0
|
||||
@export var height_est: int = 0
|
||||
@export var height_south: int = 0
|
||||
@export var height_west: int = 0
|
||||
@export_range(0, 2, 1) var height_north: int = 0
|
||||
@export_range(0, 2, 1) var height_est: int = 0
|
||||
@export_range(0, 2, 1) var height_south: int = 0
|
||||
@export_range(0, 2, 1) var height_west: int = 0
|
||||
|
||||
@export_group("Lamppost")
|
||||
@export var have_lamppost: bool = false
|
||||
|
||||
@@ -19,7 +19,7 @@ func set_particles_node_color(node: GPUParticles3D, new_color: Color) -> void:
|
||||
unique_mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
|
||||
mesh.material = unique_mat
|
||||
|
||||
func turnon() -> void:
|
||||
func turn_on() -> void:
|
||||
if rocket:
|
||||
rocket.emitting = true
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ func _ready() -> void:
|
||||
build_train()
|
||||
_plan_stops()
|
||||
else:
|
||||
print("WARNING: Draw your Path3D!")
|
||||
print("WARNING: Draw Path3D for rails!")
|
||||
|
||||
func build_rails() -> void:
|
||||
var mat_wood = StandardMaterial3D.new()
|
||||
@@ -112,16 +112,16 @@ func build_rails() -> void:
|
||||
rail_piece.add_child(rail_dx)
|
||||
|
||||
func _plan_stops() -> void:
|
||||
var currnet_stops = []
|
||||
var current_stops = []
|
||||
for child in get_children():
|
||||
if child is Marker3D:
|
||||
var offset = curve.get_closest_offset(child.position)
|
||||
currnet_stops.append({
|
||||
current_stops.append({
|
||||
"offset": offset,
|
||||
"position": child.global_position
|
||||
})
|
||||
currnet_stops.sort_custom(func(a, b): return a["offset"] < b["offset"])
|
||||
for data in currnet_stops:
|
||||
current_stops.sort_custom(func(a, b): return a["offset"] < b["offset"])
|
||||
for data in current_stops:
|
||||
stop_offset.append(data["offset"])
|
||||
stops_position.append(data["position"])
|
||||
|
||||
@@ -130,9 +130,9 @@ func _input(event: InputEvent) -> void:
|
||||
if event.keycode == KEY_T:
|
||||
_goto_next_stop()
|
||||
elif event.keycode == KEY_F:
|
||||
_test_manual_fires()
|
||||
_test_manual_fireworks()
|
||||
|
||||
func _test_manual_fires() -> void:
|
||||
func _test_manual_fireworks() -> void:
|
||||
if fireworks_scene == null or train_instance == null: return
|
||||
|
||||
var firework_number = randi_range(5, 8)
|
||||
@@ -146,8 +146,8 @@ func _test_manual_fires() -> void:
|
||||
|
||||
if fire_root.has_method("set_color"):
|
||||
fire_root.set_color(fireworks_colors.pick_random())
|
||||
if fire_root.has_method("turnon"):
|
||||
fire_root.turnon()
|
||||
if fire_root.has_method("turn_on"):
|
||||
fire_root.turn_on()
|
||||
|
||||
await get_tree().create_timer(randf_range(0.2, 0.6)).timeout
|
||||
|
||||
@@ -260,8 +260,8 @@ func _execute_stop(go_forward: bool = true) -> void:
|
||||
|
||||
if fire_root.has_method("set_color"):
|
||||
fire_root.set_color(fireworks_colors.pick_random())
|
||||
if fire_root.has_method("turnon"):
|
||||
fire_root.turnon()
|
||||
if fire_root.has_method("turn_on"):
|
||||
fire_root.turn_on()
|
||||
|
||||
await get_tree().create_timer(randf_range(0.3, 0.8)).timeout
|
||||
|
||||
|
||||
Reference in New Issue
Block a user