Where do stored units go in savegames?

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Chris NS
Posts: 540
Joined: May 6th, 2006, 3:22 pm
Location: Where the Queen lives

Where do stored units go in savegames?

Post by Chris NS »

Quick question: I'm trying to copy a stored unit from one savegame to another savegame for debug purposes, but I can't find it anywhere. Do you know where I should find it?

Alternatively, how hard is it to create a stored unit in debug mode?
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Where do stored units go in savegames?

Post by Dugi »

Creating a stored unit in debug mode is quite hard, the easiest way would be to create a unit (for the sake of the rest of the code, let's say that it was on 32,24), edit it as you want and then store it using the command lua wesnoth.wml_actions.store_unit{ variable="my_awesome_stored_unit" , kill=true , { "filter" , { x=32 , y=24 }} } (stores the unit on 32,24 to variable named my_awesome_stored_unit).

In save files, they are stored in the general [variables] tag, the easiest way to find it would be to look for the name of the variable you stored it into in square brackets (you stored it into transfer_store, you look for [transfer_store]).

If you want to do that repeatedly, I recommend using PersistenceWML.
User avatar
Chris NS
Posts: 540
Joined: May 6th, 2006, 3:22 pm
Location: Where the Queen lives

Re: Where do stored units go in savegames?

Post by Chris NS »

It's okay, I worked it out for myself about 10 minutes before you replied, but thanks anyway.
Post Reply