Seite 15 von 342 ErsteErste ... 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 65 115 ... LetzteLetzte
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....

  
  1. #421
    Points: 4.266, Level: 41
    Level completed: 58%, Points required for next Level: 84
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    22
    Points
    4.266
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    nevermind I just forgot to add a quotation on my image.



  2. #422
    Developer
    Points: 8.360, Level: 61
    Level completed: 70%, Points required for next Level: 90
    Overall activity: 16,0%

    Registriert seit
    Jun 2005
    Ort
    At my house...
    Beiträge
    886
    Points
    8.360
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    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.

  3. #423
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    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

  4. #424
    QJ Gamer Gold
    Points: 12.479, Level: 73
    Level completed: 8%, Points required for next Level: 371
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    GA | Banned: 3 | Warned: 3
    Beiträge
    2.253
    Points
    12.479
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von HaxxBlaster
    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
    Code:
    function menu()
      while true do
        screen:blit(200,100,menu)
        screen.waitVblankStart()
        screen.flip()
      end
    end

  5. #425
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    It says bad argument.
    But i got the picture and all..

  6. #426
    QJ Gamer Gold
    Points: 12.479, Level: 73
    Level completed: 8%, Points required for next Level: 371
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    GA | Banned: 3 | Warned: 3
    Beiträge
    2.253
    Points
    12.479
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Why don't you just blit the picture when you press the start button?

  7. #427
    Developer
    Points: 8.360, Level: 61
    Level completed: 70%, Points required for next Level: 90
    Overall activity: 16,0%

    Registriert seit
    Jun 2005
    Ort
    At my house...
    Beiträge
    886
    Points
    8.360
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von HaxxBlaster
    It says bad argument.
    But i got the picture and all..
    Are you loading the pic in your variables? like:
    menu = Image.load("menu.png")

  8. #428
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Twenty 2
    Are you loading the pic in your variables? like:
    menu = Image.load("menu.png")
    Yes, of course.
    I pm you the whole script.

  9. #429
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Master Inuyasha
    Why don't you just blit the picture when you press the start button?
    Because if i want to change stuff it would be alot easyer to put i like that.
    And it's just the start of the menu.

  10. #430
    Points: 4.266, Level: 41
    Level completed: 58%, Points required for next Level: 84
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    22
    Points
    4.266
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    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?

  11. #431
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    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

  12. #432
    QJ Gamer Gold
    Points: 12.479, Level: 73
    Level completed: 8%, Points required for next Level: 371
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    GA | Banned: 3 | Warned: 3
    Beiträge
    2.253
    Points
    12.479
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    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.

  13. #433
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    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

  14. #434
    Developer
    Points: 6.205, Level: 51
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Canada
    Beiträge
    362
    Points
    6.205
    Level
    51
    Downloads
    0
    Uploads
    0

    Standard

    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/

  15. #435
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    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

  16. #436
    QJ Gamer Gold
    Points: 12.479, Level: 73
    Level completed: 8%, Points required for next Level: 371
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    GA | Banned: 3 | Warned: 3
    Beiträge
    2.253
    Points
    12.479
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Try some more stuff, you'll get it soon ;)
    Oh, remember, when you fix it, remember what you did. Just incase it happens again.

  17. #437
    Raining
    Points: 7.355, Level: 57
    Level completed: 3%, Points required for next Level: 195
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    In The Fog...
    Beiträge
    545
    Points
    7.355
    Level
    57
    My Mood
    Relaxed
    Downloads
    0
    Uploads
    0

    Standard

    lol, I know this sounds stupid, but I think I forgot hot to do a Hello World script. I wrote:

    Code:
    print("Hello World")
    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.

    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)

  18. #438
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    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

    Code:
    --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
    it will start but it freezes my psp even if i la8unch it from lua player

    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

  19. #439
    QJ Gamer Gold
    Points: 12.479, Level: 73
    Level completed: 8%, Points required for next Level: 371
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    GA | Banned: 3 | Warned: 3
    Beiträge
    2.253
    Points
    12.479
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von wicked_fable
    lol, I know this sounds stupid, but I think I forgot hot to do a Hello World script. I wrote:

    Code:
    print("Hello World")
    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.

    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.
    Heres the code

    black = Color.new(0, 0, 0)

    screenrint(1, 1, "Hello World", black)
    screen.flip()

  20. #440
    Raining
    Points: 7.355, Level: 57
    Level completed: 3%, Points required for next Level: 195
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    In The Fog...
    Beiträge
    545
    Points
    7.355
    Level
    57
    My Mood
    Relaxed
    Downloads
    0
    Uploads
    0

    Standard

    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.

  21. #441
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von soadnation
    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
    end 
    while true do
    	screenVblankStart()
    end
    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

    ...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


  22. #442
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    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.

  23. #443
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard 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)

  24. #444
    QJ Gamer Gold
    Points: 12.479, Level: 73
    Level completed: 8%, Points required for next Level: 371
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    GA | Banned: 3 | Warned: 3
    Beiträge
    2.253
    Points
    12.479
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von wicked_fable
    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.
    Thats alright, it happens to the best of us.

  25. #445
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    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)
    Code:
    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
    Please Note that i stripped my code so here's just the important bit's
    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_wink
    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!

  26. #446
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    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!

    Altair
    Geä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]

  27. #447
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    @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]

  28. #448
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Altair
    @HaxxBlaster
    There needs to be an extra "=" at the second "if time = 70". It needs to be "if time == 70".
    Yes i know, but i just wrote is down of what i remember of it .
    I don't get any error, it just don't work like i want.

  29. #449
    QJ Gamer Green
    Points: 6.721, Level: 53
    Level completed: 86%, Points required for next Level: 29
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    543
    Points
    6.721
    Level
    53
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Altair
    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!

    Altair
    1: use functions
    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]

  30. #450
    QJ Gamer Green
    Points: 6.721, Level: 53
    Level completed: 86%, Points required for next Level: 29
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    543
    Points
    6.721
    Level
    53
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von soadnation
    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
    	screen.waitVblankStart()
    end
    Fixed, Problem with the screen vblank start stuff
    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]


 
Seite 15 von 342 ErsteErste ... 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 65 115 ... LetzteLetzte

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 08:58 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .