Lua Programming Help Thread
This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; IS it possible to convert a WAV file to a IT file? If so how? Thankyou....
-
04-16-2006, 07:47 AM #1621Developer

- Registriert seit
- Mar 2006
- Ort
- Isle of Wight
- Beiträge
- 491
- Points
- 12.360
- Level
- 72
- Downloads
- 0
- Uploads
- 0
IS it possible to convert a WAV file to a IT file? If so how? Thankyou.
-
04-16-2006, 09:05 AM #1622<img src="images/smilies/psp.gif" border="0" alt="" title="" cl***="inlineimg" /> <img src="images/smilies/Punk.gif" border="0" alt="" title="" cl***=&

- Registriert seit
- Jun 2005
- Ort
- Canada
- Beiträge
- 1.944
- Points
- 11.105
- Level
- 69
- Downloads
- 0
- Uploads
- 0
look at some prievous games that use the highscore save thing,,
Zitat von PopcOrn DeVil
like shines snake or other ones,,
Edit: on another note,, how do you say
if num1 == n1 or num1 == n2 or num1 == n3 or num1 == n4 or num1 == n5 or num1 == n6 then
<whatever>
easily???(less lines of code)Geändert von Sousanator (04-16-2006 um 09:18 AM Uhr)
-
04-16-2006, 12:03 PM #1623Think, Do, Gloat.
- Registriert seit
- Nov 2005
- Ort
- England, Norwich
- Beiträge
- 1.422
- Points
- 12.687
- Level
- 73
- Downloads
- 0
- Uploads
- 0
You should have just asked on MSN, but yes it is possible.
Zitat von kozine
Just use open mod plug.
Open up the wav, and just press save and it will be an IT, alternatively...just send it to me now...
-
04-16-2006, 12:34 PM #1624Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
question: it is ok with pspmillionaire if i used his bullet firing snippet, but edited it a little??i cant think of any other way to fire bullets.
--------------------------------------------------------------------------------------
-
04-16-2006, 12:43 PM #1625Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
Im sure it is. Everything lua is open source

--XBL Gamertag: PhenoM904--
-
04-16-2006, 12:46 PM #1626Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
Does anyone know of a site where I can get sound effects in wav format?

--XBL Gamertag: PhenoM904--
-
04-16-2006, 12:50 PM #1627QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
What's wrong with this code? It wont work at all.
background = Image.load("background.pn g")
mouse1 = Image.load("mouse1.png")
mouse.x = 100
mouse.y = 272
while true do
screen:blit(0, 0, background, false)
end
pad = Controls.read
if pad:up() then
mouse.y = mouse.y + 1
screen:blit(mouse.x, mouse.y, mouse1)
end
if pad:down() then
mouse.y = mouse.y - 1
screen:blit(mouse.x, mouse.y, mouse1)
end
if pad:left() then
mouse.x = mouse.x - 1
screen:blit(mouse.x, mouse.y, mouse1)
end
if pad:right() then
mouse.x = mouse.x + 1
screen:blit(mouse.x, mouse.y, mouse1)
end
-
04-16-2006, 12:52 PM #162811th Squad Captain
- Registriert seit
- Jun 2005
- Ort
- You are here -----> 名前: アダム | 飲むコー
- Beiträge
- 2.562
- Points
- 26.490
- Level
- 97
- Downloads
- 0
- Uploads
- 0
I am looking for the same thing :icon_wink .
Zitat von MaSt3r_ShAk3
I found a site that has .mod sounds though >
http://www.modarchive.com/FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
Currently Working On: - Flashmod V2.50 - Flashmod V2.60
Currently Drinking: Coffee! - 私はコーヒーを飲む
Chao Garden: DEMO v0.6
Chao Garden V0.5b Review!
-
04-16-2006, 12:53 PM #1629TheMarioKartersGuest
Unless you compile it.
Zitat von MaSt3r_ShAk3
-
04-16-2006, 12:54 PM #163011th Squad Captain
- Registriert seit
- Jun 2005
- Ort
- You are here -----> 名前: アダム | 飲むコー
- Beiträge
- 2.562
- Points
- 26.490
- Level
- 97
- Downloads
- 0
- Uploads
- 0
Fixed!
Zitat von montrob
Your while true loop was wrong ;) .
Your suppost to include your pad functions
then put end at the end of your code.FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
Currently Working On: - Flashmod V2.50 - Flashmod V2.60
Currently Drinking: Coffee! - 私はコーヒーを飲む
Chao Garden: DEMO v0.6
Chao Garden V0.5b Review!
-
04-16-2006, 01:02 PM #1631QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
I still get this error - "attempt to index global 'mouse' <a nil value>
-
04-16-2006, 01:58 PM #1632Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
1 moe queston: how would i make collision for a stick figure?? would i have to do it in seperate parts?
thx.
--------------------------------------------------------------------------------------
-
04-16-2006, 02:09 PM #1633Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
I found a site http://simplythebest.net/sounds/WAV/WAV_sounds.html
Zitat von c5cha7

