Post edited 8:37 pm – September 22, 2009 by saluk
"Oh Noes! All of my custom art is reset! I can't change the artwork because PyWright automatic updates overwrite my changes! What shall I do!"
Is the cry that has been heard many times. For example, many case authors want to make their game less pywright-y and more phoenix wright-y by replacing the press/present buttons, court record buttons, etc. They go into PyWright/art/general, see the "crossex.png" button that has "z Press" and "x present" in it and think, "Hmm, if I change this, I can fix these buttons so they look more official."
And they are correct. They replace the image, and are happy to find that the new graphics show up in their game.
Then the unfortunate occurs – they update PyWright and all of the graphics go back! So they see two options: 1, never update; 2, don't bother with trying to replace graphics.
Here is the key, PyWright is designed for case authors to be able to override anything*, within their own games. Everything outside of your game folder is the standard by which all PyWright games are created, however that standard can be modified from within your game.
The way you do this, is to mirror the directory structure you find in PyWright, but starting from your game folder instead of the root folder.
PyWright has a specific order in which it looks for things.
When you say "char phoenix" in your code, it follows this search path until it finds a proper Phoenix Wright "normal" blinking pose, and a proper Phoenix Wright "normal" talking pose. The order PyWright searches when it looks for content is:
the current case ("PyWright/games/mygame/mycase")
the current game ("PyWright/games/mygame")
finally, the root path ("PyWright/")
If it is looking for an fg, it will look under "art/fg" starting from each of those starting points. If it is looking for "art/general/buttonpress.png" it will first look at "PyWright/games/mygame/mycase/art/general/buttonpress.png", then "PyWright/games/mygame/art/general/buttonpress.png", and finally "PyWright/art/general/buttonpress.png".
Characters are even more confusing. Say you want your Maya to wear a cowboy hat. If you only replace her speaking pose, with "PyWright/games/wildwest_adventure/art/port/maya/normal(talk).png", then every time she blinks, her hat will vanish.
It is recommended to put most of your custom work, be it sounds, character files, macro files, or core art that you want to override, in your game's folder. Most art is not going to be completely specific to one case, and there is little benefit to putting it only in the case folder itself. (We'll leave the facts that most custom cases are only one case long so far aside for now). And any art you put at the root is subject to vanish when pywright updates, or, worse, when you distribute your case people playing it will not have your updates.
So, put all of your stuff in PyWright/games/mygame. That is where you should live during the long arduous process of creating your games.
Hope this helps alleviate some confusion.
*You are not yet able to override any of the python code that runs the engine; anything else though can be overridden.