Skip to content

hard-coded file paths prevent file migrations #283

@RedSPINE

Description

@RedSPINE

Hello there ! I’m trying to use this plugin, and realized I wasn't free to move the files around without breaking stuff.
Additionally, I went through some code and did not understand why those hard-coded file paths were needed.

For example, in global_state_data.gd, the filepath of game_state.gd is given through method parameters, but I do not understand why those 4 lines :

func get_state(key_name : String, state_type_path : String) -> GameState:
	var new_state : Resource
	var new_state_script = load(state_type_path)
	if new_state_script is GDScript:
		new_state = new_state_script.new()

Could not be replaced by one line :

func get_state(key_name : String, state_type_path : String) -> GameState:
	var new_state : Resource = GameState.new()

Erasing the need to submit the file path for the game_state script and allowing me to move it around without breaking anything.

I am no expert and would like to be enlightened 😆 thank you !

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions