Seite 106 von 342 ErsteErste ... 6 56 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 156 206 ... LetzteLetzte
Zeige Ergebnis 3.151 bis 3.180 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 Jeremy1026 in a standalone eboot the "break" command simply restarts the lua application. Ohhh ok. Then I have ...

  
  1. #3151
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Jeremy1026
    in a standalone eboot the "break" command simply restarts the lua application.
    Ohhh ok. Then I have no idea.



  2. #3152
    6201ymereJ
    Points: 7.062, Level: 55
    Level completed: 56%, Points required for next Level: 88
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Baltimore
    Beiträge
    588
    Points
    7.062
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSPduh
    Ohhh ok. Then I have no idea.
    it is actually a good thing to have in your code as u edit, so u dont have to reboot your game to test the changes, just press start. gets rid of the time it takes to display the gameboot.

  3. #3153
    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

    actually "break" doesnt exit the program. it only exits the loop. so if u had two loops, it would transfer the control to the other loop.
    -= Double Post =-
    okay, n00b question:

    this is my code:
    Code:
    -- loaded images
    
    health1 = 100
    health2 = 100
    
    hit1 = "false"
    hit2 = "false"
    
    -- added the bullet stuff
    
    function collision()
    
    for g = 1, 10 do
    if (BulletInfo[g].x < Player[2].x + 32) and (BulletInfo[g].x > Player[2].x) and (BulletInfo[g].y < Player[2].y + 32) and (BulletInfo[g].y + 5 > Player[2].y) then
    BulletInfo[g].firing = false
    hit2 = "true"
    end 
    end
    
    for h = 1, 10 do
    if (BulletInfo2[h].x < Player[1].x + 32) and (BulletInfo2[h].x > Player[1].x) and (BulletInfo2[h].y < Player[1].y + 32) and (BulletInfo2[h].y > Player[1].y) then
    BulletInfo2[h].firing = false
    hit1 = "true"
    end 
    end
    
    end
    
    
    function health()
    
    if health1 < 0 then 
    health1 = 0
    end
    
    if health2 < 0 then 
    health2 = 0
    end
    
    if (hit1 == "true") then
    health1 = health1 - 10
    hit1 = "false"
    end
    
    if (hit2 == "true") then
    health2 = health2 - 10
    hit2 = "false"
    end
    
    if health1 == 0 then
    screen:clear()
    screen:blit(0, 0, win2)
    fire = false
    end
    
    if health2 == 0 then
    screen:clear()
    screen:blit(0, 0, win1)
    fire = false
    end
    
    end
    
    
    while true do
    
    collision()
    health()
    
    screen.waitVblankStart()
    screen.flip()
    end

    the problem is, even if one bullet hit the enemy, his health goes all the way down to 0 insted of just lowering by 10.

    help.
    Geändert von Grimfate126 (08-11-2006 um 07:10 PM Uhr) Grund: Automerged Doublepost
    --------------------------------------------------------------------------------------

  4. #3154
    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

    How about in your function collision, instead of "hit2 = "true"" or "hit1 = "true"", just put, health1 = health1 - 10

  5. #3155
    Developer
    Points: 5.162, Level: 46
    Level completed: 6%, Points required for next Level: 188
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Tauranga, New Zealand
    Beiträge
    355
    Points
    5.162
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    You can exit from LuaPlayer using os.exit()

    Zitat Zitat von LMelior
    You have to use unofficial Luaplayer versions, such as v0.17dk2 by Dark Killer or v0.20 mod by Cools, both of which have a System.Quit() function (Cools got his from Dark Killer's) that "exits Lua Player back to the psp browser." I haven't tested this yet but I assume it works. I'm sure somebody here could confirm this.
    I never saw the point of that function when you could just use os.exit()

  6. #3156
    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 TheEmulatorGuy
    You can exit from LuaPlayer using os.exit()
    Darnet! I wished I known that earlier. Too late now, I've already coded the program. It would be too much work to put that in. Guess I'll have to settle with the home button.

  7. #3157
    Developer
    Points: 5.162, Level: 46
    Level completed: 6%, Points required for next Level: 188
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Tauranga, New Zealand
    Beiträge
    355
    Points
    5.162
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    Darnet! I wished I known that earlier. Too late now, I've already coded the program. It would be too much work to put that in. Guess I'll have to settle with the home button.
    This gives me more incentive to kill the people who gave the wrong advice.

  8. #3158
    Developer
    Points: 5.650, Level: 48
    Level completed: 50%, Points required for next Level: 100
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    USA, Virginia
    Beiträge
    580
    Points
    5.650
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Hey, i just said the break function didnt work.. im no uber leet progger so dont kill me, BTW, does that acctualy work?

  9. #3159
    Developer
    Points: 5.162, Level: 46
    Level completed: 6%, Points required for next Level: 188
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Tauranga, New Zealand
    Beiträge
    355
    Points
    5.162
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Branin
    Hey, i just said the break function didnt work.. im no uber leet progger so dont kill me, BTW, does that acctualy work?
    I wasn't referring to you. Yes, it does work. I use it in ID3PSP.

  10. #3160
    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 Access_Denied
    How about in your function collision, instead of "hit2 = "true"" or "hit1 = "true"", just put, health1 = health1 - 10
    then the same thing happens.
    --------------------------------------------------------------------------------------

  11. #3161
    6201ymereJ
    Points: 7.062, Level: 55
    Level completed: 56%, Points required for next Level: 88
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Baltimore
    Beiträge
    588
    Points
    7.062
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    Darnet! I wished I known that earlier. Too late now, I've already coded the program. It would be too much work to put that in. Guess I'll have to settle with the home button.
    you would be adding like, 4 lines of code at most, 10 times...

  12. #3162
    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

    No, I would have to reconfigure 2 menus and change graphics again, and I've already had to do it twice, so I'm tired of doing it.

  13. #3163
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    I was gonna reccomend system.quit
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  14. #3164
    Asleep...
    Points: 11.516, Level: 70
    Level completed: 67%, Points required for next Level: 134
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    1.383
    Points
    11.516
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    im trying to add a timer in my script, but i put this in :
    counter = Timer.new()
    counter:start()

    if counter > 1000 then
    screenrint(12,0,"> 1", black)
    end
    but i get

    error: fight.lua:16: attempt to compare number with userdata
    wtf?! ive used timers before but this has never happened

  15. #3165
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    sorry, i cant help you, i've never used a timer in anything, cos i do games not apps, its not really used in apps.

    But i will be using it in luamainframe2
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  16. #3166
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    @Noobkiller, it's because you are comparing the timer itself. It needs to be:
    Code:
    if counter:time() > 1000 then
    --do stuff here
    end

  17. #3167
    QJ Gamer Blue
    Points: 4.241, Level: 41
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Alabama
    Beiträge
    142
    Points
    4.241
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    if counter:time() > 1000 then

  18. #3168
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    already bin answered
    -= Double Post =-
    Code:
     -- default options]]
    options = { navspeed = 1, autoscroll = "on", netlib = "off", wavlib = "off", bmplib = "off", diskmode = "off", start2quit="on", lowbattpercent = 3, overclock = "off", scetrick = "yes" }
    
    -- possible options for menu
    possibleOptions = {
      navspeed = {
        displayName = "NavSpeed",
        values = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
      autoscroll = {
        displayName = "Auto-Scroll",
        values = { "on", "off" } },
      netlib = {
        displayName = "Load Netlib",
        values = { "on", "off" } }
      wavlib = {
        displayName = "Load Wavlib",
        values = { "on", "off" } }
      bmplib = {
        displayName = "Load bmplib",
        values = { "on", "off" } }	
      diskmode = {
        displayName = "USB at start",
        values = { "on", "off" } }
      start2quit = {
        displayName = "Start restarts luaplayer",
        values = { "on", "off" } }
      lowbattpercent = {
        displayName = "Low battery %",
        values = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } }
      overclock = {
        displayName = "Overclock PSP?",
        values = { "off", "222", "266", "333" } }
      scetrick = {
        displayName = "Using __SCE__ trick?",
        values = { "yes", "no" } }
    }

    why isn't this working?
    -= Double Post =-
    anybody?
    Geändert von Glynnder (08-12-2006 um 05:16 AM Uhr) Grund: Automerged Doublepost
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  19. #3169
    6201ymereJ
    Points: 7.062, Level: 55
    Level completed: 56%, Points required for next Level: 88
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Baltimore
    Beiträge
    588
    Points
    7.062
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    whats you error glynnder?

  20. #3170
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    sys.lua:24: '}' expected to close '{' at line 11 near 'bmplib'

    line 11 is bmplib = {
    displayName = "Load bmplib",
    values = { "on", "off" } }

    but even when i quote that so line 11 is diskmode or whatever, it still doesnt work
    Geändert von Glynnder (08-12-2006 um 05:47 AM Uhr)
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  21. #3171
    QJ Gamer Green
    Points: 8.746, Level: 62
    Level completed: 99%, Points required for next Level: 4
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    www.ultimatetalkforums.com Games, RPG, quickchat and more!
    Beiträge
    532
    Points
    8.746
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Ok...i decided to start coding again...but i need help...i need someone to help me make a 2 player simple game like...hmm...just a screen with lots of dots and 2 players withg a points count for each one and they collect the dots...and theres a timer at the top...please pm me if you will make this game...but lead me through it...so take it as a learning expirience...so whatever you do tell me what and how and what it does....

    please pm me...thx
    [CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER]
    [CENTER] [/CENTER]
    [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER]
    [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER]
    [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER]
    [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER]

    [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL]

  22. #3172
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    shouldn't you do that to help familiarise yourself with the code again?
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  23. #3173
    Developer
    Points: 4.318, Level: 41
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    205
    Points
    4.318
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TheEmulatorGuy
    You can exit from LuaPlayer using os.exit()

    I never saw the point of that function when you could just use os.exit()
    This just completely freezes my PSP in Luaplayer 0.20. What version do you use it in?

    EDIT: I just tried System.Quit() using Cools' Luaplayer 0.20 and it works. So maybe Luaplayer 0.17dk2 didn't need that function but Luaplayer 0.20 mod by Cools does?
    Geändert von LMelior (08-12-2006 um 07:00 AM Uhr)

  24. #3174
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    nothing seems to work in 0.20
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  25. #3175
    Developer
    Points: 4.318, Level: 41
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    205
    Points
    4.318
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Oh yeah, as for your problem Glynnder (if you didn't fix it yet), you stopped using commas after each table entry.

  26. #3176
    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

    I have a question about reading .txt files. I have a program that reads an entire .txt file. That works fine. But, when it prints to the screen, it's one longe line. Is there a way that I can make it skip to the next line forming a paragraph?
    Also, in the .txt file, I have it in paragraph form. But when it prints to the screen, at the end of the first line, I see a Musical note symbol and a big "O" printed in black with a white square around it. Does anyone know what that is?

  27. #3177
    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

    1. LUA Player is limited to that (see why LUA sucks dirt?) so you must make your own 'return' function, very easy though.

    2. That musical note thing is *nix operator character of '\n' meaning 'newline'. ('\b' backspace, '\t' tab, etc.)...

    I will make you such a function once I go and learn how LUA makes 2d arrays, to parse the 'text' you put in into a 2d array, and for every music note found, skip a line down and keep printing... Sorry i cant right now though, I didnt learn all of LUA's syntax back when i only knew it...

    Until then, back to 3d Zelda clone......

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


  28. #3178
    Asleep...
    Points: 11.516, Level: 70
    Level completed: 67%, Points required for next Level: 134
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    1.383
    Points
    11.516
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    hmm... my timer is f uped...... i put it after the loop, and it goes like 4 then 8 then 12 then 6 wtf? doesnt it go by thousands? and why is mine going by ones? i used :

    counter = Timer.new()
    counter:start()

    if counter:time() > 4000 then
    screenrint(40,30,"> 4000",black)
    counter:reset(0)
    end

  29. #3179
    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

    I think you put these lines before the loop.

    counter = Timer.new()
    counter:start()

  30. #3180
    Asleep...
    Points: 11.516, Level: 70
    Level completed: 67%, Points required for next Level: 134
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    1.383
    Points
    11.516
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    im about to commit suicide from stupidity last question:

    how can i make a random number load... i.e a number bettween 1 and 3 eighter 1, 2, or 3 ?


 

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

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