Saving script variables in "cloud"?

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
Dommy
Translator
Translator
Posts: 1866
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Saving script variables in "cloud"?

Post 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?
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
User avatar
Nerpson
Translator
Translator
Posts: 1554
Joined: 27 Sep 2013, 18:02
Location: France
Contact:

Re: Saving script variables in "cloud"?

Post 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:
ImageImageImageImage
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Saving script variables in "cloud"?

Post 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
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    Eole
    Nadeo
    Nadeo
    Posts: 1265
    Joined: 26 Apr 2011, 21:08

    Re: Saving script variables in "cloud"?

    Post 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.
    Contribute to the ManiaPlanet documentation on GitHub
    A question about ManiaScript? Ask it here!
    User avatar
    Dommy
    Translator
    Translator
    Posts: 1866
    Joined: 25 Aug 2011, 21:45
    Location: Poland
    Contact:

    Re: Saving script variables in "cloud"?

    Post 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)
    Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
    FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

    Contact me via GALAXY & PURSUIT DISCORD
    User avatar
    spaii
    Posts: 1075
    Joined: 19 Jun 2010, 00:04
    Location: Rémy - France
    Contact:

    Re: Saving script variables in "cloud"?

    Post 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 ?
    User avatar
    djhubertus
    Translator
    Translator
    Posts: 1097
    Joined: 09 Jul 2012, 18:30
    Location: Poland
    Contact:

    Re: Saving script variables in "cloud"?

    Post 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).
    My Gamemodes:
    MP4 - Countdown, Firefight
    MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
    MP2 - Search & Destroy, Oscillation, Instagib
    oliverde8
    Posts: 1286
    Joined: 16 Jun 2010, 07:33
    Location: in a Blue Box

    Re: Saving script variables in "cloud"?

    Post 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.
    Image
    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...
    User avatar
    Eole
    Nadeo
    Nadeo
    Posts: 1265
    Joined: 26 Apr 2011, 21:08

    Re: Saving script variables in "cloud"?

    Post 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.
    Contribute to the ManiaPlanet documentation on GitHub
    A question about ManiaScript? Ask it here!
    User avatar
    Dommy
    Translator
    Translator
    Posts: 1866
    Joined: 25 Aug 2011, 21:45
    Location: Poland
    Contact:

    Re: Saving script variables in "cloud"?

    Post by Dommy »

    Is it possible to use persistent data in ManiaLink (browser)? Would be useful :)
    Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
    FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

    Contact me via GALAXY & PURSUIT DISCORD
    Post Reply

    Return to “ManiaScript”

    Who is online

    Users browsing this forum: No registered users and 1 guest