biome generator
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[gd_scene format=4 uid="uid://dpstb26gs581l"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c2j2jey3l0hv4" path="res://docs/museums/daynight/scenes/mountain_test/chunck_m_n-o-e-s1.fbx" id="1_anh2f"]
|
||||
[ext_resource type="Script" uid="uid://s1ohbgbpyu5n" path="res://docs/museums/daynight/scenes/mountain_test/info_chunk.gd" id="2_2wsw6"]
|
||||
[ext_resource type="Script" uid="uid://dg2h4kbqe8j3m" path="res://core/biome_generator/chunk_info.gd" id="2_2wsw6"]
|
||||
[ext_resource type="Material" path="res://docs/museums/daynight/scenes/mountain_test/treno3.tres" id="3_grv42"]
|
||||
[ext_resource type="Material" path="res://docs/museums/daynight/scenes/mountain_test/trainchunk.tres" id="4_0s706"]
|
||||
[ext_resource type="Material" path="res://docs/museums/daynight/scenes/mountain_test/treno1.tres" id="5_e6288"]
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
extends Node3D
|
||||
class_name InfoChunk
|
||||
|
||||
@export_enum("Bioma", "Binario_Dritto", "Binario_Curva") var tipo_chunk: int = 0
|
||||
|
||||
@export_group("Regole Set Piece (Pezzi Unici)")
|
||||
@export var bioma_esclusivo: String = "" # Es: scrivi "Foresta"
|
||||
|
||||
@export_group("Uscite Base (Senza Rotazione)")
|
||||
@export var nord: bool = false
|
||||
@export var est: bool = false
|
||||
@export var sud: bool = false
|
||||
@export var ovest: bool = false
|
||||
|
||||
@export_group("Altitudini Bordi (Livelli 0, 1, 2)")
|
||||
@export var altezza_nord: int = 0
|
||||
@export var altezza_est: int = 0
|
||||
@export var altezza_sud: int = 0
|
||||
@export var altezza_ovest: int = 0
|
||||
|
||||
# --- NUOVA AGGIUNTA AUTOMATICA ---
|
||||
func _ready() -> void:
|
||||
# Se hai scritto un bioma nell'Inspector, il pezzo capisce di essere
|
||||
# un pezzo speciale e si aggiunge al gruppo dei fantasmi da solo!
|
||||
if bioma_esclusivo != "":
|
||||
add_to_group("set_pieces")
|
||||
|
||||
# ... qui sotto continua la tua normale funzione get_dati_ruotati() ...
|
||||
|
||||
func get_dati_ruotati(scatti_90_gradi: int) -> Dictionary:
|
||||
var uscite_originali = [nord, est, sud, ovest]
|
||||
var altezze_originali = [altezza_nord, altezza_est, altezza_sud, altezza_ovest]
|
||||
|
||||
var uscite_calcolate = []
|
||||
var altezze_calcolate = []
|
||||
|
||||
for i in range(4):
|
||||
var indice = (i - scatti_90_gradi + 4) % 4
|
||||
uscite_calcolate.append(uscite_originali[indice])
|
||||
altezze_calcolate.append(altezze_originali[indice])
|
||||
|
||||
return {
|
||||
"connessioni": {
|
||||
"nord": uscite_calcolate[0], "est": uscite_calcolate[1],
|
||||
"sud": uscite_calcolate[2], "ovest": uscite_calcolate[3]
|
||||
},
|
||||
"altezze": {
|
||||
"nord": altezze_calcolate[0], "est": altezze_calcolate[1],
|
||||
"sud": altezze_calcolate[2], "ovest": altezze_calcolate[3]
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://s1ohbgbpyu5n
|
||||
Reference in New Issue
Block a user