removed jolt physics addon as it is now default, started playing with seed generation of playlists
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
@tool
|
||||
extends Node
|
||||
|
||||
@export var generate_playlist_now = false
|
||||
@export_tool_button("Generate Playlist")
|
||||
var playlist_action : Callable = func(): generate_test_playlist()
|
||||
|
||||
@export var checksum_test = false
|
||||
@export var load_playlist_from_file = false
|
||||
@export var hub_world : level_resource
|
||||
@export var maps_in_rotation : Array[level_resource] = []
|
||||
@export var gamemodes_in_rotation : Array[gamemode]= []
|
||||
@export var levels_per_round : int = 5
|
||||
@@ -30,8 +34,37 @@ func generate_playlist() -> void:
|
||||
playlist.append(matches)
|
||||
|
||||
save_playlist(playlist)
|
||||
generate_playlist_now = false
|
||||
|
||||
func generate_test_playlist():
|
||||
var playlist_name = "TEST2"
|
||||
var playlist = []
|
||||
var seed_to_use
|
||||
|
||||
if playlist_name:
|
||||
seed_to_use = hash(playlist_name)
|
||||
else:
|
||||
seed_to_use = randi()
|
||||
|
||||
seed(seed_to_use)
|
||||
|
||||
|
||||
for h in matches_per_year:
|
||||
var matches = []
|
||||
for i in rounds_per_match:
|
||||
var round = []
|
||||
for x in levels_per_round:
|
||||
var gamemode_path = gamemodes_in_rotation.pick_random().resource_path
|
||||
var level_selection = maps_in_rotation.pick_random()
|
||||
var level_details = {
|
||||
"level_path" : level_selection.level_path,
|
||||
"level_name" : level_selection.level_name,
|
||||
"gamemode_path" : gamemode_path
|
||||
}
|
||||
round.append(level_details)
|
||||
matches.append(round)
|
||||
playlist.append(matches)
|
||||
|
||||
GameGlobals.playlist = playlist
|
||||
|
||||
func only_valid_chars(input_string: String) -> String:
|
||||
var valid_chars = ""
|
||||
@@ -66,3 +99,7 @@ func load_playlist():
|
||||
print("no data saved, generating new playlist...")
|
||||
generate_playlist()
|
||||
|
||||
|
||||
|
||||
func _on_gui_input(event: InputEvent) -> void:
|
||||
generate_playlist()
|
||||
|
||||
Reference in New Issue
Block a user