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; Zitat von MagicianFB http://www.lua.org/pil/index.html#P3 http://luaplayer.org/functions.txt k thanx...
-
10-04-2005, 07:08 AM #31Rock Star

- Registriert seit
- Aug 2005
- Ort
- CT| FW: 4.01 M33-2
- Beiträge
- 11.844
- Points
- 70.899
- Level
- 100
- Downloads
- 0
- Uploads
- 0
k thanx
Zitat von MagicianFB

-
10-04-2005, 08:08 AM #32Developer

- Registriert seit
- Sep 2005
- Ort
- Sweden
- Beiträge
- 941
- Points
- 10.075
- Level
- 67
- Downloads
- 0
- Uploads
- 0
In Lua tutorial 2 you can display pic's when you push a button. But how do I do so the image doesn't disapear directly after a stop pushing the button??I want the picture/text to stay there.
And how do I change the size of the text/numers in my program??
Thanks in advance!
-
10-04-2005, 08:18 AM #33Rock Star

- Registriert seit
- Aug 2005
- Ort
- CT| FW: 4.01 M33-2
- Beiträge
- 11.844
- Points
- 70.899
- Level
- 100
- Downloads
- 0
- Uploads
- 0
can u post ur code??

-
10-04-2005, 09:28 AM #3411th Squad Captain
- Registriert seit
- Jun 2005
- Ort
- You are here -----> 名前: アダム | 飲むコー
- Beiträge
- 2.562
- Points
- 26.490
- Level
- 97
- Downloads
- 0
- Uploads
- 0
HELP (Please)
Hi i really need some help here.
My new game Dragon Ball Portable is very dodgy.
It skatter's around.
Is the code alright?
(Please nobody steal this)
How can i get the Picture to move up aswell???
Code:--c5cha7's DBP (Beta source) --activate usb System.usbDiskModeActivate() --load text colors red = Color.new(255, 0, 0) blue = Color.new(0, 0, 255) green = Color.new(0, 255, 0) black = Color.new(0, 0, 0) white = Color.new(255, 255, 255) --Startup intro = Sound.load("Data/Sounds/intro.wav") luaplayer = Image.load("Data/images/lua.png") intro:play() screen:blit(0, 0, luaplayer) screen.flip(120) screen.waitVblankStart(120) -- Move Player function move() local limit = -11 -- adjust the count limit as needed local pad = Controls.read() if (pad ~= oldpad) or (countpads > limit) then if pad:right() then playerPos = playerPos + 1 if playerPos > 13 then playerPos = 13 end screen.waitVblankStart(2) end if pad:left() then playerPos = playerPos - 1 if playerPos < 0 then playerPos = 0 end screen.waitVblankStart(2) end if pad:up() then playerPos = playerPos - 1 if playerPos < 1 then playerPos = 1 end end if pad == oldpad then countpads = limit - 1 -- for repeatedly advanced else countpads = 0 -- for the first pressed end oldpad = pad else -- do nothing for a moment countpads = countpads + 1 screen.waitVblankStart(5) screen.waitVblankStart(4) screen.waitVblankStart(1) end end player = Image.load "player.png" playerPos = 1 countpads = 0 while true do screen:clear() move() screen:blit(32*playerPos, 120, player) screen.waitVblankStart() screen:flip() endFAVORITE 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!
-
10-04-2005, 10:53 AM #35Developer

- Registriert seit
- Sep 2005
- Ort
- Sweden
- Beiträge
- 941
- Points
- 10.075
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Sorry I forgot to post the code Here it is:
Code:System.usbDiskModeActivate() blue = Color.new(0, 0, 255) orange = Color.new(223, 88, 6) grey = Color.new(94, 97, 111) yellow = Color.new(255, 255, 0) black = Color.new(0, 0, 0) white = Color.new(255, 255, 255) x = 96 y = 96 speed = 3 while true do screen:clear() pad = Controls.read() screen:print(x, y, "+", white) if pad:select() then screen:save("screenshot.tga") end if pad:start() then break end if pad:analogX() < -30 then x = x - speed end if pad:analogX() > 30 then x = x + speed end if pad:analogY() < -30 then y = y - speed end if pad:analogY() > 30 then y = y + speed end if pad:left() then x = x - 3 end if pad:right() then x = x + 3 end if pad:up() then y = y - 3 end if pad:down() then y = y + 3 end if pad:start() then break end if pad:cross() then screen:print(20, 18, "1", white) end screen.waitVblankStart() screen.flip() end
-
10-04-2005, 11:07 AM #36QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
What are the sound limitations in lua?..
I've been trying to make some background music, but what should it be in?
I've got various wavs playing on events but they fail to play when I try to start them at the main menu. I just want some background music.
Cheers.
-
10-04-2005, 11:10 AM #37NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
They can only be wavs.
Zitat von Bilo
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-04-2005, 11:30 AM #38QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
Well in that case, there is something wrong as the background audio I have wont play and it's a wav.
-
10-04-2005, 11:31 AM #39NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Post your script.
Zitat von Bilo
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-04-2005, 11:35 AM #40Developer

