Seite 286 von 342 ErsteErste ... 186 236 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 336 ... LetzteLetzte
Zeige Ergebnis 8.551 bis 8.580 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; no because the dpad is not the triangle, square, circle, cross, l, r, start, select, home, note, screen, vol up, ...

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

    no because the dpad is not the triangle, square, circle, cross, l, r, start, select, home, note, screen, vol up, vol down or analougue buttons it is the directional pad


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

  2. #8552
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Yeah, sry turtlesPwN I didn't think of that last night, thanks for improving it
    -= Double Post =-
    By the way, i don't know if any of you have seen my post, but I am in need for some grafix artists,and/or a co programer for a Zelda game I'm working on in lua. PM me if your interested, or just reply on this thread
    Geändert von PSProgramer (05-02-2008 um 05:28 AM Uhr) Grund: Automerged Doublepost

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

    Umm, klepto, what exactly was wrong with how I did it, and what exactly did you fix? Nothing?

    edit: oops typo what->was
    Geändert von TurtlesPwn (05-03-2008 um 07:56 AM Uhr)

  4. #8554
    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 FaT3oYCG
    no because the dpad is not the triangle, square, circle, cross, l, r, start, select, home, note, screen, vol up, vol down or analougue buttons it is the directional pad
    yeah like i said i would also like to add that people use the word pad and oldpad because it is quicker to do instead of typing the whole thing every time using Dpad just makes it take longer it has an extra letter and you have to press the shift key even if it was all in lowercse it would still be wrong because every button on the psp is not the Dpad it is the controls hence Controls.read() incase you didnt know Dpad stands for directional pad so all you managed to do was give some bad advice no offense
    ------ 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).

  5. #8555
    QJ Gamer Blue
    Points: 3.563, Level: 37
    Level completed: 43%, Points required for next Level: 87
    Overall activity: 54,0%

    Registriert seit
    Sep 2007
    Beiträge
    149
    Points
    3.563
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    Thanks. For the fastest with anwser me. What abotu that one.

    I'll want to creat a drum app. I wnt to load my sound and associate them to a name. Then I want to, if i push X, per exemple, play the sound associate to "kick" bu tonly once. Do u know how i have to do that.

    I alerdy try but i wasn'n able.

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

    If you can't figure that out, stop attempting to create anything. Besides, drum and soundboard apps have already been beaten to death.

  7. #8557
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    look I am all against people putting don new programers for trying, but I might have to kinda agree with TurtlesPwn. I mean there are already a TON of drum and sound apps, so I mean unless you are like dead-set on making this, I would sugest making something else. But thats just me.

  8. #8558
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TurtlesPwn
    Umm, klepto, what exactly was wrong with how I did it, and what exactly did you fix? Nothing?

    edit: oops typo what->was
    The point I was trying to make was that what you were doing was the same in concept as what the previous coder was doing. Your if conditional logic was slightly different, but nothing revolutionary. Your statement of his way being "horrible" got under my skin, since your method displayed nothing novel. Plus it was late and I was cranky.

  9. #8559
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Alright, I have a question, hehe, How would I go about unbliting an object. Let me explain, I want like a coin on the screen right, so the character can collect it. I can do that part. But I want to have it disapear when the character walks over the coin. Also how can you put the coins randomly in a selected space like in only in a 100x100 invisible box?? thanx aton

    -PSProgramer

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

    Zitat Zitat von KleptoOne
    The point I was trying to make was that what you were doing was the same in concept as what the previous coder was doing. Your if conditional logic was slightly different, but nothing revolutionary. Your statement of his way being "horrible" got under my skin, since your method displayed nothing novel. Plus it was late and I was cranky.
    My method was made to accomplish the same thing as his method, but he was using if pad:cross() and oldpad:cross() ~= pad:cross() then, which makes three function calls to the input data while only really needing two.

    PSProgrammer - make a table with the items x, y, image, and a variable indicating whether it has been picked up. when it has not been picked up, blit it and check if the player is over it. then when it is picked up, stop blitting it and stop checking if the player is over it.

  11. #8561
    QJ Gamer Blue
    Points: 4.268, Level: 41
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    497
    Points
    4.268
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    thanx turtlesPwn

  12. #8562
    Points: 2.761, Level: 32
    Level completed: 8%, Points required for next Level: 139
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    8
    Points
    2.761
    Level
    32
    Downloads
    0
    Uploads
    0

    Standard

    What does the System.startOSK() function in LuaPlayerHM 6.x do? Does it start the sony OSK or some other one?

    And if it uses the Sony, how do you use that OSK in a program?

  13. #8563
    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

    PSProgramer-
    Code:
    Coin_Start = 1 
    Coin_End = 2 
    Coin_1 = {}
    Coin_1.x = 10
    Coin_1.y = 10
    Coin_1.visible = "true"
    Coin_1.img = Coin
    
    Other Variables 
    
    function Coin()
    
    for a = Coin_Start, Coin_End 
    if Coin_1.visible  = "true" then
    screen:blit(Coin_1[a].x, Coin_1[a].y, Coin_1[a].img)
            end 
      end
    end
    
    Other Functions
    
    if Player.x == 10 and Player.y == 10 then  
    Coin_1.visible = "false" 
    end
    Other ENDING STUFF
    It should work, I'm using this method On my PSP-SuperMarioBros. game to blit blocks :)

    remember to call the function
    Code:
     
    Coin()

  14. #8564
    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 PSPMod999
    What does the System.startOSK() function in LuaPlayerHM 6.x do? Does it start the sony OSK or some other one?

    And if it uses the Sony, how do you use that OSK in a program?
    Code:
    text_output = System.startOSK("name1", "name2")
    then text_output is whatever the user typed so

    Code:
    screen:print(10, 10, text_output)
    would show that text 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).

  15. #8565
    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'm guessing name1 and name2 are variables?

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

    no you have to put them in though otherwise it wont work i think that they are displayed when the osk is shown
    ------ 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. #8567
    QJ Gamer Bronze
    Points: 5.583, Level: 48
    Level completed: 17%, Points required for next Level: 167
    Overall activity: 0%

    Registriert seit
    May 2007
    Beiträge
    127
    Points
    5.583
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von dan369
    PSProgramer-
    Code:
    Coin_Start = 1 
    Coin_End = 2 
    Coin_1 = {}
    Coin_1.x = 10
    Coin_1.y = 10
    Coin_1.visible = "true"
    Coin_1.img = Coin
    
    Other Variables 
    
    function Coin()
    
    for a = Coin_Start, Coin_End 
    if Coin_1.visible  = "true" then
    screen:blit(Coin_1[a].x, Coin_1[a].y, Coin_1[a].img)
            end 
      end
    end
    
    Other Functions
    
    if Player.x == 10 and Player.y == 10 then  
    Coin_1.visible = "false" 
    end
    Other ENDING STUFF
    It should work, I'm using this method On my PSP-SuperMarioBros. game to blit blocks :)

    remember to call the function
    Code:
     
    Coin()
    I would do something like this instead;

    Code:
    g_Coins = {}
    g_Coins[ (10 * 1000) + 10 ] = 1
    
    other functions.......
    
    
    local i
    for i in pairs(g_Coins) do	
    	local col = i % 1000
    	local row = (i - col) / 1000 
    	-- the subtraction stops turning it into decimals
            -- and removes need for math.floor etc
            -- unless your lua is compiled for integer numbers only
    	screen:blit(row, col, Coin)
    end
    you could stick the row/col calcs inline and remove two local vars, i left it in as it helps explain what I am doing, but for non tutorial code I would do it as one line of code inside the screen:blit...

    to 'delete' a coin set its entry to nil like. also you would need to do screen bounds checking etc etc etc. setting something to nil deletes that entry in the table.

    Code:
    g_Coins[ (10 * 1000) + 13 ] = nil
    thus we just deleted the coin at row 10, column 13.

    Oh, the 1000 stuff is assuming 1000 columns per row. If your map is < 1000 tiles wide your safe :)

    why are you using true and false as strings and not the built in lua constants?

    Lua's tables are powerful. use them. I hope your Zelda game isn't full of the above type of coding, all those if statements and extra table entries like your coin example. Use the power of iterators and table hashes that lua gives you!

    You could just abstract g_Coins into a generic table and have each row/col entry point to its sprite, eg:

    Code:
    g_Overlays= {}
    g_Overlays[ (10 * 1000) + 10 ] = Mushroom
    g_Overlays[ (10 * 1000) + 11 ] = CoinSprite
    
    local i, sprite
    for i, sprite in pairs(g_Overlays) do	
    	screen:blit((i - (i%1000)) / 1000 ,  i % 1000 , sprite)
    end
    -- Code Monkey : Sarien, Fishguts, Cracks and Crevices --

    "Did IQ's just drop sharply while I was away?" (Ripley)

  18. #8568
    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

    Standard

    The name1 and name2 are the text already in the osk display, and what it says on the osk. For example, "Type text here" and "Sony's OSK". Try it out and you'll see what I mean.

  19. #8569
    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

    df - True, it's an alternate method using math. I don't use much math, i'll gunna take a look into using some

  20. #8570
    Points: 2.761, Level: 32
    Level completed: 8%, Points required for next Level: 139
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    8
    Points
    2.761
    Level
    32
    Downloads
    0
    Uploads
    0

    Standard

    Thx for the help, FaT3oYCG.

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

    Exclamation can anyone help out?

    I keep getting this error when using my program:

    :8: '=' expected near 'button'

    here is line 8:

    Code:
    System.buttonPressed(1) If button == "yes" then UMD.ripISO("ms0:/ISO/9660.ISO") end

    I read many tutorials and the functions.txt that came with luaplayerHM v6.6.


    Can anyone help?

  22. #8572
    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

    Use the Lua Help Thread plz...

    And you capitalized the 'If', make the I lowercase.

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


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

    Post

    Zitat Zitat von SG57
    Use the Lua Help Thread plz...

    And you capitalized the 'If', make the I lowercase.
    sorry about the thread thing and i will try what u suggested.

    i forgot that LUA is case sensitive

  24. #8574
    Art
    Art ist offline
    Bush Programmer
    Points: 60.149, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    3.658
    Points
    60.149
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Lol, you're kidding? There's actually a LUAplayer function to rip an ISO?
    I wonder what Shine would have thought about making that as easy as one line.

  25. #8575
    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

    "Lua"? heh, now don't go thinking Lua's syntax is so unique ;)

    Art - Personally, I'm losing more and more respect for Lua users by the update ;)

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


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

    Post thx!

    It worked, now my program is 100% working now!!!

    thanks for ur help!!!

    Note: its not a bricker!
    -= Double Post =-
    Zitat Zitat von Art
    Lol, you're kidding? There's actually a LUAplayer function to rip an ISO?
    I wonder what Shine would have thought about making that as easy as one line.
    there is, and it works 100%!!!


    dumps really fast! used it may times and i all games have worked 100%!

    btw luv ur time baby app, but i have a slim, so i use time machine and it works well!
    Geändert von omegaridley (05-09-2008 um 08:23 PM Uhr) Grund: Automerged Doublepost

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

    Post background

    I want to make a background to my app insted of a black screen, how do I do so?

    i need some codes, can anyone help out?

  28. #8578
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    simply load whatever background image you want to use than have that be the first image you blit to the screen

    i havent used lua in a long time so i don't remeber the load command but i do remeber the blit:

    screen:blit(0, 0, bg) <--correct me if i'm wrong anyone

    anyways bg is the image and simple google lua image loading commands, or go back a page or two in this thread until you see someone who has loaded an image
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  29. #8579
    Art
    Art ist offline
    Bush Programmer
    Points: 60.149, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    3.658
    Points
    60.149
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    "Lua"? heh, now don't go thinking Lua's syntax is so unique
    Well mine wasn't as simple to code as:
    Code:
    RipISO(); // Please
    I hated the idea of one on a forum. Now there can be hundreds of them.

    btw luv ur time baby app, but i have a slim, so i use time machine and it works
    Thanks. Funny I thought Time Machine would stuff up the graphics.

  30. #8580
    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

    Post

    Zitat Zitat von slicer4ever
    simply load whatever background image you want to use than have that be the first image you blit to the screen

    i havent used lua in a long time so i don't remeber the load command but i do remeber the blit:

    screen:blit(0, 0, bg) <--correct me if i'm wrong anyone

    anyways bg is the image and simple google lua image loading commands, or go back a page or two in this thread until you see someone who has loaded an image
    nvm i got it already, u were right though, thx for ur help!


 

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 .