[engine] MP Save Per Player

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderators: Forum Moderators, Developers

Forum rules
Before posting a new idea, you must read the following:
Post Reply
User avatar
watbesh
Posts: 55
Joined: August 29th, 2012, 2:21 am
Location: Kanagawa, Japan

[engine] MP Save Per Player

Post by watbesh » July 24th, 2015, 6:16 pm

Hello.

I'm coding some WML for MP modifications, and I found it could be useful if WML can split save-data for each players to put together later. It's hard to explain, so I use examples.
example 1: Character Sheets:
example 2: Collectible Card Game:
example 3: Rating System:
How it Works
I don't know very well about coding, so this may or may not actually work, but this is the best way of implementing it as far as I can think of.
- A "Load" function in WML, which shows a list of saved data available for the scenario. Keys include; the tag to filter the saves, and the "Empty" data in case the player has no saved data to use.
- A syntax to call the loaded data, so that WML can read and write those like variables. It should act like structures or arrays.
- Auto-save them every side-turn or new-turn, just like done in SP campaigns. Also the data should be able to be saved with a WML "Save" function, and may or may not manually by players. The "Save", automatically or with a WML function, would follow the format of the last "Load" function (plus a file-name if done with a function).
- All players' data could be stored in everyone's computers just in case.

...
(EDIT)
Ravana wrote:I believe you already can do that. Persistent variables + lua for unsynced actions.
I really had to learn Lua coding...
Last edited by watbesh on July 24th, 2015, 6:38 pm, edited 1 time in total.
My MP Eras and Mods with core units and unusual gameplay (version 1.3.1 for Wesnoth 1.12)

User avatar
Ravana
Forum Moderator
Posts: 2244
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: [engine] MP Save Per Player

Post by Ravana » July 24th, 2015, 6:27 pm

I believe you already can do that. Persistent variables + lua for unsynced actions.

gfgtdf
Developer
Posts: 1190
Joined: February 10th, 2013, 2:25 pm

Re: [engine] MP Save Per Player

Post by gfgtdf » July 24th, 2015, 7:03 pm

You also can store/unsotre data from a selected players clients using get/set_global_variable

EDIT:
Sry didnt read Ravannas answer completely.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

User avatar
Pentarctagon
Forum Administrator
Posts: 4056
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: [engine] MP Save Per Player

Post by Pentarctagon » July 24th, 2015, 11:02 pm

Ravana wrote:I believe you already can do that. Persistent variables + lua for unsynced actions.
As of 1.13.1 there's also a synced=yes/no key for [set_menu_item], which when set to "no" will unsync everything done as part of the menu.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
watbesh
Posts: 55
Joined: August 29th, 2012, 2:21 am
Location: Kanagawa, Japan

Re: [engine] MP Save Per Player

Post by watbesh » July 25th, 2015, 1:57 am

Thanks for the replies! I didn't expect that many replies.

[set_global_variable] and [get_global_variable] seem to work. Their wiki page says they allow to let multiple related campaigns communicate with each other, and can be used in MP scenarios.
My MP Eras and Mods with core units and unusual gameplay (version 1.3.1 for Wesnoth 1.12)

Post Reply