FAQ for Application/Game making
I figured it was about time we had one of these since there are a few questions that keep popping up in multiple threads.
Last Updated 18th March 2010 for firmware version 1.11.01
Got a question about programming for the ZEN X-Fi2 and it's not on this list? Why not ask it in a reply to this thread?
Q. I want to make an application/game, but I'm not sure what kind of thing to make, got any ideas?
A. Check out the Application/Game Ideas thread to see what other people have suggested.
Q. I want to make an application/game, but I don't know how to code, can someone teach me?
A. There are a lot of online resources that can teach you the programming language used to make applications for the X-Fi2. Creative have a very useful development kit to help people who want to program applications for it. The development kit also contains an introduction document that gives a lot of useful information on programming for the X-Fi2.
Q. What coding language are the X-Fi2 applications made with?
A. The applications are made with a coding language called Lua. You can read all about it and also get tutorials from the language's main site.
Q. What program should I use to code applications with?
A. Some of the members here use Notepad++ or LuaEdit to make their applications.
Q. My application crashes on my player, what's wrong?
A. You may want to check out Creative's Applications Developer Kit which includes a very useful simulater that can usually tell you where things are going wrong.
Q. Some of the functions from the Lua.org documentation don't seem to work on the X-Fi2, why?
A. Creative decided not to include some of the other functions in their Lua interpreter. The functions that do work are documented at ThievingSix's X-Fi2 Lua Wiki. If you want the functions added, I recommend you head over to the Creative MP3 Player forums and start a thread about it, or contribute a post to one of the other relevant threads.
Q. One of the functions doesn't work like it's supposed to, what's wrong?
A. Some of the functions, such as the thickness in the screen.drawline function and the reading of lines from a file in io.lines don't work entirely correctly. You can report these to Creative through their technical support page. The more people that report the fault, the more likely it is to get fixed!
Q. The sound in my application doesn't work, what's wrong?
A. Make sure the sounds you're using in your application are .WAV files at 44100Hz (44.1kHz), 16bit and stereo. To do this use a program such as Audacity or Formatoz. Got another program you use to alter your .wav files? Why not let the FAQ know?
Q. How do I convert a sound file I have to the right kind of .WAV file using Audacity?
A. Open the sound file you have in Audacity. On the bottom left of the window is a small button called Project Rate. Set the rate to 44100Hz. Once you've done that, click the file menu and "Export as WAV". Done!
Q. My image files don't display on the screen where I want them to, what's wrong?
A. Did you know that the x,y position you give for where on the screen the image should display is the top left pixel of the image, not the center?
Q. The accelerometer doesn't work in the ADK simulator, what's wrong?
A. Creative didn't implement an accelerometer in the simulator, so the only way to test an application that uses the accelerometer is to test it on the X-Fi2 itself. If you get errors, it may be a good idea to look at the code of other people's applications that use the accelerometer and try and figure out where your code went wrong.
Q. My application works in the simulator, but still not on the player, why?
A. There are a number of reasons for this to happen. Sometimes one of the functions hasn't been written properly for the player's Lua interpreter, other times the simulator doesn't account for some of the player's limits. Therefore there are multiple answers to this question;
Q. I've finished my application and it no longer has any errors, where on the net should I post it to share it with people?
A. You can post it on these forums in the Finished Games & Applications sub-forum or at Xeroo.net. Got another place people can share their apps? Why not let the FAQ know with a reply to this thread?
Last edited by Tetrajak; 03-19-2010 at 05:25 AM. Reason: Added more to the F.A.Q.
|application, faq, lua, x-fi2|
|Thread Tools||Search this Thread|
All times are GMT -5. The time now is 10:12 PM.