Seite 140 von 342 ErsteErste ... 40 90 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 190 240 ... LetzteLetzte
Zeige Ergebnis 4.171 bis 4.200 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; if i post my source can u guys look at it because i have a lot of problems in it ...

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

    if i post my source can u guys look at it because i have a lot of problems in it and i cant just post them all.


    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!

  2. #4172
    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 sure

    Zitat Zitat von GuitarGod1134
    if i post my source can u guys look at it because i have a lot of problems in it and i cant just post them all.
    yea just post it, and we can all look over it.

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

    hey who knows the command to return the current fps? i looked though several commands list but coudn't find it
    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. #4174
    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 have to use a combination of stuff, ive seen it somewhere before.....

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

    You have to work it out yourself. The FPS is 1 / TheTimeTakenToCompleteOne Frame.

  6. #4176
    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 know that but i was just wondering if there was a command for it i guess i'll figure it out
    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

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

    Theres a combination of 2-3 functions that can do it for you. Ive seen it before on evilmana or psp-programming IIRC, look around and you oughta find it.

  8. #4178
    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

    There are so many bugs in my game and it would be appreciated if anyone could give any help at all thanks.

    Ok here is my menu code
    Spoiler for Menu Code:
    -- Lua Rock Paper Scissors
    -- Lua RPS v 0.2
    --Script written by GuitarGod1124 or GuitarGod1134

    -- lets get some variables up
    red = Color.new(255, 0, 0)
    green = Color.new(0, 255, 0)
    menu = Image.load("menu.png")

    -- now for the main loop
    --x=width y=height
    while true do

    -- print instructions on the screen
    screenrint(0,0, " The Following Controls Are...", green)
    screenrint(0, 10, "X = Single Player", green)
    screenrint(0, 20, "O = Multiplayer", red)
    screenrint(0, 40, "Triangle = Exit Game", green)

    -- we need a background
    for a = 0, 14 do
    for b = 0,8 do
    end
    screen:blit(32 * a, 32 * b, menu)

    -- declare the variable for the buttons
    pad = Controls.read()

    --this is for single player
    if pad:cross() then
    dofile("singleplayer.lua" )
    end

    --this is for multiplayer
    if pad:circle() then
    dofile("multiplayer.lua")
    end

    --this is for quiting the game
    if pad:triangle() then
    os.exit()
    end

    screen.waitVblankStart()
    screen.flip()
    end







    This is the single player code
    Spoiler for Single Player Code:
    -- *******Lua Rock Paper Scissors***********
    -- Script written by GuitarGod1241 or GuitarGod1134 or GuitarGod1124
    -- DUE TO POPULAR DEMAND WE NOW HAVE SINGLE PLAYER!!!

    --variables
    rock = Image.load("rock.png")
    scissors = Image.load("scissors.png" )
    paper = Image.load("paper.png")
    battlefield = Image.load("field.png")
    green = Color.new(0, 255, 0)

    --delcare old pad to prevent hold down button bug
    oldpad = Controls.read()

    -- main loop starts here
    while true do
    pad = Controls.read()
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, battlefield)

    -- variable that decides the win
    player1 = 0
    computer = 0

    --prevents the same random numbers on each program run
    math.randomseed(os.time() )

    --x=width y=height
    -- this is player 1
    screenrint(140, 0, "Let the Battle Begin!", green)
    screenrint(0,20, "Player 1 Select your Weapon" ,green)

    if pad:left() then
    screen:blit(0, 40, rock)
    player1 = player1 + 3
    end

    if pad:up() then
    screen:blit(0, 40, paper)
    player1 = player1 + 4
    end

    if pad:down() then
    screen:blit(0, 40, scissors)
    player1 = player1 + 5
    end

    -- now the psp's turn
    screenrint(250, 20, "PSP Select your Weapon" ,green)

    if pad:r() then
    computer = math.random(3,5)
    end


    if computer == 3 then
    screen:blit(390, 40, rock)
    end

    if computer == 4 then
    screen:blit(390, 40, paper)
    end

    if computer == 5 then
    screen:blit(390, 40, scissors)
    end

    --now time to compare

    if player1 == 3 and computer == 3 then
    screenrint(150, 150, "YOU BOTH LOST OMG" ,green)
    end

    if player1 == 4 and computer == 4 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    end

    if player1 == 5 and computer == 5 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    end

    -- these are if player1 wins
    if player1 == 4 and computer == 3 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    if player1 == 5 and computer == 4 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    if player1 == 3 and computer == 5 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    -- these are if psp wins

    if player1 == 3 and computer == 4 then
    screenrint(150, 150, "PSP is the winner!", green)
    end

    if player1 == 4 and computer == 5 then
    screenrint(150, 150, "PSP is the winner!", green)
    end

    if player1 == 5 and computer == 3 then
    screenrint(150, 150, "PSP is the winner!", green)
    end

    end
    end

    screen.waitVblankStart()
    screen.flip()
    oldpad = pad
    end


    This is the Multiplayer code involving two people holding one psp
    Spoiler for Multiplayer Code:
    -- *******Lua Rock Paper Scissors***********
    -- Script written by GuitarGod1241 or GuitarGod1134 or GuitarGod1124

    --variables
    rock = Image.load("rock.png")
    scissors = Image.load("scissors.png" )
    paper = Image.load("paper.png")
    battlefield = Image.load("field.png")
    green = Color.new(0, 255, 0)

    -- main loop starts here
    while true do
    pad = Controls.read()
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, battlefield)

    --variable that decides the win
    player1 = 0
    player2 = 0

    --x=width y=height
    -- this is player 1
    screenrint(140, 0, "Let the Battle Begin!", green)
    screenrint(0,20, "Player 1 Select your Weapon" ,green)

    if pad:left() then
    screen:blit(0, 40, rock)
    player1 = player1 + 3
    end

    if pad:up() then
    screen:blit(0, 40, paper)
    player1 = player1 + 4
    end

    if pad:down() then
    screen:blit(0, 40, scissors)
    player1 = player1 + 5
    end

    -- now for player 2
    screenrint(250, 20, "Player 2 Select your Weapon" ,green)

    if pad:circle() then
    screen:blit(390, 40, rock)
    player2 = player2 + 3
    end

    if pad:triangle() then
    screen:blit(390, 40, paper)
    player2 = player2 + 4
    end

    if pad:cross() then
    screen:blit(390, 40, scissors)
    player2 = player2 + 5
    end

    -- now lets compare some variables here
    -- 3 = rock, 4 = paper, and 5 = scissors

    -- these are ties
    if player1 == 3 and player2 == 3 then
    screenrint(150, 150, "YOU BOTH LOST OMG" ,green)
    end

    if player1 == 4 and player2 == 4 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    end

    if player1 == 5 and player2 == 5 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    end

    -- these are if player1 wins
    if player1 == 4 and player2 == 3 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    if player1 == 5 and player2 == 4 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    if player1 == 3 and player2 == 5 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    -- these are if player2 wins

    if player1 == 3 and player2 == 4 then
    screenrint(150, 150, "Player 2 is the winner!", green)
    end

    if player1 == 4 and player2 == 5 then
    screenrint(150, 150, "Player 2 is the winner!", green)
    end

    if player1 == 5 and player2 == 3 then
    screenrint(150, 150, "Player 2 is the winner!", green)
    end


    end
    end



    screen.waitVblankStart()
    screen.flip()
    end





    And here are the pics if you wanna run it and bug test it. (which i encourage because that would be a great help)

    --single player problem

    And also the problem with the single player when i hold r it keeps making random numbers and changing the picture or it doesnt work at all. i want it so that when i hold r it selects and random number and sticks with it. if u run the code you will see my problem.

    --multiplayer problem
    nothing is wrong with this but bug testing it would still be appreciated

    --menu
    just doesnt work at all. even though its the index.lua file it starts multilplayer.lua instead.

    --to install
    put them all in one folder name the menu
    index.lua and multiplayer multiplayer.lua and singleplayer singleplayer.lua and the pics go in the folder with the scripts.

    thanks for your help.
    Geändert von GuitarGod1134 (12-02-2006 um 04:16 PM Uhr)
    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!

  9. #4179
    The Unique Developer
    Points: 7.101, Level: 55
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Canada
    Beiträge
    1.059
    Points
    7.101
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    isn't the multi player a little stupid ????? doesn't the program have to wait for player 2 then show the pictures ???????
    coz you blit the pic when player 1 selects then player2 selects !!!!!
    and I'm finding that LUA is really ****ing easy!!!!
    Malloc.Us Network Administrator

    Decryption of the Encrypted


    You are the unseen, the unstoppable and in power of your code. The God of your software.

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

    cover the screen. lol
    ill fix that in version 3
    EDIT: NO actually in a true rock paper scissors game ur supposed to pick at the same time remember. ROCK PAPER SCISSORS and pick. in version 3 ill add a timer or something that activates when l is pressed.
    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. #4181
    The Unique Developer
    Points: 7.101, Level: 55
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Canada
    Beiträge
    1.059
    Points
    7.101
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    ahhh
    lol ok here some ascii graphics ... I don't like your pics :
    Code:
       .--.               .----.
       `-._`-._          (      )
           `-._`-._    _.-\__.-'
               `-._`--' _.-'
               .-' _(/)(_
           _.-'_.-'    `.`------.__
       _.-'_.-'          \         \
       `--'               `-.____.-'
    
            _  / | 
           / \ | | /\
            \ \| |/ /
             \ Y | /___
           .-.) '. `__/
          (.-.   / /
              | ' |
              |___|
             [_____]
             |     |
    
    or
                .'`  __/_______
            ---'  -'`    ______)
                         _______)
                        _______)
            -----..___________)
    or all these
    
    Rock
          _______
      ---'   ____)
            (_____)
            (_____)
            (____)
      ---.__(___)
    
    
    Paper
          _______
      ---'   ____)____
                ______)
                _______)
               _______)
      ---.__________)
    
    Scissors
          _______
      ---'   ____)____
                ______)
             __________)
            (____)
      ---.__(___)
    Malloc.Us Network Administrator

    Decryption of the Encrypted


    You are the unseen, the unstoppable and in power of your code. The God of your software.

  12. #4182
    QJ Gamer Blue
    Points: 5.871, Level: 49
    Level completed: 61%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Beiträge
    432
    Points
    5.871
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    hey how do i get the lua player for windows to work ://www.freewebs.com/blackbelttyler/luaplayer%20windowsa%2Dla rge.png"]srry this is it

    -= Double Post =-
    the first one was right
    -= Double Post =-
    srry guys how do i get this to work
    Geändert von Blackbelttcon (11-20-2006 um 04:45 PM Uhr) Grund: Automerged Doublepost

  13. #4183
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Get your lua files and place them in that folder(Where LUA Windows Player is) then delete the "test.lua" file then rename you index file "test" then run the test program, If it doesn't load the script, then you file is wrong.

  14. #4184
    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 lol

    ur smily pic in your sig is tight unique warrior. and yes your pics would be better even with those ascii graphics.

  15. #4185
    The Unique Developer
    Points: 7.101, Level: 55
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Canada
    Beiträge
    1.059
    Points
    7.101
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    ur smily pic in your sig is tight unique warrior. and yes your pics would be better even with those ascii graphics.
    yeah!!!!!!!!!!
    I love ascii
    Best,
    Malloc.Us Network Administrator

    Decryption of the Encrypted


    You are the unseen, the unstoppable and in power of your code. The God of your software.

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

    Zitat Zitat von GuitarGod1134
    There are so many bugs in my game and it would be appreciated if anyone could give any help at all thanks.

    Ok here is my menu code
    Spoiler for Menu Code:
    -- Lua Rock Paper Scissors
    -- Lua RPS v 0.2
    --Script written by GuitarGod1124 or GuitarGod1134

    -- lets get some variables up
    red = Color.new(255, 0, 0)
    green = Color.new(0, 255, 0)
    menu = Image.load("menu.png")

    -- now for the main loop
    --x=width y=height
    while true do

    -- print instructions on the screen
    screenrint(0,0, " The Following Controls Are...", green)
    screenrint(0, 10, "X = Single Player", green)
    screenrint(0, 20, "O = Multiplayer", red)
    screenrint(0, 40, "Triangle = Exit Game", green)

    -- we need a background
    for a = 0, 14 do
    for b = 0,8 do
    end
    screen:blit(32 * a, 32 * b, menu)

    -- declare the variable for the buttons
    pad = Controls.read()

    --this is for single player
    if pad:cross() then
    dofile("singleplayer.lua" )
    end

    --this is for multiplayer
    if pad:circle() then
    dofile("multiplayer.lua")
    end

    --this is for quiting the game
    if pad:triangle() then
    os.exit()
    end

    screen.waitVblankStart()
    screen.flip()
    end







    This is the single player code
    Spoiler for Single Player Code:
    -- *******Lua Rock Paper Scissors***********
    -- Script written by GuitarGod1241 or GuitarGod1134 or GuitarGod1124
    -- DUE TO POPULAR DEMAND WE NOW HAVE SINGLE PLAYER!!!

    --variables
    rock = Image.load("rock.png")
    scissors = Image.load("scissors.png" )
    paper = Image.load("paper.png")
    battlefield = Image.load("field.png")
    green = Color.new(0, 255, 0)

    --delcare old pad to prevent hold down button bug
    oldpad = Controls.read()

    -- main loop starts here
    while true do
    pad = Controls.read()
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, battlefield)

    -- variable that decides the win
    player1 = 0
    computer = 0

    --prevents the same random numbers on each program run
    math.randomseed(os.time() )

    --x=width y=height
    -- this is player 1
    screenrint(140, 0, "Let the Battle Begin!", green)
    screenrint(0,20, "Player 1 Select your Weapon" ,green)

    if pad:left() then
    screen:blit(0, 40, rock)
    player1 = player1 + 3
    end

    if pad:up() then
    screen:blit(0, 40, paper)
    player1 = player1 + 4
    end

    if pad:down() then
    screen:blit(0, 40, scissors)
    player1 = player1 + 5
    end

    -- now the psp's turn
    screenrint(250, 20, "PSP Select your Weapon" ,green)

    if pad:r() then
    computer = math.random(3,5)
    end


    if computer == 3 then
    screen:blit(390, 40, rock)
    end

    if computer == 4 then
    screen:blit(390, 40, paper)
    end

    if computer == 5 then
    screen:blit(390, 40, scissors)
    end

    --now time to compare

    if player1 == 3 and computer == 3 then
    screenrint(150, 150, "YOU BOTH LOST OMG" ,green)
    end

    if player1 == 4 and computer == 4 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    end

    if player1 == 5 and computer == 5 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    end

    -- these are if player1 wins
    if player1 == 4 and computer == 3 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    if player1 == 5 and computer == 4 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    if player1 == 3 and computer == 5 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    -- these are if psp wins

    if player1 == 3 and computer == 4 then
    screenrint(150, 150, "PSP is the winner!", green)
    end

    if player1 == 4 and computer == 5 then
    screenrint(150, 150, "PSP is the winner!", green)
    end

    if player1 == 5 and computer == 3 then
    screenrint(150, 150, "PSP is the winner!", green)
    end

    end
    end

    screen.waitVblankStart()
    screen.flip()
    oldpad = pad
    end


    This is the Multiplayer code involving two people holding one psp
    Spoiler for Multiplayer Code:
    -- *******Lua Rock Paper Scissors***********
    -- Script written by GuitarGod1241 or GuitarGod1134 or GuitarGod1124

    --variables
    rock = Image.load("rock.png")
    scissors = Image.load("scissors.png" )
    paper = Image.load("paper.png")
    battlefield = Image.load("field.png")
    green = Color.new(0, 255, 0)

    -- main loop starts here
    while true do
    pad = Controls.read()
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, battlefield)

    --variable that decides the win
    player1 = 0
    player2 = 0

    --x=width y=height
    -- this is player 1
    screenrint(140, 0, "Let the Battle Begin!", green)
    screenrint(0,20, "Player 1 Select your Weapon" ,green)

    if pad:left() then
    screen:blit(0, 40, rock)
    player1 = player1 + 3
    end

    if pad:up() then
    screen:blit(0, 40, paper)
    player1 = player1 + 4
    end

    if pad:down() then
    screen:blit(0, 40, scissors)
    player1 = player1 + 5
    end

    -- now for player 2
    screenrint(250, 20, "Player 2 Select your Weapon" ,green)

    if pad:circle() then
    screen:blit(390, 40, rock)
    player2 = player2 + 3
    end

    if pad:triangle() then
    screen:blit(390, 40, paper)
    player2 = player2 + 4
    end

    if pad:cross() then
    screen:blit(390, 40, scissors)
    player2 = player2 + 5
    end

    -- now lets compare some variables here
    -- 3 = rock, 4 = paper, and 5 = scissors

    -- these are ties
    if player1 == 3 and player2 == 3 then
    screenrint(150, 150, "YOU BOTH LOST OMG" ,green)
    end

    if player1 == 4 and player2 == 4 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    end

    if player1 == 5 and player2 == 5 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    end

    -- these are if player1 wins
    if player1 == 4 and player2 == 3 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    if player1 == 5 and player2 == 4 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    if player1 == 3 and player2 == 5 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    end

    -- these are if player2 wins

    if player1 == 3 and player2 == 4 then
    screenrint(150, 150, "Player 2 is the winner!", green)
    end

    if player1 == 4 and player2 == 5 then
    screenrint(150, 150, "Player 2 is the winner!", green)
    end

    if player1 == 5 and player2 == 3 then
    screenrint(150, 150, "Player 2 is the winner!", green)
    end


    end
    end



    screen.waitVblankStart()
    screen.flip()
    end





    And here are the pics if you wanna run it and bug test it. (which i encourage because that would be a great help)

    --single player problem

    And also the problem with the single player when i hold r it keeps making random numbers and changing the picture or it doesnt work at all. i want it so that when i hold r it selects and random number and sticks with it. if u run the code you will see my problem.

    --multiplayer problem
    nothing is wrong with this but bug testing it would still be appreciated

    --menu
    just doesnt work at all. even though its the index.lua file it starts multilplayer.lua instead.

    --to install
    put them all in one folder name the menu
    index.lua and multiplayer multiplayer.lua and singleplayer singleplayer.lua and the pics go in the folder with the scripts.

    thanks for your help.
    hmm somebody should help this guy
    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!

  17. #4187
    The Unique Developer
    Points: 7.101, Level: 55
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Canada
    Beiträge
    1.059
    Points
    7.101
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    here is some help from a C coder
    Code:
    -- *******Lua Rock Paper Scissors***********
    -- Script written by GuitarGod1241 or GuitarGod1134 or GuitarGod1124
    -- DUE TO POPULAR DEMAND WE NOW HAVE SINGLE PLAYER!!!
    
    --variables
    rock = Image.load("rock.png")
    scissors = Image.load("scissors.png" )
    paper = Image.load("paper.png")
    battlefield = Image.load("field.png")
    green = Color.new(0, 255, 0)
    
    --delcare old pad to prevent hold down button bug
    oldpad = Controls.read()
    
    -- main loop starts here
    while true do
    pad = Controls.read()
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, battlefield)
    
    -- variable that decides the win
    player1 = 0 
    computer = 0
    -- variable added < TUW: if random nr was used 
    randomnr = 0
    --prevents the same random numbers on each program run
    math.randomseed(os.time() )
    
    --x=width y=height
    -- this is player 1
    screenrint(140, 0, "Let the Battle Begin!", green)
    screenrint(0,20, "Player 1 Select your Weapon" ,green)
    
    if pad:left() then
    screen:blit(0, 40, rock)
    player1 = player1 + 3
    end
    
    if pad:up() then
    screen:blit(0, 40, paper)
    player1 = player1 + 4
    end
    
    if pad:down() then
    screen:blit(0, 40, scissors)
    player1 = player1 + 5
    end
    
    -- now the psp's turn
    screenrint(250, 20, "PSP Select your Weapon" ,green)
    
    if pad:r() then
    if randomnr == 0 then
    computer = math.random(3,5)
    randomnr = 1
    end
    end
    
    
    if computer == 3 then
    screen:blit(390, 40, rock)
    end
    
    if computer == 4 then
    screen:blit(390, 40, paper)
    end
    
    if computer == 5 then
    screen:blit(390, 40, scissors)
    end
    
    --now time to compare
    
    if player1 == 3 and computer == 3 then
    screenrint(150, 150, "YOU BOTH LOST OMG" ,green)
    randomnr = 0
    end
    
    if player1 == 4 and computer == 4 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    randomnr = 0
    end
    
    if player1 == 5 and computer == 5 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    randomnr = 0
    end
    
    -- these are if player1 wins
    if player1 == 4 and computer == 3 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    randomnr = 0
    end
    
    if player1 == 5 and computer == 4 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    randomnr = 0
    end
    
    if player1 == 3 and computer == 5 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    randomnr = 0
    end
    
    -- these are if psp wins
    
    if player1 == 3 and computer == 4 then
    screenrint(150, 150, "PSP is the winner!", green)
    randomnr = 0
    end
    
    if player1 == 4 and computer == 5 then
    screenrint(150, 150, "PSP is the winner!", green)
    randomnr = 0
    end
    
    if player1 == 5 and computer == 3 then
    screenrint(150, 150, "PSP is the winner!", green)
    randomnr = 0
    end
    
    end
    end
    
    screen.waitVblankStart()
    screen.flip()
    oldpad = pad
    end
    Malloc.Us Network Administrator

    Decryption of the Encrypted


    You are the unseen, the unstoppable and in power of your code. The God of your software.

  18. #4188
    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 the unique warrior
    here is some help from a C coder :D
    In that case, here is some feedback from a 'C coder'.:
    1. You haven't tested it, screenrint should be screen:print (guessing smiley problem)
    2. Naming conventions are non-existant
    3. No code formating
    4. Magic numbers used all over the place
    5. Duplicated code
    6. oldpad not used. Redundent variable

  19. #4189
    The Unique Developer
    Points: 7.101, Level: 55
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Canada
    Beiträge
    1.059
    Points
    7.101
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    meh I just added this :
    Code:
    -- variable added < TUW: if random nr was used 
    randomnr = 0
    
    
    if randomnr == 0 then
    computer = math.random(3,5)
    randomnr = 1
    end
    the others where his own
    Malloc.Us Network Administrator

    Decryption of the Encrypted


    You are the unseen, the unstoppable and in power of your code. The God of your software.

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

    haha thanks i was going to make a table or something but didnt.
    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!

  21. #4191
    QJ Gamer Blue
    Points: 4.812, Level: 44
    Level completed: 31%, Points required for next Level: 138
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    London, United Kingdom
    Beiträge
    131
    Points
    4.812
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von pspgamer81
    Just use screenprint but make the pixels on the right part of the screen.
    Its easy if there was always a fixed amount of text, but there isnt. So i attempted to apply a varible amount of padding but that didnt work either.

    To recap, I want to be able to right justify text. My methods didnt work, so if someone would lend a helping hand..

  22. #4192
    Designs
    Points: 14.040, Level: 76
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Canada
    Beiträge
    1.395
    Points
    14.040
    Level
    76
    Downloads
    0
    Uploads
    0

    Standard

    what is the input for the right and left trigger for controls?

  23. #4193
    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 yoyomacy
    what is the input for the right and left trigger for controls?
    Code:
    while true do
    
    pad = Controls.read()
    
    if pad:l() then
    blah
    end
    
    if pad:r()
    blah
    end
    --------------------------------------------------------------------------------------

  24. #4194
    The Unique Developer
    Points: 7.101, Level: 55
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Canada
    Beiträge
    1.059
    Points
    7.101
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von GuitarGod1134
    haha thanks i was going to make a table or something but didnt.
    lol now you did ;)
    Malloc.Us Network Administrator

    Decryption of the Encrypted


    You are the unseen, the unstoppable and in power of your code. The God of your software.

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

    hey, does anyone know how to install LuaPlayerMod3? it didnt come with instructions for installation.

    its the mod that adds mp3 and ogg support by cools.

    ...or maybe...

    edit - yep, nevermind, i got it working. odd though that the mod's own "mp3 test" gets an error..
    Geändert von EminentJonFrost (11-23-2006 um 07:28 AM Uhr)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

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

    Alright well Lua RPS is really being annoying now and every response or fix I have gotten on my code still doesnt work. Unique Warrior everytime I hold down R the psp doesnt stick with ONE option ie (rock paper or scissors) instead it just keeps changeing and pressing r one only blits the pic for a second and the variable probally only has that value for a second as well so im just gonna drop this project and get back to work on maze of doom. Also does anyone know any other tutorials besides the ones on evilmana? and on some websites they just copy the ones on evilmana lol.
    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!

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

    how about this, GG?
    http://www.lua.org/map.html
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  28. #4198
    The Unique Developer
    Points: 7.101, Level: 55
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Canada
    Beiträge
    1.059
    Points
    7.101
    Level
    55
    Downloads
    0
    Uploads
    0

    Red face Changed

    sorry about that
    here this one should work :)
    Code:
    -- *******Lua Rock Paper Scissors***********
    -- Script written by GuitarGod1241 or GuitarGod1134 or GuitarGod1124
    -- DUE TO POPULAR DEMAND WE NOW HAVE SINGLE PLAYER!!!
    
    --variables
    rock = Image.load("rock.png")
    scissors = Image.load("scissors.png" )
    paper = Image.load("paper.png")
    battlefield = Image.load("field.png")
    green = Color.new(0, 255, 0)
    
    --delcare old pad to prevent hold down button bug
    oldpad = Controls.read()
    
    -- main loop starts here
    while true do
    pad = Controls.read()
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, battlefield)
    
    -- variable that decides the win
    player1 = 0 
    computer = 0
    -- variable added < TUW: if random nr was used 
    randomnr = 0
    --prevents the same random numbers on each program run
    math.randomseed(os.time() )
    
    --x=width y=height
    -- this is player 1
    screenrint(140, 0, "Let the Battle Begin!", green)
    screenrint(0,20, "Player 1 Select your Weapon" ,green)
    
    if pad:left() then
    screen:blit(0, 40, rock)
    player1 = player1 + 3
    end
    
    if pad:up() then
    screen:blit(0, 40, paper)
    player1 = player1 + 4
    end
    
    if pad:down() then
    screen:blit(0, 40, scissors)
    player1 = player1 + 5
    end
    
    -- now the psp's turn
    screenrint(250, 20, "PSP Select your Weapon" ,green)
    
    if pad:r() then
    if randomnr == 0 then
    computer = math.random(3,5)
    end
    end
    
    
    if computer == 3 then
    screen:blit(390, 40, rock)
    randomnr = 1
    end
    
    if computer == 4 then
    screen:blit(390, 40, paper)
    randomnr = 1
    end
    
    if computer == 5 then
    screen:blit(390, 40, scissors)
    randomnr = 1
    end
    
    --now time to compare
    
    if player1 == 3 and computer == 3 then
    screenrint(150, 150, "YOU BOTH LOST OMG" ,green)
    randomnr = 0
    end
    
    if player1 == 4 and computer == 4 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    randomnr = 0
    end
    
    if player1 == 5 and computer == 5 then
    screenrint(150, 150, "YOU BOTH LOST OMG", green)
    randomnr = 0
    end
    
    -- these are if player1 wins
    if player1 == 4 and computer == 3 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    randomnr = 0
    end
    
    if player1 == 5 and computer == 4 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    randomnr = 0
    end
    
    if player1 == 3 and computer == 5 then
    screenrint(150, 150, "Player 1 is the winner!", green)
    randomnr = 0
    end
    
    -- these are if psp wins
    
    if player1 == 3 and computer == 4 then
    screenrint(150, 150, "PSP is the winner!", green)
    randomnr = 0
    end
    
    if player1 == 4 and computer == 5 then
    screenrint(150, 150, "PSP is the winner!", green)
    randomnr = 0
    end
    
    if player1 == 5 and computer == 3 then
    screenrint(150, 150, "PSP is the winner!", green)
    randomnr = 0
    end
    
    end
    end
    
    screen.waitVblankStart()
    screen.flip()
    oldpad = pad
    end
    Best,
    Malloc.Us Network Administrator

    Decryption of the Encrypted


    You are the unseen, the unstoppable and in power of your code. The God of your software.

  29. #4199
    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

    Ill run it and check it out and thanks EminentJon ill take a look at that site too.
    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!

  30. #4200
    The Unique Developer
    Points: 7.101, Level: 55
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Canada
    Beiträge
    1.059
    Points
    7.101
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    tell me the results
    I know this is not professional LUA coding but I like to learn (I know what is going on in all of this )
    Malloc.Us Network Administrator

    Decryption of the Encrypted


    You are the unseen, the unstoppable and in power of your code. The God of your software.


 

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

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