Outfit Export/Import Refactoring Work
Added 2018-12-13 09:06:32 +0000 UTCA few days ago I sat down to get to work defining the new special characters for v0.12. One of the first things that involves is creating custom wardrobes for the character. The system in v0.11 and previous versions of the game had all of the outfits laid out inside the source code of LR2, which caused two problems:
1) The wardrobes are clunky and fill up space in files that would otherwise be nice and neat functional bits of code.
2) I didn't have a way of exporting an outfit from the outfit creator into the game files permanently. Any outfits added had to be created in the outfit creator, exported as text, then manually reentered into the source code.
An old outfit entry would look something like:
sexy_overwear_2 = Outfit("Sexy Overwear 2")
sexy_overwear_2.add_accessory(lace_choker.get_copy(), colour_black)sexy_overwear_2.add_feet(high_heels.get_copy(), colour_black)
sexy_overwear_2.add_lower(booty_shorts.get_copy(), colour_black)
sexy_overwear_2.add_upper(tanktop.get_copy(), colour_black)
...
default_wardrobe.add_outfit(sexy_overwear_2)
So before I got to work on the new characters I decided to save myself some time in the long run and revamp the whole outfit import/export scheme of LR2. As of v0.12 wardrobes, and inside of them outfits, will be stored in an external .xml file and read in at the start of a new game. An xml file can be thought of like a branching tree with the wardrobe as the base and individual clothing items as the leaves. The branches go: Wardrobe->Set>Outfit->Clothing Item. In practice that produces a file that looks something like:
Wardrobe<name>
--FullSets
----Outfit<name>
------UpperBody
--------Item<name, colour>
------LowerBody
--------Item<name, colour>
--------Item<name, colour>
------Feet
--------Item<name, colour>
------Accessories
--------Item<name, colour>
--UnderwearSets
----Outfit<name>
.
.
.
--OverwearSets
----Outfit<name>
.
.
.
In addition to making my life easier these changes have made a few other things possible. First, sharing outfits is now as easy as exporting the outfit and copy-pasting it into the default wardrobe file. Second, you can now create outfits and add them to the pool of outfits used by randomly generated character. Third, mods can now easily add their own wardrobe files to the game and have them either be used by individual characters or by everyone in the game.
There are a few other changes and improvements I'd like to make, if I can find the extra time. Now that it's easy to import an outfit from a file I would like to add the option to do so in the outfit manager. This would let you load outfits from either the default wardrobe or a separate file entirely and use them as a base. I'd also like to add an interface in LR2 itself to allow you to add or remove outfits from the default wardrobe without having to modify the raw xml.
Now that the key improvements to the outfit creation process have been made I can move on to creating the characters and outfits for Lily, Nora, Alexia, and the main character's mother Jennifer.
Comments
The best way to get in touch with me is either a direct message here on Patreon or an email to vrengames@gmail.com.
Vren
2018-12-17 07:23:54 +0000 UTCI have a few questions about some small edits to the game script, is there anywhere I can ask you a few questions about how I would go about that?
Damion Gundlach
2018-12-16 20:55:08 +0000 UTCEditing existing outfits would be great too!
Damion Gundlach
2018-12-13 16:01:46 +0000 UTC