[engine] MP Save Per Player
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
[engine] MP Save Per Player
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.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)
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:
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)
I really had to learn Lua coding...Ravana wrote:I believe you already can do that. Persistent variables + lua for unsynced actions.
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)
Re: [engine] MP Save Per Player
I believe you already can do that. Persistent variables + lua for unsynced actions.
Re: [engine] MP Save Per Player
You also can store/unsotre data from a selected players clients using get/set_global_variable
EDIT:
Sry didnt read Ravannas answer completely.
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.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: [engine] MP Save Per Player
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.Ravana wrote:I believe you already can do that. Persistent variables + lua for unsynced actions.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: [engine] MP Save Per Player
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.
[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)