--XBL Gamertag: PhenoM904--
-
04-16-2006, 02:13 PM #1634Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
i have done if for my game. u just cant use the magic wand tool in photohop. it has to be rectangular. the collision still works fine tho
Zitat von Grimfate126

--XBL Gamertag: PhenoM904--
-
04-16-2006, 02:24 PM #1635Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
??? huh? my stik figure has a round head. i want it so that when u shoot a bullet at a certain part, and it HITS the part,(thats where the collisions come in)then, it will do something. so how would u do that for a circle. sry, if i sound confusing. thx
Zitat von MaSt3r_ShAk3
P.S. to montrob, try this:
Code:background = Image.load("background.png") mouse1 = Image.load("mouse1.png") mouse.x = 100 mouse.y = 272 while true do screen:blit(0, 0, background, false) screen:blit(mouse.x, mouse.y, mouse1) pad = Controls.read if pad:up() then mouse.y = mouse.y + 1 end if pad:down() then mouse.y = mouse.y - 1 end if pad:left() then mouse.x = mouse.x - 1 end if pad:right() then mouse.x = mouse.x + 1 end screen.waitVblankStart() screen:flip() end--------------------------------------------------------------------------------------
-
04-16-2006, 02:27 PM #1636QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
Zitat von Grimfate126
Didn't work.. every time i try to do something i get this error
"attempt to index global 'mouse' <a nil value>"
What does that mean?
-
04-16-2006, 03:15 PM #1637Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
Ok umm, i need help making sounds play when i die...
i get "attempt to index global 'voice' (a nil value)"Code:ballsound = Sound.load("blip.wav", false) deathsound = Sound.load("magnum.wav", false) deathsound = death ballsound = ball voice = sound:play()
--XBL Gamertag: PhenoM904--
-
04-16-2006, 03:54 PM #1638QJ Gamer Bronze
- Registriert seit
- Oct 2005
- Ort
- Alabama
- Beiträge
- 272
- Points
- 5.975
- Level
- 50
- Downloads
- 0
- Uploads
- 0
your sound variable isnt defined. nothing is assigned to it.
Also what are "death" and "ball"?
You already assigned ballsound and deathsound a value, so what are those that you are assigning directly after?
Try something like this...
Code:ballsound = Sound.load("blip.wav", false) deathsound = Sound.load("magnum.wav", false) local sound = deathsound voice = sound:play()My lua tutorials for PSP - www.evilmana.com/tutorials
PSP Lua CodeBase - Add your own code examples to the codebase! - www.evilmana.com/tutorials/codebase/
-
04-16-2006, 03:54 PM #1639Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
oh, my bad. i figured it out.the correct code:
Zitat von montrob
the problems:Code:white = Color.new(255, 255, 255) background = Image.load("background.png") mouse = Image.load("mouse1.png") mousex = 100 mousey = 172 while true do screen:clear() pad = Controls.read() screen:blit(0, 0, background, false) screen:blit(mousex, mousey, mouse) if pad:up() then mousey = mousey - 1 end if pad:down() then mousey = mousey + 1 end if pad:left() then mousex = mousex - 1 end if pad:right() then mousex = mousex + 1 end screen.waitVblankStart() screen.flip() end
1. the variable mouse.x and mouse.y both have periods in them. is LUA, that means that you are assigning those values to an array. EXAMPLE: if i had an array like this:
and then i put mouse.x = 100 and mouse.y= 170 in my code, and started it, the array would now look like this:Code:mouse = {}
BUT, you didnt have an array so it called it a "nil" value, and gave you an error. get what im saying??Code:mouse = { x = 100, y = 170}
2. u had the variables BEFORE the loading. this is'nt so much a problem, but it could interfere with the coding. so ALWYS load everything first, THEN have the variables, THEN your main code.
3. thisis just a tip: evertime you are blitting the same thing to the screen, NEVER put screen:flip() before each time you blit it. this will cause clipping problems. just put
at the VERY END of your code, IN the main loop.Code:screen.waitVblankStart() screen.flip() end
thats all i saw! hope u understood ur problems, and good luck with whatever ur doing!!


