Zeige Ergebnis 421 bis 450 von 10238
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; nevermind I just forgot to add a quotation on my image....
-
01-20-2006, 11:07 PM #421
- Registriert seit
- Jan 2006
- Beiträge
- 22
- Points
- 4.266
- Level
- 41
- Downloads
- 0
- Uploads
- 0
nevermind I just forgot to add a quotation on my image.
-
01-20-2006, 11:08 PM #422Developer

- Registriert seit
- Jun 2005
- Ort
- At my house...
- Beiträge
- 886
- Points
- 8.360
- Level
- 61
- Downloads
- 0
- Uploads
- 0
You never declared face or facing as a variable before the while true do loop. I dont think you can declare them in that loop.
-
01-21-2006, 02:04 AM #423QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Why won't it load the menu background image?
Code:---- Menu set function menu() screen:blit(200, 100, menu) while true do screen.waitVblankStart() screen.flip() end ---- Menu load if pad:start() then menu() end
-
01-21-2006, 06:03 AM #424QJ Gamer Gold
- Registriert seit
- Jul 2005
- Ort
- GA | Banned: 3 | Warned: 3
- Beiträge
- 2.253
- Points
- 12.479
- Level
- 73
- Downloads
- 0
- Uploads
- 0
Zitat von HaxxBlaster
Code:function menu() while true do screen:blit(200,100,menu) screen.waitVblankStart() screen.flip() end end
-
01-21-2006, 07:45 AM #425QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
It says bad argument.
But i got the picture and all..
-
01-21-2006, 08:39 AM #426QJ Gamer Gold
- Registriert seit
- Jul 2005
- Ort
- GA | Banned: 3 | Warned: 3
- Beiträge
- 2.253
- Points
- 12.479
- Level
- 73
- Downloads
- 0
- Uploads
- 0
Why don't you just blit the picture when you press the start button?
-
01-21-2006, 09:46 AM #427Developer

