Page 1 of 1

write text to local file with maniascript

Posted: 18 Mar 2018, 16:56
by crimplene
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

Re: write text to local file with maniascript

Posted: 18 Mar 2018, 18:21
by adamkooo2
I would like to know that too :)

Re: write text to local file with maniascript

Posted: 18 Mar 2018, 18:46
by crimplene
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...

Re: write text to local file with maniascript

Posted: 18 Mar 2018, 23:08
by Miss
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".

Re: write text to local file with maniascript

Posted: 19 Mar 2018, 09:13
by crimplene
Problem is, I need to persist the data.

Re: write text to local file with maniascript

Posted: 19 Mar 2018, 09:57
by Miss
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;

Re: write text to local file with maniascript

Posted: 19 Mar 2018, 11:49
by crimplene
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

Posted: 19 Mar 2018, 19:24
by oliverde8
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

Re: write text to local file with maniascript

Posted: 19 Mar 2018, 20:15
by crimplene
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... :-)

Re: write text to local file with maniascript

Posted: 23 Nov 2018, 20:03
by BigBang1112
Can I ask what is the exact limit for a persistent variable?