Seite 172 von 342 ErsteErste ... 72 122 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 222 272 ... LetzteLetzte
Zeige Ergebnis 5.131 bis 5.160 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 yaustar Yongobongo: I gave you this 2-3 pages back Here is the complete listing from GameDev. http://www.gamedev.net/reference/list.asp?categoryid=18 There ...

  
  1. #5131
    .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

    Zitat Zitat von yaustar
    Yongobongo: I gave you this 2-3 pages back


    Here is the complete listing from GameDev.
    http://www.gamedev.net/reference/list.asp?categoryid=18

    There are also tons at http://gamasutra.com
    Thanks, i've got some simple AI working now :)



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

  2. #5132
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    So how exactly do I fix it?

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

    You make it stop double flipping it every loop.

  4. #5134
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    wehn i do that. like if i remove the first screen.flip() it will load everything so fast and stop.

  5. #5135
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Cheez Pirate
    Well it will load everything without errors but it will load and blit both the loading screen and the animation at the same time. And the screen will flash while doing so.
    Well take it out of the loop or make the data loading in the loop then add a break then load the animation in another while loop.

  6. #5136
    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

    Well why dont you just ditch a loading screen? What you have loads in like 0.1 seconds, why unnecessarily make people wait?

  7. #5137
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    white = Color.new(255,255,255)
    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    
    dofile("lib/animlib.lua")
    
    logo = ANIM.new(8,"logo","png","logo/")
    
    loadingscreen = Image.load("images/loadingscreen.png")
       
    loadingbar = {}
    loadingbar.y = 11
    
    data = {}
    data.loaded = 0
    
    cursor = Image.load("images/cursor.png")
    data.loaded = data.loaded + 25 * 4
    
    nameofimage = nil
    
    while true do
    
    	pad = Controls.read()
    	screen:clear(white)
    	logo:advancedBlit(0,0,500,1)
    	screen.flip()
    	screen:clear(white)
    	screen:blit(0,0,loadingscreen)
    	screen:fillRect(47,205,data.loaded,loadingbar.y,red)
    	screen.waitVblankStart()
            screen.flip()
    end
    what is the pad:Controls:read() for??
    -= Double Post =-
    Zitat Zitat von TacticalPinguin
    Well why dont you just ditch a loading screen? What you have loads in like 0.1 seconds, why unnecessarily make people wait?
    Exactly there is no need to make a loading screen unless you use something that takes a while like netlib or sumfin
    Geändert von pspfreak9 (01-18-2007 um 04:03 PM Uhr) Grund: Automerged Doublepost

  8. #5138
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Well the thing is... That isn't a complete game lol. There will be a lot more. Now what does break do? :X

  9. #5139
    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

    the keyword 'break' does just what it says - 'breaks' the current running loop.

    pad = Controls.read() will return the current state of the PSPs buttons, each true or false. So, by placing it in a loop, your constantly checking for a changae in button presses, therefor calling if pad:cross() your checking the pad metatable (or wahtever it is in lua... its a structure in C) to see if the cross button is checked to true indicating its being pressed.

    Or something like that im sure

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


  10. #5140
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    I don't think the 2 of you before SG57 know what i'm saying.

    Code:
    white = Color.new(255,255,255)
    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    
    dofile("lib/animlib.lua")
    
    logo = ANIM.new(8,"logo","png","logo/")
    
    loadingscreen = Image.load("images/loadingscreen.png")
       
    loadingbar = {}
    loadingbar.y = 11
    
    data = {}
    data.loaded = 0
    
    cursor = Image.load("images/cursor.png")
    data.loaded = data.loaded + 25 * 4
    
    nameofimage = nil
    
    while true do
    
    	pad = Controls.read()
    	screen:clear(white)
    	screen:clear(white)
    	logo:advancedBlit(0,0,500,1)
    	screen:blit(0,0,loadingscreen)
    	screen:fillRect(47,205,data.loaded,loadingbar.y,red)
    	screen.waitVblankStart()
            screen.flip()
    end
    How can I blit the animation and when it's OVER load the loading screen. And I know the load screen is 0.1 seconds. It's not anywhere near what else i'll be loading in the future.

  11. #5141
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Ok then put the animation in the script (not in a while loop) then make a while loop put your loading stuff in it then "break" and move on to whatever your going to.
    TO SG57 : I know what the pad = Controls.read() is im just saying first it is in the loop why?? and I see no need for that since he hasnt used it ;)

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

    he probably will use it in the future...

  13. #5143
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    alright. loading stuff. by that you mean the loadingscreen, data.loaded, or screen:fillRect?

  14. #5144
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    mmmm, got the weirdest error that I've ever seen just now....

    I Had just put an image in the images folder (the Pxp compo Splash Screen)
    then loaded up my app on my psp, then it gave me

    error: index.lua:4:Image.load Error loading image

    now, that is nothing new the weird part is what happened when i opened up the images folder of my app that was on my psp after that..., what i found was..

    http://img136.imageshack.us/my.php?image=screenstn2.png


    all of those which look like it Fragments of lua code used to be images and folders of images...
    really weird, any suggestions?


    Edit: Looks like things just got worse....seems i cant delete that images directory, wouldn't let me, I went on to my psp, and that didn't work, it said "delete Failed"... WTF is going on?
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  15. #5145
    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

    Clear everything off your PSP then format. Then put everything back on it

  16. #5146
    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

    Zitat Zitat von BlackShark
    mmmm, got the weirdest error that I've ever seen just now....

    I Had just put an image in the images folder (the Pxp compo Splash Screen)
    then loaded up my app on my psp, then it gave me

    error: index.lua:4:Image.load Error loading image

    now, that is nothing new the weird part is what happened when i opened up the images folder of my app that was on my psp after that..., what i found was..

    http://img136.imageshack.us/my.php?image=screenstn2.png


    all of those which look like it Fragments of lua code used to be images and folders of images...
    really weird, any suggestions?


    Edit: Looks like things just got worse....seems i cant delete that images directory, wouldn't let me, I went on to my psp, and that didn't work, it said "delete Failed"... WTF is going on?
    ouch, sounds like a virus.
    if reformatting doesnt work (it should though), try deleting it with IR shell or FileAssistant.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  17. #5147
    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 BlackShark
    mmmm, got the weirdest error that I've ever seen just now....

    I Had just put an image in the images folder (the Pxp compo Splash Screen)
    then loaded up my app on my psp, then it gave me

    error: index.lua:4:Image.load Error loading image

    now, that is nothing new the weird part is what happened when i opened up the images folder of my app that was on my psp after that..., what i found was..

    http://img136.imageshack.us/my.php?image=screenstn2.png


    all of those which look like it Fragments of lua code used to be images and folders of images...
    really weird, any suggestions?


    Edit: Looks like things just got worse....seems i cant delete that images directory, wouldn't let me, I went on to my psp, and that didn't work, it said "delete Failed"... WTF is going on?

    you memory card is corrupted. formating will make it work again. however, if it happens often, you memory card is either getting old, or is fake.
    --------------------------------------------------------------------------------------

  18. #5148
    QJ Gamer Silver
    Points: 11.326, Level: 70
    Level completed: 19%, Points required for next Level: 324
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    871
    Points
    11.326
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Hey when I print font text EG:

    screen:fontPrint(font,0,0 ,"I have probleme with this",White)

    The script works fine the image and everythig blit exept the Font script.Is it maybe because the .fft is to big if yes can somone explain me how to use this and how to resise the .ttf to the size of a normal screenrint function.Actualy I just want to know what is number dpiX/Y
    Font Font:setCharSize(number width, number height, number dpiX, number dpiY)
    Free Prizes at Prizerebel Join us!
    I already got 11 Gifts. Ask me for details or proof.

  19. #5149
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    ok, well, i think it was a corrupted Eboot, cuz I got a new kxploited one and put my game stuff in that one then moved everything to the stick so now every thing works as it should, however i still have that damn folder with the damned Image folder....i WOULD reformat it but i got about 3 and half GIGS of stuff on it...various..stuff...... o0... Got a 4 gig for Xmas :P I love it any way the folder only takes up about 150 kb so its not a Big problem...not anymore...
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  20. #5150
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Backshark I have the same type of problem when I was deleting the folder 'dh' Devhook it said it could not be deleted beacuase of one file called COOKIE.DAT So I went and found the file under 271 and deleted it. It WAS GONE. I tried deleting 'dh' and the FILE JUST CAME BACK???
    -= Double Post =-
    TO CHEEZPIRATE HOLD ON IM gonna make you your script again.
    Geändert von pspfreak9 (01-19-2007 um 03:28 PM Uhr) Grund: Automerged Doublepost

  21. #5151
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    use File Assistant for corrupted things :)

  22. #5152
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Does anyone know how to create a FPS counter??

  23. #5153
    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

    yes, i made a small snippet in the lua snippets thread.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  24. #5154
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    K thanks

  25. #5155
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    how do i check if a part of a table exists?
    Code:
    test = {foo=true, bar=0}
    if test.meep then
    -- was found
    else
    -- was not found
    end
    what would be the correct way to do that case? i cant find an "isset" kind of function

  26. #5156
    QJ Gamer Blue
    Points: 7.014, Level: 55
    Level completed: 32%, Points required for next Level: 136
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    U.S.
    Beiträge
    405
    Points
    7.014
    Level
    55
    Downloads
    0
    Uploads
    0

    Unhappy Please help out a noob (to lua)

    Okay, so I have just begun learning lua recently, and I am making a stupid app for practice/learning. I have this code:
    Code:
    --App by andyauff
    --Version .02 of "Useless Music App", finished January   , 2007
    
    --define colors---------------------------------------------------
    
    white = Color.new (255,255,255)
    blue = Color.new (0,0,255)
    black = Color.new (0,0,0)
    red = Color.new (255,0,0)
    green = Color.new (0,255,0)
    yellow = Color.new (255,255,0)
    purple = Color.new (255,0,255)
    
    --create the menu function----------------------------------------
    
    function drawMenu()  
    
    gamestate = "menu"
    oldpad = Controls.read()
    song = "mindwave"
    
    selector = { image = Image.createEmpty (145,15), x = 147, y = 77}
    selector.image:clear(yellow)
    
    screen:clear(green)
    
    pad = Controls.read()
    
    screen:blit(selector.x,selector.y,selector.image)
    
    screen:print(150,80,"Mindwave",blue)
    screen:print(150,100,"Minute",blue)
    
    --controls
    
    if pad:up() and oldpad:up() ~= pad:up() then
    selector.y = 77
    song = "mindwave"
    end
    
    if pad:down() and oldpad:down() ~= pad:down() then
    selector.y = 97
    song = "minute"
    end
    
    if pad:cross() and oldpad:cross() ~= pad:cross() then
    inGame()
    end
    screen.flip()
    end
    
    --create the game funtion------------------------------------------
    
    function inGame()
    
    gamestate = "start"
    
    pad = Controls.read()
    
    screen:clear(red)
    screen:print(150,100,"To play song, press X.",green)
    screen:print(150,120,"To pause song, press X again.",yellow)
    screen:print(150,140,"Enjoy!",purple)
    
    if pad:cross() and gamestate == "start" and song == "mindwave" then
    Music.playFile("mindwave.mod", false)
    gamestate = "playing"
    end
    
    if pad:cross() and gamestate == "start" and song == "minute" then
    Music.playFile("minute.xm", false)
    gamestate = "playing"
    end
    
    if pad:cross() and gamestate == "playing" then
    Music.pause()
    gamestate = "paused"
    end
    
    if pad:cross() and gamestate == "paused" then
    Music.resume()
    gamestate = "playing"
    end
    
    if pad:start() then
    gamestate = "menu"
    end
    screen.flip()
    end
    
    --main loop---------------------------------------------------------
    
    while true do
    
    drawMenu()
    oldpad = pad
    end
    First let me tell you what it is supposed to do- there is a start screen that is a menu with choices between 2 different songs to play. If you click (cross) on a song, it should go to a new screen that says "press x to play song, press x again to pause song, enjoy." The selected song should play once pressing cross, pause if cross is pressed again, and that's about it. I have many problems-the selector for the menu doesn't move, when I press X it sometimes plays music, sometimes it doesn't, and instead of pausing it stops it completely and starts back over when I press X again. Thanks for any help, I know this is confusing. Hopefully the code is at least sort of neat.

  27. #5157
    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 eyece
    how do i check if a part of a table exists?
    Code:
    test = {foo=true, bar=0}
    if test.meep then
    -- was found
    else
    -- was not found
    end
    what would be the correct way to do that case? i cant find an "isset" kind of function
    It would work since test.meep will return nil although I wouldn't recommend it from a programming style/design standpoint.

  28. #5158
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    no, thats what i tried, it didn't work, it just returns the "attempt to index field '?'" error,
    i may have to have all the table parts set to false, kind of gay though, LUA-Player v0.21 should have implemented something like this:
    if ~variable then
    ...
    end

  29. #5159
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Hey how can i like change print to a function like this:
    Code:
    print(buffer)
    to
    Code:
    if buffer ... then
    ...
    end
    Some thing like that. What im trying to say is how can i transfer what is printed to somewhere else

  30. #5160
    QJ Gamer Silver
    Points: 11.326, Level: 70
    Level completed: 19%, Points required for next Level: 324
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    871
    Points
    11.326
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Can somone anwser to my question please.Page 516 firstpost.
    Free Prizes at Prizerebel Join us!
    I already got 11 Gifts. Ask me for details or proof.


 

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 07:52 AM Uhr.

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