Update the WorldGenerator module to get the instance() helpers.

This commit is contained in:
Relintai 2020-07-17 20:54:49 +02:00
parent 630db200dc
commit c6429124fb
4 changed files with 22 additions and 33 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": {"3.2": "07b24de868457c0a190c88771e99ff09e5451c3b", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "9a4f9f9809cb4da6d0196a9b37ea480e3cd0c400"}, "entity_spell_system": {"master": "af1bd74fbf38d0ac42d3cf203feb3c7212d01849"}, "ui_extensions": {"master": "6fe4f69fea8d71043b08d959b8085404c9c4fe47"}, "voxelman": {"master": "dee38b1588ef3224cf8022eaf227e1dcaead6277"}, "texture_packer": {"master": "2993ed34f34cfa6a5e61b7913380231e9c55eda6"}, "fastnoise": {"master": "d0e3f1c759332cf0d9a5d7e0e71d0b0278310651"}, "mesh_data_resource": {"master": "85417ebee9198be3cd7cc643e0e0e934db64a620"}, "procedural_animations": {"master": "9226d21781ea05828570e592874aa319df0dc53d"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "544654f49b13af2d25ac14152c8a5014474e6333"}, "mesh_utils": {"master": "4f69ec67b861ce4475cfd17946dfaa586c888d94"}, "broken_seals_module": {"master": "0e5c54a70f8e90f95cbf11419b959a5f67562d48"}, "thread_pool": {"master": "93320fe864128d706bcc47fc7ed0731e6e9bcf69"}}
{"engine": {"3.2": "07b24de868457c0a190c88771e99ff09e5451c3b", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "b70154cbddde9178e1d159a7acb7f738f7c8f487"}, "entity_spell_system": {"master": "af1bd74fbf38d0ac42d3cf203feb3c7212d01849"}, "ui_extensions": {"master": "6fe4f69fea8d71043b08d959b8085404c9c4fe47"}, "voxelman": {"master": "dee38b1588ef3224cf8022eaf227e1dcaead6277"}, "texture_packer": {"master": "2993ed34f34cfa6a5e61b7913380231e9c55eda6"}, "fastnoise": {"master": "d0e3f1c759332cf0d9a5d7e0e71d0b0278310651"}, "mesh_data_resource": {"master": "85417ebee9198be3cd7cc643e0e0e934db64a620"}, "procedural_animations": {"master": "9226d21781ea05828570e592874aa319df0dc53d"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "544654f49b13af2d25ac14152c8a5014474e6333"}, "mesh_utils": {"master": "4f69ec67b861ce4475cfd17946dfaa586c888d94"}, "broken_seals_module": {"master": "0e5c54a70f8e90f95cbf11419b959a5f67562d48"}, "thread_pool": {"master": "93320fe864128d706bcc47fc7ed0731e6e9bcf69"}}

View File

@ -0,0 +1,16 @@
extends Dungeon
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View File

@ -29,16 +29,10 @@ func _setup():
return
var bdata : BiomeData = data.get_biome_data(0)
var b : Biome
if bdata.biome != null:
b = bdata.biome.duplicate()
else:
b = Biome.new()
var b : Biome = bdata.instance()
b.current_seed = current_seed
b.data = bdata
b.setup()
add_biome(b)
@ -47,17 +41,12 @@ func _setup():
var dd : DungeonData = bdata.get_dungeon_data(0)
var dung : Dungeon
if dd.dungeon != null:
dung = dd.dungeon.duplicate()
else:
dung = Dungeon.new()
var dung : Dungeon = dd.instance()
dung.posx = 0
dung.posy = -4
dung.posz = 0
dung.current_seed = current_seed
dung.data = dd
dung.setup()
add_dungeon(dung)

View File

@ -30,25 +30,9 @@ func _setup():
var bdata : BiomeData = data.get_biome_data(0)
var b : Biome
if bdata.target_script != null:
b = bdata.target_script.new()
if b == null:
print("biome is null. wrong type? " + bdata.resource_path)
return
elif bdata.target_class_name != "":
if not ClassDB.class_exists(bdata.target_class_name):
print("class doesnt exists" + bdata.resource_path)
return
b = ClassDB.instance(bdata.target_class_name)
else:
b = Biome.new()
var b : Biome = bdata.instance()
b.current_seed = current_seed
b.data = bdata
b.setup()
add_biome(b)