Seite 316 von 342 ErsteErste ... 216 266 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 ... LetzteLetzte
Zeige Ergebnis 9.451 bis 9.480 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; i decided to give u on my script. i tried everything to get it working....

  
  1. #9451
    QJ Gamer Gold
    Points: 13.240, Level: 74
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    May 2005
    Ort
    I live in a City that goes by the nickname:The Bubble. 'Nuff said.
    Beiträge
    1.766
    Points
    13.240
    Level
    74
    Downloads
    0
    Uploads
    0

    Standard

    i decided to give u on my script. i tried everything to get it working.



  2. #9452
    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 slicer4ever Beitrag anzeigen
    i'm not vary familiar with lua's 3D functions, however understanding openGL, and the pspgu, i'd suggest looking in the documentation for lua(which ever one your using, but i suspect pge?), for method calls which contain the word blend
    PGE doesn't currently have any 3D implentation

    But LP's 3d implementation is just the PSPSDK's functions with Gu.* or Gum.* rather than sceGu* or sceGum* so look in the SDK's samples as well
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

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

    really, i could have sworn pge was 3D capable, however your more of an expert on it than me
    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

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

    It was in the plans but got dropped for stability for an earlier release. IWN is adding it back in as we speak and has a beta with pretty good support of it and he's made a few demonstrations of its abilities.
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

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

    well than in that case fchaos, your going to want to look up sceGuBlendFunc(from what TP just said it should be just GuBlendFunc in lua) in the sdk documentation, http://psp.jim.sh/pspsdk-doc/group__...d3bf7d032c62b6

    that should help at least somewhat, since many of the blending functions available(not the operations) are similar to opengl's available blending functions, i suggest also looking up glBlendFunc to get a more better understanding of how the different blending functions work, anywho hope this helps=-)
    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

  6. #9456
    QJ Gamer Green
    Points: 5.981, Level: 50
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Texas
    Beiträge
    146
    Points
    5.981
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Alright then, I'll look into that, thanks for the replies.
    [IMG]http://img.photobucket.com/albums/v693/fchaos/koolaidsig.jpg[/IMG]

  7. #9457
    QJ Gamer Green
    Points: 3.918, Level: 39
    Level completed: 79%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    6
    Points
    3.918
    Level
    39
    Downloads
    0
    Uploads
    0

    Standard

    Okay, Lua semi-noob here, and I have a problem with a walking animation in my first game.

    Anyways, I blitted my character to the screen in a standing position. Using AnimLib v4.5, when right is pressed my player will walk right and play the walking animation. Everything works as it should except the animation is played on top of the standing still sprite, and it looks like a jumbled up mess.

    So, my question - How, using AnimLib v4.5 (I think that's latest version, and are there easier ways to animate besides AnimLib?), do I have my sprite standing still, then when right is pressed the walking animation is played, then when right is released it goes back to standing still?

    P.S. - Here's my code, and sorry if it's a mess...

    Code:
    player1 = Image.load("player1.png")
    player2 = Image.load("player2.png")
    player3 = Image.load("player3.png")
    player4 = Image.load("player4.png")
    player5 = Image.load("player5.png")
    player6 = Image.load("player6.png")
    background = Image.load("paper1.png")
    
    speed = "2"
    
    Player = {pic = player1, width = 32, hieght = 48, x = 0, y = 211}
    
    dofile("animLib.lua")
    player = ANIM.new("player", "png", 6)
    
    while true do
    pad = Controls.read()
    screen:clear()
    
    screen:blit(0, 0, background, false)
    screen:blit(Player.x, Player.y, Player.pic, true)
    
    if pad:right() then
    player:blit(Player.x, Player.y, 50)
    Player.x = Player.x + speed
    end
    
    if pad:cross() then
    speed = "4"
    else
    speed = "2"
    end
    
    screen:flip()
    
    screen:waitVblankStart()
    oldpad = pad
    end

  8. #9458
    Points: 5.711, Level: 48
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Beiträge
    39
    Points
    5.711
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    An easier way (but certainly not the best way) to animate would be to :
    Code:
    function animate(x,y,startx,starty,height,width,image)
        framecount = framecount + 1
        animtempo = 0
        if framecount == 6 then
    		framecount = 0
    		animtempo = animtempo + 1
    		if animtempo == 1 then
    			screen:blit(x,y,image,startx,starty,height,width)
    		else
    			screen:blit(x,y,image,animtempo *width,starty,height,width)
    		end
    	end
    end
    Thats off the top of my head I haven't done any debugging but it should work.
    PS: Use your whole spritesheet for this not the pieces of it

  9. #9459
    QJ Gamer Bronze
    Points: 8.665, Level: 62
    Level completed: 72%, Points required for next Level: 85
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Beiträge
    758
    Points
    8.665
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    But that doesn't use input, he wants to actually be able to control his character.
    What you posted was just for displaying an animation.

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

    just make 4 functions similar to bnc9's example, called animateRight animateLeft animateUp and animateDown. Then just do:

    if pad:right() then
    animateRight()
    end

    if pad:left() then
    animateLeft()
    end


    if pad:up() then
    animateUp()
    end


    if pad:down() then
    animateDown()
    end

    you would also have to move the character's x and y, accordingly, but I suspect that he knows how to do that already.

  11. #9461
    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 PSProgramer Beitrag anzeigen
    just make 4 functions similar to bnc9's example, called animateRight animateLeft animateUp and animateDown. Then just do:

    if pad:right() then
    animateRight()
    end

    if pad:left() then
    animateLeft()
    end


    if pad:up() then
    animateUp()
    end


    if pad:down() then
    animateDown()
    end

    you would also have to move the character's x and y, accordingly, but I suspect that he knows how to do that already.
    No. Make one animation function that takes a spritesheet and framesize and length per frame and then figures out which frame to be on internally and spits it out. Or at least not four hardcoded animation functions.
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

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

    lol, I know that there is a better way to do it, but I was keeping it simple. Thank you for telling him a better way though.

  13. #9463
    QJ Gamer Green
    Points: 3.918, Level: 39
    Level completed: 79%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    6
    Points
    3.918
    Level
    39
    Downloads
    0
    Uploads
    0

    Standard

    Thanks guys, I'll go try those examples out!
    Zitat Zitat von TurtlesPwn Beitrag anzeigen
    No. Make one animation function that takes a spritesheet and framesize and length per frame and then figures out which frame to be on internally and spits it out. Or at least not four hardcoded animation functions.
    I'm not sure I understand, but I'll try it and get back to ya! Thanks again.

    While I'm here, I have a question on a different game, my first game, I'm making, so i'll go ahead and ask it :Jump:

    I've been making my first game for a couple of days now, and it's almost done.

    In the game, you control a space ship - [X] makes the ship go up, [<] makes the ship go left, and [>] makes the ship go right. I've implemented some physics, so when you are not accelerating up, you will begin to fall, and if you are moving up and then let go of up then you will slow down, then begin to fall. The object of the game is to avoid asteroids as they fly across the screen.

    Anyways, I need to know how I could do collision detection on the asteroids, which are not perfectly round as they contain craters and things like that, and my ship. I'm new to collision, but I do not think the basic collision tutorial (one on EvilMana) will work. So what could I use to achieve my goal? I haven't found hardly any collision tutorials...

    Also, is it possible to do collision detection on spinning asteroids?

    Thanks

    And here's a screenshot to help understand how the game plays...
    (Never Mind, I have to have 10 posts :))
    Geändert von cjmabry25 (10-04-2008 um 05:50 PM Uhr) Grund: Needed to change something... again...

  14. #9464
    Points: 5.711, Level: 48
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Beiträge
    39
    Points
    5.711
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    @PSProgrammer: As TurtlesPwn said one function for all animations is better the example I posted allows you make animations for all directions instead of 4 hardcoded functions.

    @cjmabry25: uhh this might help but it'll be a little difficult to implement in your game: http://www.forums.evilmana.com/index.php?topic=1412.15
    check tacticalpenguins code and his explanation at the bottom.
    It involves collision with lines rather than boxes.
    You'll need to know a little bit about vectors to understand this.

  15. #9465
    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 bnc9 Beitrag anzeigen
    @PSProgrammer: As TurtlesPwn said one function for all animations is better the example I posted allows you make animations for all directions instead of 4 hardcoded functions.

    @cjmabry25: uhh this might help but it'll be a little difficult to implement in your game: http://www.forums.evilmana.com/index.php?topic=1412.15
    check tacticalpenguins code and his explanation at the bottom.
    It involves collision with lines rather than boxes.
    You'll need to know a little bit about vectors to understand this.
    Make the ship the box and make outlines of 4-10 lines for the asteroids to check collision with. Alternative is a pixel map and doing lots of little box collisions. Either way, do a "is it in the general area" check first.

    For rotation, rotate the borderlines with simple trig.
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

  16. #9466
    Points: 2.831, Level: 32
    Level completed: 54%, Points required for next Level: 69
    Overall activity: 0%

    Registriert seit
    Mar 2008
    Beiträge
    22
    Points
    2.831
    Level
    32
    Downloads
    0
    Uploads
    0

    Standard

    Is there any way to encrypt or decrypt lua files?

  17. #9467
    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

    Yes there is.

  18. #9468
    Points: 2.831, Level: 32
    Level completed: 54%, Points required for next Level: 69
    Overall activity: 0%

    Registriert seit
    Mar 2008
    Beiträge
    22
    Points
    2.831
    Level
    32
    Downloads
    0
    Uploads
    0

    Standard

    How?

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

    If you use it you fail.

    XtreamLua Compiler

  20. #9470
    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

    No, it's called luac, xtreamlua's compiler is an idiotic frontend that just made it easy for the mass noobs to use. And it is not encryption or decryption, it is simply compiling. However, unless you have extremely good reason and understand how and why compiling your script would be needed, you shouldn't compile it, and I seriously doubt you have such understanding.
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

  21. #9471
    QJ Gamer Green
    Points: 9.319, Level: 64
    Level completed: 90%, Points required for next Level: 31
    Overall activity: 99,0%

    Registriert seit
    May 2008
    Ort
    GA, USA
    Beiträge
    243
    Points
    9.319
    Level
    64
    Downloads
    0
    Uploads
    0

    Standard

    How can I switch between different main loops??? Like say I want to run gameA and I am currently playing gameB. How would I switch between the two. I have a variable called "layer" and its value tells my program which to do.

    IGNORE THIS POST!!!!! I fixed my problem.

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

    You should never have more than one main loop ...

  23. #9473
    QJ Gamer Blue
    Points: 2.467, Level: 30
    Level completed: 12%, Points required for next Level: 133
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    Pennsylvania
    Beiträge
    17
    Points
    2.467
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    How do I put .mp3 music in a lua script?

  24. #9474
    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

    You could open the lua script in notepad and drag and drop your mp3 on top of it.

  25. #9475
    QJ Gamer Blue
    Points: 2.467, Level: 30
    Level completed: 12%, Points required for next Level: 133
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    Pennsylvania
    Beiträge
    17
    Points
    2.467
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    What what i mean is how do i loop it so when i go to the certain script on my psp the music plays.

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

    Zitat Zitat von eldiablov Beitrag anzeigen
    You could open the lua script in notepad and drag and drop your mp3 on top of it.
    lol, eldiablov is in a "good mood" :ROFL: look, search this thread. I bet someone has asked this.

  27. #9477
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    What would be the best type of collision for a fighting game?
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

  28. #9478
    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

    i'd suggest a box collision first, than do a pixel collision if the box collision passes
    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. #9479
    QJ Gamer Green
    Points: 4.034, Level: 40
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    467
    Points
    4.034
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Ok ill try it
    My Releases:
    ---------------------------------------------------
    [URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]

    [URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]

    [URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]

    [URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]

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

    You shouldn't need anything more accurate than box collision for a fighting game.


 

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

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