Talk:Wii.py

From WiiBrew
Jump to navigation Jump to search

FOF

could someone try porting FoF? it is written in python Calthephenom 19:35, 19 August 2009 (UTC)

Uh...see WiiPy, this is just a library for PC programs. Xuzz 21:04, 19 August 2009 (UTC)

tutorial

Some tutorial for the basic stuff is needed like how to read the titleid of a wad and stuff like that

I need help please :(

I am trying to play about with some Wii.py stuff, but I'm having some difficulty. Basically what I want to be able to do is-

  1. Unpack WADs
  2. Extract U8 archives
  3. Pack WADs


I am trying to use pywii\wadunpack.py to unpack a WAD, but its not working. I get this error:

C:\Documents and Settings\Inspiron 6000\My Documents\Homebrew\Wii\Tools\icefire-Wii.py-3826ae7\icefire-Wi
i.py-3826ae7>wadunpack.py
Usage: python wadunpack.py <input> <output> ...

C:\Documents and Settings\Inspiron 6000\My Documents\Homebrew\Wii\Tools\icefire-Wii.py-3826ae7\icefire-Wi
i.py-3826ae7>wadunpack.py staticbase.wad staticbase
Traceback (most recent call last):
  File "C:\Documents and Settings\Inspiron 6000\My Documents\Homebrew\Wii\Tools\icefire-Wii.py-3826ae7\ic
efire-Wii.py-3826ae7\wadunpack.py", line 10, in <module>
    Wii.WAD(elem).unpack(elem2)
AttributeError: 'Title' object has no attribute 'unpack'

I already moved the script so its in the same directory as the script wii.py. I have Python, PIL, PyCrypto and wxPython all installed. What's wrong, and can I fix it? Thanks. --SifJar 19:00, 17 October 2010 (CEST)

Just playing with this a bit since you mentioned it... first get the latest version from git with 'git clone http://github.com/icefire/Wii.py.git' then I think the thing is these are source codes that are meant to be incorporated into python code of your own. I was able to use the bns.py to convert a bns file to wav with 'python bns.py -d sound.bin out.wav'. But I had no quick luck unpacking a U8 archive, the example doesn't work, I get an error where U8 is not defined. Dashxdr 23:08, 17 October 2010 (CEST)
ETA: Fixed the U8 unpack example at least... Dashxdr 23:11, 17 October 2010 (CEST)
ETA: Added example of unpacking a WAD file. Dashxdr 23:18, 17 October 2010 (CEST)
Thanks, they're working well. I'll try and work out WAD packing, and add it if I can work it out :p. BTW, I feel its perhaps better to have "sys.argv[2]" as the second argument, so that the user can choose the folder to unpack to. But I guess that's down to personal preference, and a programmer should be able to modify it accordingly. Thanks again. --SifJar 21:12, 18 October 2010 (CEST)
I tried WAD packing, but I can't get it to work. Here's what I got so far:
import Wii, sys

if(len(sys.argv) < 3):
	print "Usage: python wadpack.py <input> <output> ..."
	sys.exit(0)

wadf = Wii.WAD.loadDir(sys.argv[1])
wadf.dump(sys.argv[2])
I had a look at your code, and I couldn't really see where the "loadFile" function came from? I dunno, perhaps I should learn Python a little before attempting this :p --SifJar 21:23, 18 October 2010 (CEST)
I'm out of town on a work project, so can't offer much help except advice. I'm not an expert at python at all, just messed with the code a bit to get it working. I did notice that those tools fail on some files. I've got some unpacking of WAD files working with 'c' tools I'm putting together, and my unpacked files match the SHA1 sums perfectly, but I'm not sure if Wii.py's do. As an example, I've unpacked a Wad with Wii.py and then tried to unpack a U8 file, and Wii.py errored out. But the U8 unpack worked fine on my unpack of the same wad. So my take is Wii.py WAD support is iffy, but the U8 support seemed better. Dashxdr 02:38, 19 October 2010 (CEST)