Where do stored units go in savegames?
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.
Where do stored units go in savegames?
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?
Alternatively, how hard is it to create a stored unit in debug mode?
Re: Where do stored units go in savegames?
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
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.
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.
Re: Where do stored units go in savegames?
It's okay, I worked it out for myself about 10 minutes before you replied, but thanks anyway.