EDIT: PSPMILLIONAIRE, could u help me with my collisions? read my above posts to see the problem i have. thx!Geändert von Grimfate126 (04-16-2006 um 03:58 PM Uhr)
--------------------------------------------------------------------------------------
-
04-16-2006, 04:03 PM #1640QJ Gamer Bronze
- Registriert seit
- Oct 2005
- Ort
- Alabama
- Beiträge
- 272
- Points
- 5.975
- Level
- 50
- Downloads
- 0
- Uploads
- 0
Grim you will have to use what is called "pixel perfect collision" .
There are solutions for doing this posted all over the internet. Find an example with a simple BASIC language. It will be very much like lua.My lua tutorials for PSP - www.evilmana.com/tutorials
PSP Lua CodeBase - Add your own code examples to the codebase! - www.evilmana.com/tutorials/codebase/
-
04-16-2006, 04:08 PM #1641Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
I tried it... it freezes after the loading screen
Zitat von PSPMillionaire
andi was a little confused by ur tuts on the ball and death thingGeändert von Mast3r_Shak3 (04-16-2006 um 04:14 PM Uhr)

--XBL Gamertag: PhenoM904--
-
04-16-2006, 04:46 PM #1642QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
Ya i get what your sayin now.. But now it says
"attempt to index a global 'pad' <a function value>
-
04-16-2006, 05:09 PM #1643Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
oh whoops(again), here is the fixed code:
Zitat von montrob
and if it gives u another error, tell me what line its on, but this exact code worked for me.Code:white = Color.new(255, 255, 255) background = Image.load("background.png") mouse = Image.load("mouse1.png") mousex = 100 mousey = 172 while true do screen:clear() pad = Controls.read() screen:blit(0, 0, background, false) screen:blit(mousex, mousey, mouse) if pad:up() then mousey = mousey - 1 end if pad:down() then mousey = mousey + 1 end if pad:left() then mousex = mousex - 1 end if pad:right() then mousex = mousex + 1 end screen.waitVblankStart() screen.flip() end--------------------------------------------------------------------------------------
-
04-16-2006, 05:13 PM #1644QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
ok thx now i can move on
-
04-16-2006, 05:17 PM #1645Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
what u working on?
Zitat von montrob
--------------------------------------------------------------------------------------
-
04-16-2006, 05:41 PM #1646QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
I'll tell you once i get a little bit further..
Zitat von Grimfate126
As for now.. what do you put for the word "AND" like this:
Code:if mousex == 135 "AND" -- what would you put there? if mousey == 151
-
04-16-2006, 05:46 PM #1647QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
What you mean like if pad:down() and pad:up() then?
if mousex == 135 and mousey == 151 then
-
04-16-2006, 05:48 PM #1648QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
oh.. thx lol
-
04-16-2006, 06:10 PM #1649QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
I got this error:
'end' expected <to close 'while' at line 10> near '<eof>'
-
04-16-2006, 06:11 PM #1650QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
add an end at the end of your while statment


LinkBack URL
About LinkBacks
Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum