Carpet

Carpet

2M Downloads

read_file() does not seem to be working

crdtrd opened this issue ยท 1 comments

commented

Carpet: 1.4.56
Fabric Loader: 0.12.8
Minecraft: 1.18
read_file() always returns null when trying to read data from a json file in an app-specific directory. I am certain I am using it correctly, at least according to the Scarpet documentation.
Here's the bit of script I was testing when I discovered this:

   `__config() -> (
	{'scope' -> 'global'}
);

__on_start() -> (
	print(read_file('difficulty_progression_data', 'json'):0);
	run(str('difficulty %s', read_file('difficulty_progression_data', 'json'):0));
);

__on_close() -> (
	delete_file('difficulty_progression_data', 'json');
	write_file('difficulty_progression_data', 'json', system_info('game_difficulty'));
);`
commented

As it turns out, I'm just stupid. Ignore my ramblings.