Hi,
strange enough, but I did not find a solution for a simple problem:
I want to write some text (setting, player data or whatever) in a local file with maniascript. Is that even possible? And if yes: how?
Reading from a local file with Http.CreateGet() is easy enough, though.
A short answer containing a very short code snippet wopuld be sufficient.
Thx,
crimplene
write text to local file with maniascript
Moderator: English Moderator
Re: write text to local file with maniascript
No need to make fun of me
A simple "Impossible!" would have been enough. So I have to write some shitty http requests and have to deal with all that asynchronous stuff. A small problem with an overly complex solution...
A simple "Impossible!" would have been enough. So I have to write some shitty http requests and have to deal with all that asynchronous stuff. A small problem with an overly complex solution...
Re: write text to local file with maniascript
To be honest, if all you want to do is store some small amounts of user data for a player, you could do a "declare for".
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own.
Check out openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Forum moderator, opinions are my own.
Check out openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Re: write text to local file with maniascript
Problem is, I need to persist the data.
Re: write text to local file with maniascript
Yes, you do a declare for with the persistent flag. Here's an example from the Turbo scripts:
Code: Select all
declare persistent Integer[Integer] Pers_SettingsSliders for UserMgr.MainUser;
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own.
Check out openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Forum moderator, opinions are my own.
Check out openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Re: write text to local file with maniascript
Very nice solution! I hope the persistent variables are not too limited, since I will have to save like 60 or so local values per player.
Re: write text to local file with maniascript
It is qulite limited no?
We used to use it to store data for the position of each widget in the controller. But it doesen't work since MP4, we keep seing error message "storage limit reached"
viewtopic.php?f=559&t=40383
We used to use it to store data for the position of each widget in the controller. But it doesen't work since MP4, we keep seing error message "storage limit reached"
viewtopic.php?f=559&t=40383
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
Re: write text to local file with maniascript
That heavily limited? I will find a solution where I only need one or two persistent variables - until hopefully someone arives with a working solution for solo campaigns...
- BigBang1112
- Posts: 389
- Joined: 20 Jul 2015, 12:44
- Manialink: bigbang1112
- Location: Czech Republic
- Contact:
Re: write text to local file with maniascript
Can I ask what is the exact limit for a persistent variable?
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
Who is online
Users browsing this forum: No registered users and 2 guests