Check how generated buildings were distinguished from manually created in previous editor #21

Closed
opened 2024-09-07 20:34:56 +00:00 by slapin · 3 comments
Owner
No description provided.
slapin added this to the Open World Editor in C++ project 2024-09-07 20:34:56 +00:00
slapin added a new dependency 2024-09-07 21:30:37 +00:00
slapin added a new dependency 2024-09-07 21:31:26 +00:00
slapin added this to the September15 milestone 2024-09-07 21:38:48 +00:00
Author
Owner

The code to remove generated buildings is kind of meh....

func remove_generated_stuff():
	var lookup = buildings.keys().duplicate()
	var prefixes = ["empty", "foundation30", "foundation60", "sideroad-start",
					"terrain-parking", "residental-house",
					"terrain-navigation", "power-pole", "zebra",
					"terrain-road-segment",
					"terrain-road-segment-long",
					"business-store",
					"business-bar", "business-cafe", "empty", "bus-stop"]
	for kd in lookup:
		var hn = buildings[kd].id
		for pfx in prefixes:
			if hn.begins_with(pfx):
				buildings.erase(kd)
	for b in  spawned_buildings.keys():
		var sp = spawned_buildings[b]
		building_pool.unparent_building(sp[0], sp[1])		
	spawned_buildings.clear()
The code to remove generated buildings is kind of meh.... ```gdscript func remove_generated_stuff(): var lookup = buildings.keys().duplicate() var prefixes = ["empty", "foundation30", "foundation60", "sideroad-start", "terrain-parking", "residental-house", "terrain-navigation", "power-pole", "zebra", "terrain-road-segment", "terrain-road-segment-long", "business-store", "business-bar", "business-cafe", "empty", "bus-stop"] for kd in lookup: var hn = buildings[kd].id for pfx in prefixes: if hn.begins_with(pfx): buildings.erase(kd) for b in spawned_buildings.keys(): var sp = spawned_buildings[b] building_pool.unparent_building(sp[0], sp[1]) spawned_buildings.clear() ```
Author
Owner

This function is called from lines editor. Probably this can go to world code and have a command runnable from editor.
And list of prefixes should live in config.

This function is called from lines editor. Probably this can go to world code and have a command runnable from editor. And list of prefixes should live in config.
Author
Owner

Need to implement building erase function beforehand.

Need to implement building erase function beforehand.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: slapin/streaming_world#21
No description provided.