[aquaria] Loading treasures.txt from a mod
Kasoroth
kasoroth at concordant-opposition.net
Tue Feb 15 23:01:50 EST 2011
On 02/15/2011 08:08 AM, Kasoroth wrote:
> On 02/15/2011 03:53 AM, Andrew wrote:
>> On 15/02/2011, at 6:52 PM, Kasoroth wrote:
>>
>>> I recently started experimenting with Aquaria's modding tools, and
>>> one of the first things I tried to do was create custom collectible
>>> treasures. I couldn't find any information about how to load the
>>> treasures.txt file from a mod, so I decided to look at the source to
>>> figure it out.
>>>
>>> After a bit more examination of how the treasure menu works, it
>>> seemed like the problem with adding/modifying collectibles in a mod
>>> was that treasures.txt, stringbank.txt, and menu-treasures.lua were
>>> all loaded only from the main game, and also the number of treasures
>>> (for purposes of next/prev page in the treasure menu) was hard coded
>>> to 32 (2 pages of 16).
>>>
>>> I've created a quick patch that to fix these problems and allow
>>> additional collectibles in mods. I've only recently started looking
>>> at the Aquaria code, so if there is already some other way to do
>>> this that I'm missing, I apologize. I hope this code is useful to
>>> the modders out there.
>>>
>>> Also, I had a problem with my build that did not seem to occur in
>>> the executable included in the Humble Bundle: The loadskin function
>>> in SkeletalSprite was converting the whole path string to lower
>>> case, causing it to fail for mods in my .Aquaria folder. I modified
>>> it to only change the filename (not the whole path) to lower case.
>>>
>>> - Kasoroth
>>> <export_patch.txt>_______________________________________________
>>> aquaria mailing list
>>> aquaria at icculus.org
>>> http://icculus.org/mailman/listinfo/aquaria
>>
>> Hey this sounds great, something I had often thought about myself.
>> Could you do it for other files too, like pets, ingredients,
>> variables, etc?
>>
>> Andrew
>> _______________________________________________
>> aquaria mailing list
>> aquaria at icculus.org
>> http://icculus.org/mailman/listinfo/aquaria
>
> I'll take a look at it this evening. I was considering trying to make
> a more general resource loader for txt, lua and xml files that would
> allow a mod to override any of the original game files that are
> directly referenced in the source code, and eliminate some of the
> repetition of code for "if mod, look in mod path, then base path, else
> look in base path".
>
> -Kasoroth
> _______________________________________________
> aquaria mailing list
> aquaria at icculus.org
> http://icculus.org/mailman/listinfo/aquaria
I've made some additional changes, so the following files can now be
loaded from the mod:
data/treasures.txt
data/ingredients.txt
data/eats.txt
data/pets.txt
data/speedtypes.txt
data/elementeffects.txt
data/warpAreas.txt
data/variables.txt
data/naijaemote.txt
data/stringbank.txt
data/worldmap.txt
data/help_header_mac.txt
data/help_header.txt
data/help_bindsong.txt
data/help_energyform.txt
data/help_start.txt
data/help_end_mac.txt
data/help_end.txt
scripts/particleEffects/ParticleEffects.txt
scripts/songs.lua
scripts/global/menu-treasures.lua
scripts/maps/premap_[sceneName].lua
scripts/maps/map_[sceneName].lua
One other slight change compared to my previous patch is that it now
looks for the menu-treasures.lua file in scripts/global rather than just
scripts, because the mod structure has to match the original game
structure with the new generic loader function that I created.
I haven't done anything yet to deal with any side effects of modifying
these files yet (multiple pages of pets, etc), but I'll try to look at
that tomorrow.
-Kasoroth
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: export_patch2.txt
URL: <http://icculus.org/pipermail/aquaria/attachments/20110215/9d3e227e/attachment.txt>
More information about the aquaria
mailing list