- Registriert seit
- Sep 2005
- Ort
- Sweden
- Beiträge
- 941
- Points
- 10.075
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Anyone who can help me with my qustion above??
-
10-04-2005, 11:42 AM #41NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Put the print flip and clear in the if's for the buttons to conrol position.
Zitat von SodR
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-04-2005, 11:43 AM #42QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
Script at start -
sensiblesnd= Sound.load("sensible.wav" )
script to initiate sound -
sensiblesnd
lay()
Geändert von Bilo (10-04-2005 um 11:45 AM Uhr)
-
10-04-2005, 11:51 AM #43Developer

- Registriert seit
- Sep 2005
- Ort
- Sweden
- Beiträge
- 941
- Points
- 10.075
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Could you write an example please? I doesn't exactly undrstand what you mean.
Zitat von MagicianFB
-
10-04-2005, 11:52 AM #44NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
I don't now, that should work.
Zitat von Bilo
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-04-2005, 11:59 AM #45QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
Hmm.. must be the sound file as if I replace one of my other sounds with it, then that sound fails to initiate too.
-
10-04-2005, 12:27 PM #46
I'm having fat-as problem with this really simple thing. But im a noob so...=)
anyway how can I make it so that the program can "back" one screen so that I for instance after pressing a button can go back to the titelscreen?
-
10-04-2005, 12:36 PM #47QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
um...
if pad:triangle() then
mainmanu()
end
Something like that, main menu being a function previously set.
-
10-04-2005, 01:19 PM #48Advanced PSP Coder
- Registriert seit
- Oct 2005
- Ort
- Down South
- Beiträge
- 426
- Points
- 7.141
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Can anyone post an example using a function such as the main menu? Thanks so much.
[center][COLOR=Green][B]- PM Me if you need help with anything - [/B] [/COLOR]
[B][SIZE=3][COLOR=DarkOrange][U]Homebrew I've Made[/U][/COLOR][/SIZE][/B]
[B]Applications:
[URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,17,1667]PSP Alarm v0.5[/URL] [/b]
[B]Games:
[URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1669] Virtual Escape DEMO[/URL] [w/ Lancer]
[URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1577]PSP Dodge v1.0[/URL][/b]
[img]http://img517.imageshack.us/img517/4735/sig3qu.jpg[/img][/center]
-
10-04-2005, 01:33 PM #49
well im working on something extremely minor, but it wont load. I keep getting an error.
..........
I got it up and runningGeändert von cools (10-06-2005 um 12:56 PM Uhr)
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
http://www.cools.biaklan.com
Currently Working on ?????
Quote of the Week
-
10-04-2005, 01:42 PM #50QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
screen:blit(=210, 1, "monopoly")
that should be
screen:blit(210, 1, monopoly)
-
10-04-2005, 01:55 PM #51NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
There's an unnecessary "=" when you blit the image.
Zitat von cools
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-04-2005, 01:55 PM #52
I tried that and i gotBilo screen:blit(=210, 1, "monopoly")
that should be
screen:blit(210, 1, monopoly)
error: index.lua:4: bad argument #2 to 'blit' (Image expected, got s
tring)
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
http://www.cools.biaklan.com
Currently Working on ?????
Quote of the Week
-
10-04-2005, 01:58 PM #53NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
monopoly shouldn't be in quotes.
Zitat von cools
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-04-2005, 02:01 PM #54
Thank You I have finally got it to load where I want IT!!!
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
http://www.cools.biaklan.com
Currently Working on ?????
Quote of the Week
-
10-04-2005, 02:02 PM #55QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
I said it shouldn't be in quotes.
Zitat von cools
If you look at what I posted.
-
10-04-2005, 03:43 PM #56
im sorry that is my mistake...
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
http://www.cools.biaklan.com
Currently Working on ?????
Quote of the Week
-
10-04-2005, 04:16 PM #57QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
lol, it's alright mate, don't be sorry :)
Hope your scriptin's going well :)
-
10-04-2005, 04:24 PM #58Advanced PSP Coder
- Registriert seit
- Oct 2005
- Ort
- Down South
- Beiträge
- 426
- Points
- 7.141
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Can anyone explain how to make a Lua program availible to boot outside Lua? Like with an ebbot, so its in the list of games on the Memory Stick? Thanks!
[center][COLOR=Green][B]- PM Me if you need help with anything - [/B] [/COLOR]
[B][SIZE=3][COLOR=DarkOrange][U]Homebrew I've Made[/U][/COLOR][/SIZE][/B]
[B]Applications:
[URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,17,1667]PSP Alarm v0.5[/URL] [/b]
[B]Games:
[URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1669] Virtual Escape DEMO[/URL] [w/ Lancer]
[URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi?0,0,0,0,12,1577]PSP Dodge v1.0[/URL][/b]
[img]http://img517.imageshack.us/img517/4735/sig3qu.jpg[/img][/center]
-
10-04-2005, 04:27 PM #59QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
Pull the eboot's from another lua app.
Then edit the eboot in the (%) folder to change the icon/name.
Thats it.
There's probably a different way but this way works.Geändert von Bilo (10-04-2005 um 04:30 PM Uhr)
-
10-04-2005, 05:35 PM #60NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Do you mean like Lowser?
Zitat von Virtue
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]


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