Seite 203 von 342 ErsteErste ... 103 153 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 253 303 ... LetzteLetzte
Zeige Ergebnis 6.061 bis 6.090 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; You've got the general method correct, but if you wanna get rid of the offset for the . and .. ...

  
  1. #6061
    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've got the general method correct, but if you wanna get rid of the offset for the . and .. directories, just add table.remove(files,1) table.remove(files,1) so that it gets rid of them and do it without the offset and count crap.



  2. #6062
    QJ Gamer Blue
    Points: 5.056, Level: 45
    Level completed: 53%, Points required for next Level: 94
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    347
    Points
    5.056
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    im making a personal lua flasher (key word = PERSONAL), and i want to incorporate extra checks before and after i flash the file. for example, lets say i try to flash an .rco and the filesize was supposed to be 242 kb, but the custom one being flashed is only 200 kb. i want the script to refuse to flash the file.

    i'm sure this is pretty simple, but ive never had to do this before.

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

    Read the post just above for the method of getting file size and then once youve got that make a function like

    if filesize(rco) then
    -- flash file
    else
    -- error
    end

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

  4. #6064
    QJ Gamer Blue
    Points: 5.056, Level: 45
    Level completed: 53%, Points required for next Level: 94
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    347
    Points
    5.056
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    ok thanks, didnt read the posts above.
    EDIT: also, the filesize will be in bytes, right?
    -= Double Post =-
    one more question - how would you check the free space of flash0?

    thanks for the help.

    EDIT2: aahhh, another question - make that 2. first of all, with the new flash luaplayer, i get errors of iounassign, ioassign, etc, even in SG57's example. however, SG57's example worked, regardless. How can i fix these errors? i dont want luaplayer to be having errors as i'm flashing...

    2nd question - luaplayer gives me the error that on line 91, it cannot find 'ms0:/wavebackup/', no script file found. Here is the line of code:

    Code:
    System.writeFile("flash0:/vsh/resource/system_plugin_bg.rco","ms0:/wavebackup/","no")
    this line of code is after i re-assign flash0. i tried replacing "ms0:/wavebackup/" with "ms0:/wavebackup/system_plugin_bg.rco.back up" but i still get the same error - luaplayer can't find the script "ms0:/wavebackup/system_plugin_bg.rco.back up".

    i would appreciate the answer as well as an explanation as to why luaplayer is looking for a script in this line of code.

    Thanks again and sorry for so many questions.
    Geändert von parm289 (03-14-2007 um 01:51 PM Uhr) Grund: Automerged Doublepost

  5. #6065
    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

    parm - There is no io.Assign or io.Unassign.

    There is System.Assign and System.Unassign ;)

    As for your writeFile error, the second parameter ('destination file') isnt the destination folder, but the destination file. So...

    Code:
    System.writeFile("flash0:/vsh/resource/system_plugin_bg.rco","ms0:/wavedump/dumped_wave.rco","no")
    That s what u want (note, you can change it from dumped_wave.rco to whatever.)

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


  6. #6066
    QJ Gamer Blue
    Points: 5.056, Level: 45
    Level completed: 53%, Points required for next Level: 94
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    347
    Points
    5.056
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    thanks, i figured the destination thing out and hit myself on the head.

    as for the other part of your post, it isnt what u think is happening. when i exit any app by using the home button, a bunch of huge text pops up saying things like "io.assign p_kl: error_" and i was wondering what was happening in luaplayer. id feel much safer if no errors popped up, ya know what i mean?
    Geändert von parm289 (03-14-2007 um 05:46 PM Uhr) Grund: typos...

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

    parm - That happens on all versions of lua player. Its the deinitialization of various libraries (mikmod mainly). Try it on a different version and youll see the same thing ;)

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


  8. #6068
    QJ Gamer Blue
    Points: 4.509, Level: 42
    Level completed: 80%, Points required for next Level: 41
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    United Kingdom
    Beiträge
    63
    Points
    4.509
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Does anyone know what the exit code is in Lua player 20 in 16 it was

    os.exit()

    doesnt work in 20. Whats the 20 exit code


    Thanks

  9. #6069
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    try break ?

  10. #6070
    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

    break from what i understand in c++ and im assumming its the same in lua will just exit the loop. but it might work

    you can try System.Quit() or whatever. but i think thats only in the mod one.
    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!

  11. #6071
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    There is no exit code. os.exit() just returns the value you give it (ex: os.exit(1)) to the parent process what executed it.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  12. #6072
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    youresam will break work ?

    zomg look at your points !

  13. #6073
    QJ Gamer Blue
    Points: 5.056, Level: 45
    Level completed: 53%, Points required for next Level: 94
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    347
    Points
    5.056
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    SG57 - thanks for the info, i hadnt seen it before.

  14. #6074
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Would it be feasible to make curveball in lua for someone of my programming ability ?

  15. #6075
    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 eldiablov
    Would it be feasible to make curveball in lua for someone of my programming ability ?
    3d? maybe. im working on a port of curveball right now, and its not too challenging, but curving is complicated.
    --------------------------------------------------------------------------------------

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

    Grimfate - What about Assualt, Space Escape, etc.?

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


  17. #6077
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov
    youresam will break work ?

    zomg look at your points !
    Break just exits the current loop, be it while or for.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  18. #6078
    QJ Gamer Gold
    Points: 12.189, Level: 72
    Level completed: 35%, Points required for next Level: 261
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Under Your Bed
    Beiträge
    3.083
    Points
    12.189
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    os.exit() is the exit code for Shines luaplayer, but the mods use System.Quit(). Find out what luaplayer your using and that should fix everything.

  19. #6079
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von xpack
    os.exit() is the exit code for Shines luaplayer, but the mods use System.Quit(). Find out what luaplayer your using and that should fix everything.
    ...........
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  20. #6080
    QJ Gamer Green
    Points: 6.446, Level: 52
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    beside my PC
    Beiträge
    520
    Points
    6.446
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    hi can anyone give me an idea to show image in the screen screen like credits while loading the app?

    lets say something like a credit and name of the app will stay 3 secs then go to the main app...
    thx in advance

  21. #6081
    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

    Start a timer then blit the image and text according to the timer. I could write some code but its your game/app so Im sure you want to. lol (too lazy)
    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!

  22. #6082
    QJ Gamer Green
    Points: 6.446, Level: 52
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    beside my PC
    Beiträge
    520
    Points
    6.446
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    hmmm i there a tut for that?
    i dunno about the blit thing..
    i know how to use the timer

    thx

  23. #6083
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Image.blit(target,x,y,ima ge)
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  24. #6084
    Points: 3.455, Level: 36
    Level completed: 70%, Points required for next Level: 45
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Ort
    UK
    Beiträge
    12
    Points
    3.455
    Level
    36
    Downloads
    0
    Uploads
    0

    Standard

    Hi

    can anybody help me with this coding, if X pressed image upload.
    I have tryed this but doesn't work.

    code:
    if pad:cross () then
    image.load("image.png")
    _________________________ _
    But that doesn't work

  25. #6085
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    you don't need a timer.

    just do:
    Code:
    screen:clear()
    screen:blit(0,0,backgroundimage)
    screen.watiVblankStart(60)
    the 60 there can be changed to any number to wait longer or shorter
    -= Double Post =-
    Zitat Zitat von playstationpod
    Hi

    can anybody help me with this coding, if X pressed image upload.
    I have tryed this but doesn't work.

    code:
    if pad:cross () then
    image.load("image.png")
    _________________________ _
    But that doesn't work
    two things. first you need to assign that image to a variable. Also, the 'i' in image.load needs to be uppercase. heres what you should have:
    Code:
    variablename = Image.load("image.png")
    Geändert von emericaska8r (03-16-2007 um 09:55 AM Uhr) Grund: Automerged Doublepost

  26. #6086
    QJ Gamer Green
    Points: 6.446, Level: 52
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    beside my PC
    Beiträge
    520
    Points
    6.446
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    you don't need a timer.

    just do:
    Code:
    screen:clear()
    screen:blit(0,0,backgroundimage)
    screen.watiVblankStart(60)
    thx but...

    hmm how do i load the image?

    srry

  27. #6087
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    bla = Image.load("image.extensi on")

  28. #6088
    QJ Gamer Green
    Points: 6.446, Level: 52
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    beside my PC
    Beiträge
    520
    Points
    6.446
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    screen:clear()
    screen:blit(0,0,backgroundimage) <-----ill leave this alone? or should i put the filename?
    screen.watiVblankStart(60 )
    -= Double Post =-
    hmm it wont load load
    Geändert von ai3gtmc (03-16-2007 um 10:20 AM Uhr) Grund: Automerged Doublepost

  29. #6089
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Guys remember that lua uses variables and OOP.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  30. #6090
    QJ Gamer Green
    Points: 6.446, Level: 52
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    beside my PC
    Beiträge
    520
    Points
    6.446
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    hmmm i feel out of place lol...
    -= Double Post =-
    This is my code:

    Code:
    screen:clear()
    screen.watiVblankStart(180)
    backgroundimage = Image.load("credits.png")
    screen:blit(0,0, backgroundimage)
    I get errors
    Geändert von ai3gtmc (03-16-2007 um 10:34 AM Uhr) Grund: Automerged Doublepost


 

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

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