- Registriert seit
- Jun 2005
- Ort
- At my house...
- Beiträge
- 886
- Points
- 8.360
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Are you loading the pic in your variables? like:
Zitat von HaxxBlaster
menu = Image.load("menu.png")
-
01-21-2006, 12:59 PM #428QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Yes, of course.
Zitat von Twenty 2
I pm you the whole script.
-
01-21-2006, 01:01 PM #429QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Because if i want to change stuff it would be alot easyer to put i like that.
Zitat von Master Inuyasha
And it's just the start of the menu.
-
01-22-2006, 10:43 PM #430
- Registriert seit
- Jan 2006
- Beiträge
- 22
- Points
- 4.266
- Level
- 41
- Downloads
- 0
- Uploads
- 0
Ok I got a new problem I neeed the character to punch and I got the image for the Punching but I'm not sure how to make it show the punch and then go back to the regular standing picture. If you need to see the script just say so and I'll post it up. Can someone help me?
-
01-24-2006, 04:19 PM #431QJ Gamer Blue
- Registriert seit
- Jun 2005
- Beiträge
- 375
- Points
- 5.631
- Level
- 48
- Downloads
- 0
- Uploads
- 0
im just starting to get into lua programing(i was starting to a while ago but stoped) and im trying to make a menu. when i use to do the C tutorials in the forum someonje told me how to make a menu which i vagly remember. im trying to put what i do know into a menu in lua. when i look over my code it makes sense to me but then again. i wrote it. i tried launching it with the windows lua player and it just pops up then exits. when i put it in my pspit says no cript file found but it is in there with the right name. i was wondering if any of you could see a problem with it(im sure you will)
Code:--set menu option green = Color.new(0, 255, 0) color = Color.new(255, 255, 255) Menustatus=0 pad = Controls.read() if pad:down() then menustatus = menustatus + 1 if menustatus == 2 then menustatus = 0 end end if pad:up() then menustatus == menustatus - 1 if menustatus == 0 menustatus = 2 end end --Make Menu if menustatus == 0 then screen:print(160, 100, "Play", color) screen:print(160, 120, "Info", green) screen:print(160, 140, "Exit, green) screen.flip() end if menustatus == 1 then screen:print(160, 100, "Play", green) screen:print(160, 120, "Info", color) screen:print(160, 140, "Exit", green) screen.flip() end if menustatus == 2 then screen:print(160, 100, "Play", green) screen:print(160, 120, "Info", green) screen:print(160, 140, "Exit", color) screen.flip() end --Select Options if pad:cross() then if menustatus == 0 then dofile("./data/game.lua") end if menustatus == 1 then screen:print(160, 100, "Info", green) end if menustatus == 2 then break end end while true do screenVblankStart() end
-
01-24-2006, 04:30 PM #432QJ Gamer Gold
- Registriert seit
- Jul 2005
- Ort
- GA | Banned: 3 | Warned: 3
- Beiträge
- 2.253
- Points
- 12.479
- Level
- 73
- Downloads
- 0
- Uploads
- 0
If your using 2.0, downgrade to 1.5
From there, launch your lua App/Game
It shouldn't pop-up with "No Script File Found", it should tell you the line of code that it is tring to process, but can't(the line has an error in it).
BTW, put your menu code in your while true do statement...that might be the error.
-
01-24-2006, 04:38 PM #433QJ Gamer Blue
- Registriert seit
- Jun 2005
- Beiträge
- 375
- Points
- 5.631
- Level
- 48
- Downloads
- 0
- Uploads
- 0
adding the while true didnt work. unlease i put it in the wrong spot. i would downgrade but id have to wait till this weakend
-
01-25-2006, 11:21 AM #434Developer

- Registriert seit
- Jul 2005
- Ort
- Canada
- Beiträge
- 362
- Points
- 6.205
- Level
- 51
- Downloads
- 0
- Uploads
- 0
i don't know if this question has already been asked but i blitted an image to the screen, its just white test with a black border and when i viewed it, the images was all distorted and green, anybody know how to fix this?
Windows: A thirty-two bit extension and GUI shell to a sixteen bit patch to an eight bit operating system originally coded for a four bit microprocessor and sold by a two-bit company that can't stand one bit of competition...
Personal Development Blog:
http://keepitreal-dev.blogspot.com/
-
01-25-2006, 05:04 PM #435QJ Gamer Blue
- Registriert seit
- Jun 2005
- Beiträge
- 375
- Points
- 5.631
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Im using the twintail lua editor and it shows me the errors. i fixed two of the problems. it was just an extra "=" sign in one of the aprts and i forgot a quote when printing to the screen. now i get a wierd error. it says there is no loop for the end to break on line 56.(red one in the code) when i delete it it says the same thing for the end that is now on loine 56(this will be the orange one). when i delete both of them it says there is no loop to break near the while statement.but while doesnt break a loop.
Code:green = Color.new(0, 255, 0) color = Color.new(255, 255, 255) Menustatus=0 pad = Controls.read() --set menu option if pad:down() then menustatus = menustatus + 1 if menustatus == 2 then menustatus = 0 end end if pad:up() then menustatus == menustatus - 1 if menustatus == 0 menustatus = 2 end end --Make Menu if menustatus == 0 then screen:print(160, 100, "Play", color) screen:print(160, 120, "Info", green) screen:print(160, 140, "Exit, green) screen.flip() end if menustatus == 1 then screen:print(160, 100, "Play", green) screen:print(160, 120, "Info", color) screen:print(160, 140, "Exit", green) screen.flip() end if menustatus == 2 then screen:print(160, 100, "Play", green) screen:print(160, 120, "Info", green) screen:print(160, 140, "Exit", color) screen.flip() end --Select Options if pad:cross() then if menustatus == 0 then dofile("./data/game.lua") end if menustatus == 1 then screen:print(160, 100, "Info", green) end if menustatus == 2 then break end end while true do screenVblankStart() end
-
01-25-2006, 07:23 PM #436QJ Gamer Gold
- Registriert seit
- Jul 2005
- Ort
- GA | Banned: 3 | Warned: 3
- Beiträge
- 2.253
- Points
- 12.479
- Level
- 73
- Downloads
- 0
- Uploads
- 0
Try some more stuff, you'll get it soon ;)
Oh, remember, when you fix it, remember what you did. Just incase it happens again.
-
01-25-2006, 08:52 PM #437Raining
- Registriert seit
- Jun 2005
- Ort
- In The Fog...
- Beiträge
- 545
- Points
- 7.355
- Level
- 57
- My Mood
-
- Downloads
- 0
- Uploads
- 0
lol, I know this sounds stupid, but I think I forgot hot to do a Hello World script. I wrote:
I am new to using LUAEdit so maybe that is the problem, but I figured it is better than going with notepad since I get lazy checking to see if my code is correct. It keeps saying: HINT- Begin of Script- but I don't understand what it means. Did I write it wrong or is LUAEdit just screwed up? I have done a Hello World before on NotePad and never got this problem.Code:print("Hello World")
EDIT:
By the way, I'm pressing "Run Script" just so you know. I got rid of the intrepretor and don't know where to download it again so I assumed LUAEdit would be a good intrepetor.
EDIT2:
I just realized something. LUAEdit isn't meant to be used by itself, is it? Do I need to download the current LUA version in order to write code properly to format to the PSP and computer? I'm sorry, but I just started using LUAEdit, I'm more accustomed to just the simple NotePad, but now I want to use something fancy.Geändert von wicked_fable (01-25-2006 um 09:14 PM Uhr)
-
01-26-2006, 01:15 PM #438QJ Gamer Blue
- Registriert seit
- Jun 2005
- Beiträge
- 375
- Points
- 5.631
- Level
- 48
- Downloads
- 0
- Uploads
- 0
ok i found one more problem but it was just another simple mistake. forgot to put a ":" in the screen wait part at the end and when i delete the last part
it will start but it freezes my psp even if i la8unch it from lua playerCode:--Select Options if pad:cross() then if menustatus == 0 then dofile("./data/game.lua") end if menustatus == 1 then screen:print(160, 100, "Info", green) end if menustatus == 2 then break end end
also do u think i sould just combined the part i deleted with this part?
Code:--Make Menu if menustatus == 0 then screen:print(160, 100, "Play", color) screen:print(160, 120, "Info", green) screen:print(160, 140, "Exit, green) screen.flip() end if menustatus == 1 then screen:print(160, 100, "Play", green) screen:print(160, 120, "Info", color) screen:print(160, 140, "Exit", green) screen.flip() end if menustatus == 2 then screen:print(160, 100, "Play", green) screen:print(160, 120, "Info", green) screen:print(160, 140, "Exit", color) screen.flip() end
-
01-26-2006, 04:47 PM #439QJ Gamer Gold
- Registriert seit
- Jul 2005
- Ort
- GA | Banned: 3 | Warned: 3
- Beiträge
- 2.253
- Points
- 12.479
- Level
- 73
- Downloads
- 0
- Uploads
- 0
Heres the code
Zitat von wicked_fable
black = Color.new(0, 0, 0)
screen
rint(1, 1, "Hello World", black)
screen.flip()
-
01-26-2006, 09:54 PM #440Raining
- Registriert seit
- Jun 2005
- Ort
- In The Fog...
- Beiträge
- 545
- Points
- 7.355
- Level
- 57
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Geez, no wonder, I really did forget hot to use the print function. Thanks for reminding me, that wouldhave been very stupid if I could add text to my games, lol.
-
01-26-2006, 10:37 PM #441words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
well do you ahve a previous loop or is that a function or what? it might also help to just add an extra end to the end where i added the green end and see if it works
Zitat von soadnation

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
01-27-2006, 04:42 AM #442QJ Gamer Blue
- Registriert seit
- Jun 2005
- Beiträge
- 375
- Points
- 5.631
- Level
- 48
- Downloads
- 0
- Uploads
- 0
ok i pinpoted the problem down to exit funtion(if pad.start() break). when i delete4 it it lodss. kindof. when it loads it just freezes right away this i have no idea what could be causeing it.
-
01-29-2006, 09:53 AM #443QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Help with a Jump Function
I get stuck on a "Jump Function", i have been trying to get it to work all day, i get freaking nuts..
I simply want my character to jump up and down on a button release.
Please help me out guys, so i can continue with my game.
And if it turn out good i may be release it in public.
My code looked something like this.
Code:if pad:cross() then time = time + 1 yP = yP - time if time == 70 then time = 0 yP = yP + time if time == 70 then time = 0 end end end
Geändert von HaxxBlaster (01-31-2006 um 09:57 PM Uhr)
-
01-29-2006, 10:21 AM #444QJ Gamer Gold
- Registriert seit
- Jul 2005
- Ort
- GA | Banned: 3 | Warned: 3
- Beiträge
- 2.253
- Points
- 12.479
- Level
- 73
- Downloads
- 0
- Uploads
- 0
Thats alright, it happens to the best of us.
Zitat von wicked_fable
-
01-30-2006, 09:37 AM #44511th Squad Captain
- Registriert seit
- Jun 2005
- Ort
- You are here -----> 名前: アダム | 飲むコー
- Beiträge
- 2.562
- Points
- 26.490
- Level
- 97
- Downloads
- 0
- Uploads
- 0
Sorry about this guys but
i have a problem....
Can someone tell me how to make a collision
for a image this big 66x63???
here's my code for the collsion
(I need it to make the collsion work all around my square)
Please Note that i stripped my code so here's just the important bit'sCode:w2 = 30 h2 = 30 x2 = 170 y2 = 200 w1 = 20 h1 = 20 function collision(x1, y1, w1, h1, x2, y2, w2, h2) if (y2 >= y1 and y1 + h1 >= y2) or (y2 + h2 >= y1 and y1 + h1 >= y2 + h2) or (y1 >= y2 and y2 + h2 >= y1) or (y1 + h1 >= y2 and y2 + h2 >= y1 + h1) then if x2 >= x1 and x1 + w1 >= x2 then return true elseif x2 + w2 >= x1 and x1 + w1 >= x2 + w2 then return true elseif x1 >= x2 and x2 + w2 >= x1 then return true elseif x1 + w1 >= x2 and x2 + w2 >= x1 + w1 then return true end end return false end screen:blit(x2, y2, col) if pad:right() and collision(x1, y1, w1, h1, x2, y2, 1, h2) == false then walkRight() x1=x1+1.5
of my collision. My player doesnt hit the square and he can
walk right through it
And there is only one barrier and not four..
Anyhelp at all would be highly appreciated!
and maybe if your help is good enough i will donate my points :icon_winkFAVORITE 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!
-
01-31-2006, 08:06 AM #446
Ok i just started with LUA and its fun, but i just don't get something:
How do you let the program go back? Like in BASIC you can use "goto ...". But can i use that in LUA, or do i use something else?
And another thing. First everuthing worked. Then i changed some code to improve my prog. but now i "starts" weird. Lowser says it's running it, but it won't show any image. However if i push start a couple of times it askes to press start to restart. Also when i press L, the it gives the message "Disk mode active. Press L to exit.". Now why is that? And by Disk Mode does it mean UsbDiskMode, because thats the only thing i can think of?
Thx in advance!
AltairGeändert von Altair (01-31-2006 um 08:31 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]
-
01-31-2006, 08:09 AM #447
@HaxxBlaster
There needs to be an extra "=" at the second "if time = 70". It needs to be "if time == 70".Geändert von Altair (01-31-2006 um 08:29 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]
-
01-31-2006, 12:42 PM #448QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Yes i know, but i just wrote is down of what i remember of it .
Zitat von Altair
I don't get any error, it just don't work like i want.
-
01-31-2006, 12:49 PM #449QJ Gamer Green
- Registriert seit
- Oct 2005
- Beiträge
- 543
- Points
- 6.721
- Level
- 53
- Downloads
- 0
- Uploads
- 0
1: use functions
Zitat von Altair
2: You obviously aren't running anything or you don't have a
screen.waitVblankStart()
in the loop
3: That is lowser's USB disk mode.HELP ME HAIRY LEG!!!!
I have a 1.5 (downgraded) US PSP
[code]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( P | S | P | - | P | r | o | g | r | a | m | m | i | n | g )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
_ _ _ _ _
/ \ / \ / \ / \ / \
( A | d | m | i | n )
\_/ \_/ \_/ \_/ \_/ [/code]
-
01-31-2006, 12:55 PM #450QJ Gamer Green
- Registriert seit
- Oct 2005
- Beiträge
- 543
- Points
- 6.721
- Level
- 53
- Downloads
- 0
- Uploads
- 0
Fixed, Problem with the screen vblank start stuff
Zitat von soadnation
HELP ME HAIRY LEG!!!!
I have a 1.5 (downgraded) US PSP
[code]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( P | S | P | - | P | r | o | g | r | a | m | m | i | n | g )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
_ _ _ _ _
/ \ / \ / \ / \ / \
( A | d | m | i | n )
\_/ \_/ \_/ \_/ \_/ [/code]


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