Page 1 of 2

Saving script variables in "cloud"?

Posted: 16 Jun 2014, 15:53
by Dommy
So, if you use custom ui library you can customise your interface and it saves all settings. My question is: can we save our own variables like custom ui does? If yes - how?

Re: Saving script variables in "cloud"?

Posted: 16 Jun 2014, 16:00
by Nerpson
I think yes if you can load a page with your content in a GET variable, you will be able to recover it with another link. If you can, don't forget a password in order to let only your server change your variables.

EX:

Code: Select all

http://script.my-website.com/variables/send.php?name=variable_name&password=password
http://script.my-website.com/variables/get.php?name=variable_name
It's what i would do, not sure it works. In all cases, it's handcrafted method :lol:

Re: Saving script variables in "cloud"?

Posted: 16 Jun 2014, 16:42
by steeffeen
i think it's rather using the local user profile and not a cloud, did you validate that?

@see
http://forum.maniaplanet.com/viewtopic. ... 79&t=28048

Re: Saving script variables in "cloud"?

Posted: 16 Jun 2014, 16:43
by Eole
Variables declared as "persistent" in a manialink script will be saved in the player profile and that's what the CustomUI library does. These variables will be reloaded after a game restart with their latest value. You can declare persistent variable on various classes: CUser, CMap, CMlScript, CMode.
You can check this topic for some explanations. Or take a look into the CustomUI or EliteStats libraries.

Re: Saving script variables in "cloud"?

Posted: 16 Jun 2014, 16:52
by Dommy
okay, so if i fun server with persistent class it will save its variable on my profile, but when im on dedicated one? will this save variable on server account?

anyway can confirm that works, thanks :thumbsup:

SETTINGS ON MANIALINKS :O

EDIT: and if i use ingame manialink script i can move variables between servers? such powerfull :D (ofc with netwrite/netread too)

Re: Saving script variables in "cloud"?

Posted: 16 Jun 2014, 18:16
by spaii
domino54 wrote:EDIT: and if i use ingame manialink script i can move variables between servers? such powerfull :D (ofc with netwrite/netread too)
Nadeo called this feature "script cloud", I'm interested by this one too :)

Any informations concerning script cloud ?

Re: Saving script variables in "cloud"?

Posted: 20 Jun 2014, 13:07
by djhubertus
Eole wrote:Variables declared as "persistent" in a manialink script will be saved in the player profile
So, we can't use persistent variables in scripts but only in manialinks, right? That's bad cause I need to build special manialink layer for data transfer(from persistent to global).

Re: Saving script variables in "cloud"?

Posted: 20 Jun 2014, 13:20
by oliverde8
spaii wrote:
domino54 wrote:EDIT: and if i use ingame manialink script i can move variables between servers? such powerfull :D (ofc with netwrite/netread too)
Nadeo called this feature "script cloud", I'm interested by this one too :)

Any informations concerning script cloud ?
Yes persistent variables are saved in player profile so if you change servers the data is still there.
We have been using this feature in expansion to save custom widget settings of users and it works great

But note that persistent variables can cause the script to slow down sometime you should try and cache the values and check for change every X second.

Re: Saving script variables in "cloud"?

Posted: 20 Jun 2014, 13:25
by Eole
djhubertus wrote:So, we can't use persistent variables in scripts but only in manialinks, right? That's bad cause I need to build special manialink layer for data transfer(from persistent to global).
Persistent variables can also be declared in game mode script. Basically a persistent variable will be saved where the script runs :
- On the server if declared in game mode script.
- On the client if declared in ManiaLink script.

Re: Saving script variables in "cloud"?

Posted: 20 Jun 2014, 13:45
by Dommy
Is it possible to use persistent data in ManiaLink (browser)? Would be useful :)