Seite 288 von 342 ErsteErste ... 188 238 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 338 ... LetzteLetzte
Zeige Ergebnis 8.611 bis 8.640 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; how do you get in to use the code?...

  
  1. #8611
    Points: 2.507, Level: 30
    Level completed: 38%, Points required for next Level: 93
    Overall activity: 0%

    Registriert seit
    May 2008
    Beiträge
    3
    Points
    2.507
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    how do you get in to use the code?



  2. #8612
    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

    omegaridley - You clearly didnt read my post correctly lol. I said nothing about moving things around or even to load after the code executes. i'm saying that in order for Ogg.EndOfStream() to return anything but nil, an Ogg must be loaded. That's all i'm saying for the second time. You should be able to figure out how to make sure an Ogg is loaded before executing code that contains Ogg.EndOfStream(), if not and even still please start with very early basics and fundamentals, learning by trial and error isn't a very good path to go.

    scryerth - what...?

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


  3. #8613
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von scryerth
    how do you get in to use the code?
    It sounds like you have a problem with your PSP, not LUA. LUA is just a scripting language for creating basic applications and games. Go post in the PSP General Help forum.

  4. #8614
    Points: 2.784, Level: 32
    Level completed: 23%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Mar 2008
    Beiträge
    40
    Points
    2.784
    Level
    32
    Downloads
    0
    Uploads
    0

    Talking

    Zitat Zitat von SG57
    omegaridley - You clearly didnt read my post correctly lol. I said nothing about moving things around or even to load after the code executes. i'm saying that in order for Ogg.EndOfStream() to return anything but nil, an Ogg must be loaded. That's all i'm saying for the second time. You should be able to figure out how to make sure an Ogg is loaded before executing code that contains Ogg.EndOfStream(), if not and even still please start with very early basics and fundamentals, learning by trial and error isn't a very good path to go.

    scryerth - what...?
    i DO have an OGG loaded before the Ogg.EndOfStream(), look at my code:

    Code:
    white = Color.new(255, 255, 255)
    green = Color.new(0, 255, 0)
    background = Image.load("SYSTEM/images/background.png")
    Ogg.load("SYSTEM/music/system.ogg")
    while true do
    done = false
    pad = Controls.read()
    if pad:cross() and done == false then
    
    System.message("UMD ISO will be dumped in name 9660.ISO, if u have a UMD dumped by this app, rename the ISO in the memory stick. Are you ready to dump the UMD?",1)
    button = System.buttonPressed(1) if button == "yes" then UMD.ripISO("ms0:/ISO/9660.ISO") end
    button = System.buttonPressed(1) if button == "no" then end
    done = true end
    if done == false then
    
    if Ogg.EndOfStream() == "true" then
    Ogg.play()
    end
    
    screen:blit(0, 0, background, false)
    screen:print(1, 1, "Press X to Dump UMD Game", white)
    end
    but it STILL returns nil...
    i have tried Ogg.eos() and the error goes away, but doesnt loop the song...?
    Geändert von omegaridley (05-12-2008 um 04:37 AM Uhr) Grund: Automerged Doublepost

  5. #8615
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    white = Color.new(255, 255, 255)
    green = Color.new(0, 255, 0)
    background = Image.load("SYSTEM/images/background.png")
    Ogg.load("SYSTEM/music/system.ogg")
    Ogg.play()
    while true do
    done = false
    pad = Controls.read()
    if pad:cross() and done == false then
    
    System.message("UMD ISO will be dumped in name 9660.ISO, if u have a UMD dumped by this app, rename the ISO in the memory stick. Are you ready to dump the UMD?",1)
    button = System.buttonPressed(1) if button == "yes" then UMD.ripISO("ms0:/ISO/9660.ISO") end
    button = System.buttonPressed(1) if button == "no" then end
    done = true end
    if done == false then
    
    if Ogg.EndOfStream() == "true" then
    Ogg.play()
    end
    
    screen:blit(0, 0, background, false)
    screen:print(1, 1, "Press X to Dump UMD Game", white)
    end
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  6. #8616
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    I need help. Not with scripting but generally, i dont understand wifi much and 3d and would like to know if there are any gd snippets/examples etc. Also with wifi you connect to an server? ( i think) could you possible connect to an web pg OR would you have 2 have your own server, if So how would you make an server?

  7. #8617
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  8. #8618
    Points: 2.718, Level: 31
    Level completed: 79%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    May 2008
    Beiträge
    26
    Points
    2.718
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    I still cant get the Ogg to work...
    -= Double Post =-
    Zitat Zitat von jaki54321
    I still cant get the Ogg to work...
    oops ignore my post, wrong forum...
    Geändert von jaki54321 (05-12-2008 um 01:57 PM Uhr) Grund: Automerged Doublepost

  9. #8619
    QJ Gamer Blue
    Points: 3.726, Level: 38
    Level completed: 51%, Points required for next Level: 74
    Overall activity: 27,0%

    Registriert seit
    Jun 2007
    Beiträge
    82
    Points
    3.726
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    So far i've created a basic menu for a game but i can't go into a sub-menu. When i go into the sub-menu it will execute the file once then go back to the main menu so i'm wondering what the best way to fix this is (i'm guessing some kind of loop)

    EDIT: The sub-menu is a separate .lua file loaded into the main script through dofile

  10. #8620
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    Could you post the code up? by sub-menu do u mean options, credits etc.

  11. #8621
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von drag_93
    EDIT: The sub-menu is a separate .lua file
    there is your problem
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  12. #8622
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    No, the problem is that he does not have a main loop in his sub-menu. My guess is that he copied the menu code from somewhere and has no idea how games and applications usually run.

  13. #8623
    QJ Gamer Blue
    Points: 4.074, Level: 40
    Level completed: 62%, Points required for next Level: 76
    Overall activity: 0%

    Registriert seit
    Jun 2007
    Ort
    Melfi PZ
    Beiträge
    76
    Points
    4.074
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    how i can go to next line (with one string?) i used '\n' but it din't work (i see the square)

  14. #8624
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    Code:
     
    file:write("Player.x = 165 "...\n)
    This would be an better example were u would use \n :)
    Geändert von dan369 (05-16-2008 um 12:22 PM Uhr)

  15. #8625
    QJ Gamer Blue
    Points: 4.074, Level: 40
    Level completed: 62%, Points required for next Level: 76
    Overall activity: 0%

    Registriert seit
    Jun 2007
    Ort
    Melfi PZ
    Beiträge
    76
    Points
    4.074
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    i will try thank you

  16. #8626
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    you can only use the \n statement when saving to a file, you cant for examplr do this

    screenrint(10, 10, "hello\n hi")

    as it will be on one line, if you load it from a file then you can use

    for line in file:lines() do

    end

    to display then sequentially on the screen
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  17. #8627
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Wow...i haven't coded lua in a while. Do you guys recommend that i go back to it?
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  18. #8628
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    not if you know c no
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  19. #8629
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Why not? Lua is like a sexy blonde chick. They are really hot and juicy, but they are very simple and ignorant to be enticed into your malicious intentions.
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  20. #8630
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    lol fine but there isnt much left to make, it mainly just for the fun of it that people make stuff in lua anymore
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  21. #8631
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Cool

    Zitat Zitat von FaT3oYCG
    lol fine but there isnt much left to make, it mainly just for the fun of it that people make stuff in lua anymore
    so true :)

  22. #8632
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG
    lol fine but there isnt much left to make, it mainly just for the fun of it that people make stuff in lua anymore
    actually, there havent been many fun card games in lua that i know of, i am making one based of uno, when it is at least playable i am gonna release it
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

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

    Not True ifiwere1337: PSPMillionaire BEST Lua Game Ever

  24. #8634
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von xpack
    Not True ifiwere1337: PSPMillionaire BEST Lua Game Ever
    thats not a card game, is it?
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

  25. #8635
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Red face

    Zitat Zitat von xpack
    Not True ifiwere1337: PSPMillionaire BEST Lua Game Ever
    I wouldn't call PSPMillionaire an Card game more like an question game.

  26. #8636
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    Just wondering, is there a known limitation in LuaPlayer 0.16 in that it doesn't support semi-transparency when blitting to an image?

  27. #8637
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    I don't know for SURE but I almost always run stuff on 0.16 modded with a couple extra functions and I've never had any issues. Details about what you might be referring to and I'll try to recreate it

  28. #8638
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    Well, I've got a image buffer, on which I blit unanimated objects at the start of a level and whenever something changes. I just noticed when I transfered one of my more complex objects (rather than just the little sprites I've only been using previously) from my blit-every-frame table to my blit-to-the-buffer table, that it was blocky and aliased. This seams to be because all semi-transparent pixels are being made fully-transparent. Here is the basic scenario:
    Code:
    object = {}
    object.pics = {side = Image.load("side.png")}
    
    object[1] = {type = "hexagonthing",x = 0, y = 0, width = 30,height = 30} --This would be created by an object.new function
    
    object.intFunction = {
    	["hexagonthing"] = function(aObject)
    		object.buffer:blit(aObject.x,aObject.y,object.pics.side)
    	end
    }
    
    object.intDraw = function()
    	object.buffer = Image.createEmpty(480,272)
    	object.buffer:clear(Color.new(0,0,0))
    	for i,aObject in ipairs(object) do
    		object.intFunction[aObject.type](aObject)
    	end
    end
    
    object.intDraw()
    
    while true do
    	screen:blit(0,0,object.buffer)
    	screen.waitVblankStart()
    	screen.flip()
    end
    The example image is attached, you will notice is looks a lot better when blitted directly.

    P.S. Yeah, 0.16 is great apart from the few annoying things that are broken(SIO,Font:getTextSi ze, etc.)
    Angehängte Grafiken Angehängte Grafiken  
    Geändert von Nielkie (05-22-2008 um 06:00 AM Uhr)

  29. #8639
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    OK, How would you make an object move without an if statement, AI? I want to move sumthing left and right without any IF statement.
    Also How would you do it that so when the object is going back and forth and you hit into this object that you would DIE?

    Note: Not good with collisions or Ai, thats why i'm asking 4 help :)

  30. #8640
    Points: 2.658, Level: 31
    Level completed: 39%, Points required for next Level: 92
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    47
    Points
    2.658
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    If you're going to make an AI it's probably going to have at least one if statement in it. If you want it to walk three spaces left then three spaces right and then loop you'd have to make a loop that checked its position or a counter and caused it to step left until its position was as far left as you wanted and then step right until its position was as far right as you wanted.

    step = 0
    while 1 do
    if step < 3 then
    stepleft()
    else
    stepright()
    end
    step = (step + 1) % 6
    end

    As for collision detection you'll just need to compare your x,y with the object's x,y and if they're equal then trigger your 'die' event or whatever. Sorry, this question is really too vague to give more of an answer.

    There are tutorials available on AI and collision around the scene. Poke around a bit and see what you can find. These things are not as mysterious or difficult as they may sound.


 

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

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