Seite 152 von 342 ErsteErste ... 52 102 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 202 252 ... LetzteLetzte
Zeige Ergebnis 4.531 bis 4.560 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; Zitat von Yongobongo Anyone know whats wrong with this? Code: housey < packy + pack:width() Using width for a y ...

  
  1. #4531
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Yongobongo
    Anyone know whats wrong with this?
    Code:
    housey < packy + pack:width()
    Using width for a y axis check? Should be height.



  2. #4532
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    For a racing game and a speed variable, something like:
    Code:
    player = { x = 0, y = 0, img = Image.load("player.png"), d = u }
    speed = 0
    if pad:cross() and speed > maxspeed then
    speed = speed+1
    elseif pad:square() and speed > 0 then
    speed = speed - 3
    end
    if speed < 0 then speed = 0 end
    if player.x > 472 - player.img:width() and player.d == r then
    player.x = player.x + speed
    end
    if player.x > 472 - player.img:width() then player.x = 472 - player.img:width()
    Theres a basis for ya. Just dont forget to make a reverse!

  3. #4533
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    ok thanks its late right now but ill look into that tomorrow il... put u in the credits or something lol.
    EDIT: nvm i dont feel like doing spanish 2 homework right now lol.
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  4. #4534
    .info
    Points: 15.395, Level: 80
    Level completed: 9%, Points required for next Level: 455
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    ACT, Australia
    Beiträge
    1.674
    Points
    15.395
    Level
    80
    Downloads
    0
    Uploads
    0

    Standard

    Ok, my game is nearly done, yay! But I want to be able to fire something more then once, like so if i fire eg. a bullet it doesnt just get rid of it and fire another on from the starting point?

    http://www.yongobongo.com
    PSN - yongobongo

  5. #4535
    QJ Gamer Green
    Points: 6.453, Level: 52
    Level completed: 52%, Points required for next Level: 97
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    BEHIND YOU!!
    Beiträge
    1.061
    Points
    6.453
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Yongobongo, what are you trying to say?
    [url=http://xs.to][img]http://xs313.xs.to/xs313/07106/wmnp8z.png[/img][/url]

    What's a recovery.elf
    [QUOTE=iball]
    He's the one that fixes Santa's sleigh when it breaks down[/QUOTE]

    [QUOTE=Deturbanator]why are we allowed to see the whole flesh and being of the boob but we MUST blur out the tit?[/QUOTE]
    [PRE][B]sg57 i love you for turning on the light of homebrew when i was in the darkness of sony[/b][/pre]

  6. #4536
    .info
    Points: 15.395, Level: 80
    Level completed: 9%, Points required for next Level: 455
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    ACT, Australia
    Beiträge
    1.674
    Points
    15.395
    Level
    80
    Downloads
    0
    Uploads
    0

    Standard

    How can I fire multiple bullets, basically :)

    http://www.yongobongo.com
    PSN - yongobongo

  7. #4537
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Yongobongo
    How can I fire multiple bullets, basically :)
    http://www.evilmana.com/tutorials/lu...et_bullets.php

    That should work. If not, I can probably help you.

  8. #4538
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Yep and if 5 isnt enough just edit it a little to have more, but keep it to as few as possible.

  9. #4539
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    i need to know how to clear up RAM. my game switches between scripts alot and i just got to the point where i now need to load...alot of stuff and need more space cause i dont want for it to lag...
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  10. #4540
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    imageyouloadedbeforethaty ounolongerneed = nil
    asnotherimageyoupreviousl yloadedthatyounolongernee d = nil
    imagethatyounowneed = Image.load("image.png")

    Also, make sure your code isn't wasting your PSP's cpu or anything, just go through it and check for better ways of doing things and unneccessary things.

  11. #4541
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    just calling them "nil" does that?

    that just sounds too easy...ok!
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  12. #4542
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Yea just make sure there arent multiple vcalues usin the same image. Making the m nil just redefines them as undefined and with an image sitting undefined and unused in the ram, it gets dumped out.

  13. #4543
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    is there a site that says what all teh lua error messages mean so i can understand where i made my error?

  14. #4544
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von cheese the psp
    is there a site that says what all teh lua error messages mean so i can understand where i made my error?
    That is what the line number in the error messages are for. Most of the errors are straight forward, others will require you to mentally step though the code to find your error. I also find that with scripts in general (weakly typed and usually with no debuggers) Hungarian Notation helps a lot especially during code maintenance and expansion.

  15. #4545
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    great now i got rid of the errors and now it just freezes the psp
    what can cause that to happen?

  16. #4546
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Overflowing the stack, infinite loops are the immediate two that comes to mind.

  17. #4547
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    waht does <eof> mean?

  18. #4548
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    End of file. Generally it means you need to go through and check that you ended all of your loops and ifthens.

  19. #4549
    QJ Gamer Green
    Points: 6.453, Level: 52
    Level completed: 52%, Points required for next Level: 97
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    BEHIND YOU!!
    Beiträge
    1.061
    Points
    6.453
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    I used to get that message all the time until I realized that my pc took longer than 2 seconds to transfer over the files. First you will see the memstick light blink then about 10 seconds later it will blink again, then you can disconnect it.
    [url=http://xs.to][img]http://xs313.xs.to/xs313/07106/wmnp8z.png[/img][/url]

    What's a recovery.elf
    [QUOTE=iball]
    He's the one that fixes Santa's sleigh when it breaks down[/QUOTE]

    [QUOTE=Deturbanator]why are we allowed to see the whole flesh and being of the boob but we MUST blur out the tit?[/QUOTE]
    [PRE][B]sg57 i love you for turning on the light of homebrew when i was in the darkness of sony[/b][/pre]

  20. #4550
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von code
    System.usbDiskModeActivat e()

    black = Color.new(0,0,0)
    green = Color.new(0,255,0)
    white = Color.new(255,255,255)

    bg = Image.load("background.pn g")

    screen:blit(0,0,bg)
    screenrint(120,140,"play game",black)
    screenrint(120,150,"Controls",b lack)
    screenrint(120,160,"Credits",bl ack)
    screen:flip()

    current = 1
    while true do
    pad = Controls.read()
    screen:clear()

    if current == 1 and pad:cross() then
    do file("game.lua")
    end
    if current == 2 and pad:cross() then
    dofile("help.lua")
    end
    if current == 3 and pad:cross() then
    dofile("credits.lua")
    end

    if current == 1 then
    screenrint(120,140,"play game",green)
    end
    if current == 2 then
    screenrint(120,150,"Controls",g reen)
    end
    if current == 3 then
    screenrint(120,160,"Credits",gr een)
    end

    if pad:up() and oldpad:up() ~= pad:up() then
    current = current - 1
    end
    if pad:down() and oldpad:down() ~= pad:down() then
    current = current + 1
    end

    if current == 4 then
    current = 1
    end
    if current == 0 then
    current = 3
    end
    screen.waitvblankStart()
    screen.flip()
    oldpad = pad
    end
    i cant seem to get this to work
    this is teh menu

  21. #4551
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von cheese the psp
    i cant seem to get this to work
    this is teh menu
    You need to put all your screenrints and screen:blits inside your main loop, since you have a screen:clear() in your main loop. If you put them before the loop, they will just get wiped away by the screen:clear().

  22. #4552
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von code
    System.usbDiskModeActivat e()

    black = Color.new(0,0,0)
    green = Color.new(0,255,0)
    white = Color.new(255,255,255)

    screenrint(120,140,"loading..." ,white)
    screen:flip()

    bg = Image.load("background.pn g")

    current = 1
    pad = Controls.read()
    screen:clear()

    if current == 1 and pad:cross() then
    do file("game.lua")
    end
    if current == 2 and pad:cross() then
    dofile("help.lua")
    end
    if current == 3 and pad:cross() then
    dofile("credits.lua")
    end

    screen:blit(0,0,bg)
    screenrint(120,140,"play game",black)
    screenrint(120,150,"Controls",b lack)
    screenrint(120,160,"Credits",bl ack)
    screen:flip()

    if current == 1 then
    screenrint(120,140,"play game",green)
    end
    if current == 2 then
    screenrint(120,150,"Controls",g reen)
    end
    if current == 3 then
    screenrint(120,160,"Credits",gr een)
    end

    if pad:up() and oldpad:up() ~= pad:up() then
    current = current - 1
    end
    if pad:down() and oldpad:down() ~= pad:down() then
    current = current + 1
    end

    if current == 4 then
    current = 1
    end
    if current == 0 then
    current = 3
    end
    screen.waitvblankStart()
    screen.flip()
    oldpad = pad
    end
    there...
    now it just freezes with loading on the screen

  23. #4553
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von cheese the psp
    there...
    now it just freezes with loading on the screen

    you dont have a "while true do". try this:

    Code:
    System.usbDiskModeActivat e()
    
    black = Color.new(0,0,0)
    green = Color.new(0,255,0)
    white = Color.new(255,255,255)
    
    screenrint(120,140,"loa ding...",white)
    screen:flip()
    
    bg = Image.load("background.pn g")
    
    current = 1
    
    while true do
    
    pad = Controls.read()
    screen:clear()
    
    if current == 1 and pad:cross() then
    do file("game.lua")
    end
    if current == 2 and pad:cross() then
    dofile("help.lua")
    end
    if current == 3 and pad:cross() then
    dofile("credits.lua")
    end
    
    screen:blit(0,0,bg)
    screenrint(120,140,"pla y game",black)
    screenrint(120,150,"Con trols",black)
    screenrint(120,160,"Cre dits",black)
    screen:flip()
    
    if current == 1 then
    screenrint(120,140,"pla y game",green)
    end
    if current == 2 then
    screenrint(120,150,"Con trols",green)
    end
    if current == 3 then
    screenrint(120,160,"Cre dits",green)
    end
    
    if pad:up() and oldpad:up() ~= pad:up() then
    current = current - 1
    end
    if pad:down() and oldpad:down() ~= pad:down() then
    current = current + 1
    end
    
    if current == 4 then
    current = 1
    end
    if current == 0 then
    current = 3
    end
    screen.waitvblankStart()
    screen.flip()
    oldpad = pad
    end
    --------------------------------------------------------------------------------------

  24. #4554
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    then i get an error message saying i need an end for teh 'while'
    in "while true do"
    where would i put this end?

    btw thanks for all your help

  25. #4555
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    I believe since you have a main loop, You have to put the end to end your loop, Or else it will just keep repeating the loop, I think thats right???

  26. #4556
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von pspgamer81
    I believe since you have a main loop, You have to put the end to end your loop, Or else it will just keep repeating the loop, I think thats right???
    the point of a loop IS to repeat. the "end" just puts limits on HOW MUCH you want to repeat every frame.
    --------------------------------------------------------------------------------------

  27. #4557
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Ah, Yea ok!

  28. #4558
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Stickied!

  29. #4559
    QJ Gamer Bronze
    Points: 9.316, Level: 64
    Level completed: 89%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Denmark
    Beiträge
    664
    Points
    9.316
    Level
    64
    Downloads
    0
    Uploads
    0

    Standard

    God... now i finnaly got the ball to work with collosion in my ping pong game, thanks to Guitargod..

    BUT! (Damm, there's always a but) At the start of the game, the ball is just blitted, and signed as an object, but i need it to move when the game starts!

    (Yeah, i know nothing... *sniff*) So what should i write before the game loop, and what do i have to write?

    I think my grammer is pretty wrong in this post. Oh well.
    My PSP Projects:
    ___________________
    None.

  30. #4560
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Just setup the direction system like I showed you and make the ball start out with a direction and then move the ball based on its direction.


 

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 09:00 PM Uhr.

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