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; i guess that this is a problem with the values. mmmm im thinking.............
-
04-13-2006, 06:14 PM #1531Developer

- Registriert seit
- Mar 2006
- Ort
- Guadalajara
- Beiträge
- 958
- Points
- 7.499
- Level
- 57
- Downloads
- 0
- Uploads
- 0
i guess that this is a problem with the values. mmmm im thinking..........
-
04-13-2006, 06:28 PM #1532Developer

- Registriert seit
- Mar 2006
- Ort
- Guadalajara
- Beiträge
- 958
- Points
- 7.499
- Level
- 57
- Downloads
- 0
- Uploads
- 0
Zitat von TeamOverload
the most common are .wav, .it, .xm
if the the size of the sound is higher than 5mb the game could be slower.
correct me if im wrong.Geändert von MEXICANSNAKE (04-13-2006 um 06:41 PM Uhr)
-
04-13-2006, 06:30 PM #1533sceKernelExitGame();
- Registriert seit
- Jan 2006
- Ort
- New York
- Beiträge
- 3.126
- Points
- 19.955
- Level
- 89
- Downloads
- 0
- Uploads
- 0
yeah i cant find any more bugs in the code
, i wish i could figure this out!!!
-
04-14-2006, 06:14 AM #1534
it means something is wrong in the first line of your file. Post that because green=Color.new(0,255,0) is correct
Zitat von bronxbomber92
BTW
screenprint()
should be
screen
rint()
so with a ":"LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
04-14-2006, 07:29 AM #1535
aside from what yall are talking about, how would i make a small loop inside a bigger loop? So i could hit break and have my code start over from the begining.
-
04-14-2006, 07:45 AM #1536QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- Puerto Rico
- Beiträge
- 310
- Points
- 7.109
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Sorry I never checked yours. Thanks for your help. It works great.
Zitat von c5cha7
-
04-14-2006, 08:08 AM #1537Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
k... umm I have a loading screen as script.lua and then dofile game.lua but the loading screen keeps looping...

--XBL Gamertag: PhenoM904--
-
04-14-2006, 08:13 AM #153811th Squad Captain
- Registriert seit
- Jun 2005
- Ort
- You are here -----> 名前: アダム | 飲むコー
- Beiträge
- 2.562
- Points
- 26.490
- Level
- 97
- Downloads
- 0
- Uploads
- 0
Post your code and i will have a look :icon_wink .
Zitat von MaSt3r_ShAk3
Or just try this in a while true loop>
while true do
loading=loading+1
if loading 1 > and loading < 50 then
screen:blit(0,0, loadingscreen)
end
if loading 49 > then
back to script code here
end
etc...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-14-2006, 08:16 AM #1539Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
?? it started happening when I added collision detection (based on the tut)

--XBL Gamertag: PhenoM904--
-
04-14-2006, 01:56 PM #1540<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
how do you say does not equal in lua,,
i tried != but that doesnt work,,
-
04-14-2006, 01:58 PM #1541Quality Haxing Since 1991
- Registriert seit
- Oct 2005
- Ort
- Pennsylvania, USA Fi
- Beiträge
- 6.206
- Points
- 29.255
- Level
- 99
- Downloads
- 0
- Uploads
- 0
~=
Zitat von Sousanator
means not equal to.
Zitat von Noriko
-
04-14-2006, 02:12 PM #1542<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
its weird that its not !=, like every other languages i know,
oh well,
thanks though,
-
04-14-2006, 08:18 PM #1543Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
Umm, is there an alternative for collision other than that tutorial? it makes my loading screen loop forever...

--XBL Gamertag: PhenoM904--
-
04-14-2006, 09:59 PM #1544QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
Offtopic: ^^^ what's the story of your screen name?
-
04-15-2006, 03:06 AM #1545
Hey MaSt3r_ShAk3 whats that tutorial your talking about? Mind giving me the link?
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
04-15-2006, 03:15 AM #1546QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
-
04-15-2006, 03:20 AM #1547Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
how do i insert a pause, i have text apear but the next line of text comes to quick

-
04-15-2006, 03:22 AM #1548
Yeah i just found it myself, thx though!
Zitat von PopcOrn DeVil
@Mori
Use screen.waitVblanck([miliseconds]) or whatever the code exactly is. Where miliseconds is the amount of miliseconds you want the pause to be.LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
04-15-2006, 03:45 AM #1549Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
thank you

-
04-15-2006, 03:52 AM #1550Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
it did not work

-
04-15-2006, 04:33 AM #1551Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
How do i get a background that is the size of the screen?
also how could i get it to change the pick when a button is pressedGeändert von GWKYOU (04-15-2006 um 04:37 AM Uhr) Grund: also

-
04-15-2006, 04:49 AM #1552
By making it 480x272
Zitat von Mori
something like this worksalso how could i get it to change the pick when a button is pressed
pad=Controls.read()
if pad:cross() then
screen:blit(0,0,[otherpic],0,0,otherpic:width(),oth erpic:height())
endLUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
04-15-2006, 05:01 AM #1553Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
so would i do
Pick1 = Image.load("Pick1.png")
Pick2= Image.load("Pick2.png")
screen:blit(480, 272, Pick1, [alpha = flase])
end
pad=Controls.read()
if pad:r() then
screen:bilt(480, 272, Pick2, [alpha= false])
end
??
-
04-15-2006, 05:10 AM #1554
Almost
Pick1 = Image.load("Pick1.png")
Pick2= Image.load("Pick2.png")
screen:blit(480, 272, Pick1, [alpha = flase])
end <-- this should be gone as there is no loop or anything like that before this
pad=Controls.read()
if pad:r() then
screen:bilt(480, 272, Pick2, [alpha= false])
end
Also the screen:blit thingies should have more arguments, so like this:
screen:blit(0,0,[otherpic],0,0,otherpic:width(),oth erpic:height())LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
04-15-2006, 05:16 AM #1555Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Pick1= Image.load("Pick1.png")
Pick2= Image.load(Pick2.png")
screen:bilt( 480, 272, [Pick1],480,272,Pick1:width(480) , oth erpic:hight(272))
pad=Conrols.read()
if pad.r()then
screen:bilt( 480, 272, [Pick2],480,272,Pick2:width(480) , oth erpic:hight(272))
end
-
04-15-2006, 05:33 AM #1556
Pick1= Image.load("Pick1.png")
Pick2= Image.load("Pick2.png")
screen:blit( 480, 272, Pick1,480,272,Pick1:width () , otherpic:hight())
pad=Conrols.read()
if pad.r()then
screen:blit( 480, 272, Pick2,480,272,Pick2:width () , otherpic:hight())
end
its blit instead of bilt
The "[" and "]" were to show it you should put there your own name they are not to be included
[pic]:width() and height() return the width and height of the pic so you dont need to put those between the brackets.LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
04-15-2006, 06:06 AM #1557Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
I cant seem to get it to work hmm let me upload my Lua
let me know if you see any thing rong
-
04-15-2006, 06:11 AM #1558
This should work (look at the things i changed, because you had some small errors but important ones):
Code:-- Rock actions green = Color.new(255,64,64) upPressed = 'You try to feed your rock' downPressed = 'You pet your rock' leftPressed = 'You Kick your Rock' rightPressed = 'You look at your Rock' LPressed = 'You give our rock some of its meds....' -- you should put this before the loop otherwise it keeps on loading them. Pick1= Image.load("Rock-1.png") Pick2= Image.load("Rock-2.png") -- *****Main Loop****** while true do screen:clear() pad = Controls.read() if pad:down() then screen:print(15,252,downPressed,green) end if pad:left() then screen:print(15,252,leftPressed,green) end if pad:right() then screen:print(15,252,rightPressed,green) end if pad:l() then screen:print(15,252,LPressed,green) end if pad:up() then screen:print(15,252,upPressed,green) end -- Rocks screen:blit( 0, 0, Pick1,0,0,Pick1:width(), Pick1:height()) if pad.r()then screen:blit( 0, 0, Pick2,0,0,Pick2:width(), Pick2:height()) end screen.waitVblankStart() screen.flip() endLUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
04-15-2006, 06:16 AM #1559
Does anybody know what the specs of an IT file should be to run properly? I have 8 bit and 12000kbit/s but only the first 30 seconds will play. Same happens with those specs on an XM file, it drives me nuts!
EDIT: ok it more tests:
It doesn't even play when its 8kHz/16kHz
Plays even shorter when its 11025Hz/22050Hz
Also plays shorter when its 16bit and 12000HzGeändert von Altair (04-15-2006 um 07:22 AM Uhr)
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
04-15-2006, 06:28 AM #1560Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
ty so much



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