Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this.
-
Cauan
- Prole
- Posts: 22
- Joined: Thu Mar 09, 2023 5:58 pm
Post
by Cauan »
Hi
I'm trying to get to read the users system in love2d
Is saved using
This is the users system structure:
Code: Select all
users = {{name = 'User'}}
return users
I tried to load it with
But I didn't get success
It have solutions?
--it have the load system
I'm me, and you are you
-
dusoft
- Party member
- Posts: 711
- Joined: Fri Nov 08, 2013 12:07 am
- Location: Europe usually
-
Contact:
Post
by dusoft »
You probably want
function instead, as in:
to include your helpers and modules.
`save` and `write` are used for saving game states usually.
-
Andlac028
- Party member
- Posts: 174
- Joined: Fri Dec 14, 2018 2:27 pm
- Location: Slovakia
Post
by Andlac028 »
See docs for
love.filesystem.load. It loads the code, but doesn’t run it. So you have to do something like:
Code: Select all
local chunk = love.filesystem.load(data_path)
users = chunk()
Or even better, wrap it in pcall or xpcall, so it wouldn’t crash in case of invalid config.
Users browsing this forum: No registered users and 7 guests