Seite 260 von 342 ErsteErste ... 160 210 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 310 ... LetzteLetzte
Zeige Ergebnis 7.771 bis 7.800 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; Big problem. It won't work. here is post of source: Code: -- ******* RODM: Run or Die Mouse ******** -- ...

  
  1. #7771
    QJ Gamer Green
    Points: 5.971, Level: 50
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    640
    Points
    5.971
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Big problem. It won't work. here is post of source:
    Code:
    -- ******* RODM: Run or Die Mouse ********
    -- This was Made by Mraellis And GamefreQ for your learning purposes. Please do not steal our work, but 
    -- give us credit instead, and ask for our permission to use this.
    dofile(Color.lua) --This directs to the color file for the colors of the text
    
    -- Images
    
    Bat = Image.load("Images/bat.png")
    grass = Image.load("Images/grass.png")
    Mouse7 = Image.load("Images/Mouse_UL.png")
    Mouse9 = Image.load("Images/Mouse_UR.png")
    Mouse8 = Image.load("Images/Mouse_U.png")
    Mouse2 = Image.load("Images/Mouse_D.png")
    Mouse4 = Image.load("Images/Mouse_L.png")
    Mouse6 = Image.load("Images/Mouse_R.png")
    Mouse1 = Image.load("Images/Mouse_DL.png")
    Mouse3 = Image.load("Images/Mouse_DR.png")
    
    screenwidth = 480 - player:width() -- These are so you cannot move your character off the screen
    screenheight = 272 - player:width() -- because the PSP screen has 480 x 272 pixels :)
    
    -- Tables (enemies and Players are here)
    
    Player = { } Player[1] = { x = 200, y = 50 }
    
    -- Sounds
    
    Bat = Sound.load("Sounds/Bat.wav",false)
    Mouse = Sound.load("Sounds/Mouse.wav",false)
    Boom = Sound.load("Sounds/Boom.wav",false)
    Chomp = Sound.load("Sounds/Chomp.wav",false)
    heavyweight = Sound.load("Sounds/heavyweight.wav",false)
    Shotgun = Sound.load("Sounds/Shotgun.wav",false)
    Squash = Sound.load("Sounds/Squash.wav",false)
    Levelstart = Sound.load("Sounds/Levelstart.wav",flase)
    
    -- Vars
    
    Win = screen:print(200, 100, "Well Done, You Won!", red)
    Lose = screen:print(200, 100, "Sorry, You Lost!", blue)
    Score = screen:print(200, 100, "Your score is", red)
    MadeBy = screen:print(200, 100, "This Game was made by Mraellis And GamefreQ", blue)
    
    -- Main loop
    
    while true do
    pad = Controls.read()
    screen:clear()
    
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, grass)
    end
    end
    
    screen:blit(Player[1].x,Player[1].y,Mouse8)
    
    if pad:left() and Player[1].x > 0 then
    Player[1].x = Player[1].x - 5
    end
    
    if pad:right() and Player[1].x < screenwidth then
    Player[1].x = Player[1].x + 5
    end
    
    if pad:up() and Player[1].y > 0 then
    Player[1].y = Player[1].y - 5
    end
    
    if pad:down() and Player[1].y < screenheight then
    Player[1].y = Player[1].y + 5
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    and here is post of error:
    Code:
    Error: SCRIPT.LUA:19: attempt to index global 'player' (a nil value)
    
    Press start to restart
    I don't understand. I have all of the files in the correct place (It is not done yet, no where near completion, but I just wanted to test it. but apparently not



  2. #7772
    QJ Gamer Bronze
    Points: 5.934, Level: 49
    Level completed: 92%, Points required for next Level: 16
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    654
    Points
    5.934
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Aiight i think i might start coding lua then...if so il hafta save up for a laptop to code on lol

  3. #7773
    QJ Gamer Green
    Points: 5.971, Level: 50
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    640
    Points
    5.971
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von _-Tiger-_
    Aiight i think i might start coding lua then...if so il hafta save up for a laptop to code on lol
    I was about 2g2 bed when I say that my thread was bumped up so I got a gleam of hope only to find this LOL no problemo though it's all cool but you can code with notepad on anything so I don't think you NEED to get a laptop jsut to code well gl

  4. #7774
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Gam3freQ
    Big problem. It won't work. here is post of source:
    Code:
    -- ******* RODM: Run or Die Mouse ********
    -- This was Made by Mraellis And GamefreQ for your learning purposes. Please do not steal our work, but 
    -- give us credit instead, and ask for our permission to use this.
    dofile(Color.lua) --This directs to the color file for the colors of the text
    
    -- Images
    
    Bat = Image.load("Images/bat.png")
    grass = Image.load("Images/grass.png")
    Mouse7 = Image.load("Images/Mouse_UL.png")
    Mouse9 = Image.load("Images/Mouse_UR.png")
    Mouse8 = Image.load("Images/Mouse_U.png")
    Mouse2 = Image.load("Images/Mouse_D.png")
    Mouse4 = Image.load("Images/Mouse_L.png")
    Mouse6 = Image.load("Images/Mouse_R.png")
    Mouse1 = Image.load("Images/Mouse_DL.png")
    Mouse3 = Image.load("Images/Mouse_DR.png")
    
    screenwidth = 480 - player:width() -- These are so you cannot move your character off the screen
    screenheight = 272 - player:width() -- because the PSP screen has 480 x 272 pixels :)
    
    -- Tables (enemies and Players are here)
    
    Player = { } Player[1] = { x = 200, y = 50 }
    
    -- Sounds
    
    Bat = Sound.load("Sounds/Bat.wav",false)
    Mouse = Sound.load("Sounds/Mouse.wav",false)
    Boom = Sound.load("Sounds/Boom.wav",false)
    Chomp = Sound.load("Sounds/Chomp.wav",false)
    heavyweight = Sound.load("Sounds/heavyweight.wav",false)
    Shotgun = Sound.load("Sounds/Shotgun.wav",false)
    Squash = Sound.load("Sounds/Squash.wav",false)
    Levelstart = Sound.load("Sounds/Levelstart.wav",flase)
    
    -- Vars
    
    Win = screen:print(200, 100, "Well Done, You Won!", red)
    Lose = screen:print(200, 100, "Sorry, You Lost!", blue)
    Score = screen:print(200, 100, "Your score is", red)
    MadeBy = screen:print(200, 100, "This Game was made by Mraellis And GamefreQ", blue)
    
    -- Main loop
    
    while true do
    pad = Controls.read()
    screen:clear()
    
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, grass)
    end
    end
    
    screen:blit(Player[1].x,Player[1].y,Mouse8)
    
    if pad:left() and Player[1].x > 0 then
    Player[1].x = Player[1].x - 5
    end
    
    if pad:right() and Player[1].x < screenwidth then
    Player[1].x = Player[1].x + 5
    end
    
    if pad:up() and Player[1].y > 0 then
    Player[1].y = Player[1].y - 5
    end
    
    if pad:down() and Player[1].y < screenheight then
    Player[1].y = Player[1].y + 5
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    and here is post of error:
    Code:
    Error: SCRIPT.LUA:19: attempt to index global 'player' (a nil value)
    
    Press start to restart
    I don't understand. I have all of the files in the correct place (It is not done yet, no where near completion, but I just wanted to test it. but apparently not
    If you read the error that luaplayer gave you, you would see that on line 19 and 20 a variable called 'player' is used, yet it is not defined any where in the script. Remember, lua is case sensitive. 'Player' is not the same as 'player'. It is also linear, so things are interpreted from top to bottom.

    Code:
    -- Test Lua Application
    
    T_Player[1].x = 10; -- Undefined table
    
    T_Player = {} -- Table defined after table-menu

  5. #7775
    QJ Gamer Green
    Points: 5.971, Level: 50
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    640
    Points
    5.971
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von _dysfunctional
    If you read the error that luaplayer gave you, you would see that on line 19 and 20 a variable called 'player' is used, yet it is not defined any where in the script. Remember, lua is case sensitive. 'Player' is not the same as 'player'. It is also linear, so things are interpreted from top to bottom.

    Code:
    -- Test Lua Application
    
    T_Player[1].x = 10; -- Undefined table
    
    T_Player = {} -- Table defined after table-menu
    ok so also if I fix this then will my Player width and height be the same as Mouse8's width and height? (look at the code for Mouse8) Thank you for all of that

    I also got an error on line 35: error loading sound, so I saw that it sad flase instead of false, so I fixed it, and I got the same error
    -= Double Post =-
    ZOMG! I downloaded colors.lua from evilmana.com and realized that there are NO SPACES! If there arn't any spaces then that means they won't work! Also they don't work without the spaces I tried! oh no! is there an alternate download with the spaces because that's a good 1000 colors that are now goin to waste
    Geändert von Gam3freQ (07-23-2007 um 08:47 AM Uhr) Grund: Automerged Doublepost

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

    yes it will....
    the only thing spaces do are make your code look nicer

  7. #7777
    QJ Gamer Green
    Points: 5.971, Level: 50
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    640
    Points
    5.971
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von michaelp
    yes it will....
    the only thing spaces do are make your code look nicer
    no it gave me error dude


    GhostWhite=Color.new(248, 248,255)
    does not work BUT

    GhostWhite = Color.new(248, 248, 255)

    works perfectly and does NOT display error message so I said screw it and spaced out the ones I wanted to use and deleted the rest, and the program works, but I want to change the controls. I do NOT want it to be, up goes up, right goes right, left goes left, down goes down, etc. I want UP on the dpad to move your character whatever direction it is facing, and then left and right to turn or change the direction you're facing like in the flash game.

  8. #7778
    QJ Gamer Green
    Points: 5.795, Level: 49
    Level completed: 23%, Points required for next Level: 155
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Cape Town, South Africa
    Beiträge
    714
    Points
    5.795
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    You could have just used search-replace to fix the spaces...

  9. #7779
    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

    I'm having a bit of a problem with an image.
    The image just looks like a button. (Sort of, not from the way I made it)
    It has a black background, but when I blit it to the screen(without a background, or black) the background will show up as grey, not black.
    I've tried using the True and false value's for the alpha, but same thing.
    Anyone know why?

    edit: nvm, fixed
    Geändert von michaelp (07-23-2007 um 01:14 PM Uhr)

  10. #7780
    QJ Gamer Silver
    Points: 12.453, Level: 73
    Level completed: 1%, Points required for next Level: 397
    Overall activity: 80,0%

    Registriert seit
    Mar 2007
    Beiträge
    1.129
    Points
    12.453
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Merick
    As for putting it into an image, for some reason using img:blit(0,0, screen) does not capture anything that was drawn with the Gu.

    However, although I haven't tried it, I believe that if you use screen:save("screen.png") to save a screenshot to an image file, then you can load that image and use it like you would any other
    i've been trying to find a way around this since saturday and i finally found one! yes its true that a screenshot will capture the scaled image but it would take way too long to write to the ms. remember the weird things that were happening with fillRect and print? well those weird things helped me to figure it out. when it blits from the screen, all it sees is alpha=0. when you fillRect or print before Gu.blit, it sees this as alpha=255. we can use this to our advantage to create masks! so in short, the quick fix is:
    Code:
    screen:fillRect(x,y,image:width(), image:height())
    before the call to Gu.start3d()

  11. #7781
    QJ Gamer Green
    Points: 5.971, Level: 50
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    640
    Points
    5.971
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von coolguy5678
    You could have just used search-replace to fix the spaces...
    tell me how

  12. #7782
    QJ Gamer Bronze
    Points: 5.934, Level: 49
    Level completed: 92%, Points required for next Level: 16
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    654
    Points
    5.934
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Hows the game going? Im definatly gonna start learning Lua. I think ill start tomorrow, after i workout....gotta get ready for football lol

  13. #7783
    No longer a community member.
    Points: 6.420, Level: 52
    Level completed: 35%, Points required for next Level: 130
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Over there.
    Beiträge
    666
    Points
    6.420
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Ok well i am not normally a Lua dev i would rather work with C/C++ any day but i have to work in Lua for a little while (if you are active at the luaplayer forums you would know what i am working on). Ok well i have setup the GU in the luaplayer and have it all working but i am wanting to run opacity on my objects so natuarally i enable GU_BLEND and run a normal Gu BlendFunc with (GU_ADD GU_SRC_ALPHA GU_ONE_MINUS_SRC_ALPHA) but my draw back is with the Luaplayer Color object i believe. I think that it does not support an alpha value. please correct me if im wrong but how would i go about having an Color object of an object drawn at ~50% opacity

    EDIT====

    MY BAD I OVER LOOKED IT ON THE DOCUMENTATIONS

  14. #7784
    QJ Gamer Green
    Points: 5.795, Level: 49
    Level completed: 23%, Points required for next Level: 155
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Cape Town, South Africa
    Beiträge
    714
    Points
    5.795
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Gam3freQ
    tell me how
    Search-replace (you do know how to use search-replace, right?) "=" with " = " (without the quotes).

  15. #7785
    Banned from QJ for LIFE
    Points: 10.957, Level: 69
    Level completed: 27%, Points required for next Level: 293
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    1.557
    Points
    10.957
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    ok guys... we've been doing some work on it and we've hit a problem. the bat doesn't appear and u can go offscreen.

    Code:
     -- ******* RODM: Run or Die Mouse ********
    -- This was Made by Mraellis And GamefreQ for your learning purposes. Please do not steal our work, but 
    -- give us credit instead, and ask for our permission to use this.
    
    -- Colors
    
    cyan = Color.new(0, 255, 255)
    red1 = Color.new(255, 0, 0)
    salmon1 = Color.new(255, 140, 105)
    burlywood4 = Color.new(139, 115, 85)
    
    math.randomseed(os.time()) --/// prevent same random numbers from occuring each run of the game///
    
    -- Images
    
    Bat = Image.load ("Images/bat.png")
    grass = Image.load("Images/Grass.png")
    Mouse7 = Image.load("Images/Mouse_UL.png")
    Mouse9 = Image.load("Images/Mouse_UR.png")
    Mouse8 = Image.load("Images/Mouse_U.png")
    Mouse2 = Image.load("Images/Mouse_D.png")
    Mouse4 = Image.load("Images/Mouse_L.png")
    Mouse6 = Image.load("Images/Mouse_R.png")
    Mouse1 = Image.load("Images/Mouse_DL.png")
    Mouse3 = Image.load("Images/Mouse_DR.png")
    
    -- Sounds
    
    Bat = Sound.load("Sounds/Bat.wav",false)
    Mouse = Sound.load("Sounds/Mouse.wav",false)
    Boom = Sound.load("Sounds/Boom.wav",false)
    Chomp = Sound.load("Sounds/Chomp.wav",false)
    heavyweight = Sound.load("Sounds/heavyweight.wav",false)
    Shotgun = Sound.load("Sounds/Shotgun.wav",false)
    Squash = Sound.load("Sounds/Squash.wav",false)
    Levelstart = Sound.load("Sounds/Levelstart.wav",false)
    
    -- Vars
    
    Win = screen:print(200, 100, "Well Done, You Won!", red1)
    Lose = screen:print(200, 100, "Sorry, You Lost!", cyan)
    Score = screen:print(200, 100, "Your score is", salmon1)
    MadeBy = screen:print(200, 100, "This Game was made by Mraellis And GamefreQ", burlywood4)
    
    -- Tables (enemies and Players are here)
    
    Player = { } Player = { x = 200, y = 50 }
    Enemy = { } Enemy = { x = 50, y = 50 }
    
    screenwidth = 480 - Mouse8:width() -- These are so you cannot move your character off the screen
    screenheight = 272 - Mouse8:height() -- because the PSP screen has 480 x 272 pixels :)
    
    function movePlayer() --/// function to move our player when directionals are pressed///
    pad = Controls.read()
    if pad:left() then
    Player.x = Player.x - 5
    end
    if pad:right() then
    Player.x = Player.x + 5
    end
    if pad:up() then
    Player.y = Player.y - 5
    end
    if pad:down() then
    Player.y = Player.y + 5
    end
    end
    
    function chasePlayer() --/ function to make the enemy chase the player/
    stallchase = math.random(2) 
    if stallchase == 1 then 
    if Enemy.x > Player.x then
    Enemy.x = Enemy.x - 2
    elseif Enemy.x < Player.x then
    Enemy.x = Enemy.x + 2
    end
    end
    stallchase = math.random(2)
    if stallchase == 1 then
    if Enemy.y > Player.y then
    Enemy.y = Enemy.y - 2
    elseif Enemy.y < Player.y then
    Enemy.y = Enemy.y + 2
    end
    end
    end --///end the function///
    
    -- Main loop
    
    while true do
    screen:clear()
    
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, grass)
    end
    end
    
    screen:blit(Player.x,Player.y,Mouse8)
    screen:blit(Enemy.x,Enemy.y,Bat)
    
    movePlayer() --///call movePlayer function///
    
    chasePlayer() --///call chasePlayer function////
    
    screen.waitVblankStart()
    screen.flip()
    end
    can someone help plz.

  16. #7786
    Banned from QJ for LIFE
    Points: 10.957, Level: 69
    Level completed: 27%, Points required for next Level: 293
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    1.557
    Points
    10.957
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    ok guys... we've been doing some work on a game and we've hit a problem. the bat doesn't appear and u can go offscreen.

    Code:
     -- ******* RODM: Run or Die Mouse ********
    -- This was Made by Mraellis And GamefreQ for your learning purposes. Please do not steal our work, but 
    -- give us credit instead, and ask for our permission to use this.
    
    -- Colors
    
    cyan = Color.new(0, 255, 255)
    red1 = Color.new(255, 0, 0)
    salmon1 = Color.new(255, 140, 105)
    burlywood4 = Color.new(139, 115, 85)
    
    math.randomseed(os.time()) --/// prevent same random numbers from occuring each run of the game///
    
    -- Images
    
    Bat = Image.load ("Images/bat.png")
    grass = Image.load("Images/Grass.png")
    Mouse7 = Image.load("Images/Mouse_UL.png")
    Mouse9 = Image.load("Images/Mouse_UR.png")
    Mouse8 = Image.load("Images/Mouse_U.png")
    Mouse2 = Image.load("Images/Mouse_D.png")
    Mouse4 = Image.load("Images/Mouse_L.png")
    Mouse6 = Image.load("Images/Mouse_R.png")
    Mouse1 = Image.load("Images/Mouse_DL.png")
    Mouse3 = Image.load("Images/Mouse_DR.png")
    
    -- Sounds
    
    Bat = Sound.load("Sounds/Bat.wav",false)
    Mouse = Sound.load("Sounds/Mouse.wav",false)
    Boom = Sound.load("Sounds/Boom.wav",false)
    Chomp = Sound.load("Sounds/Chomp.wav",false)
    heavyweight = Sound.load("Sounds/heavyweight.wav",false)
    Shotgun = Sound.load("Sounds/Shotgun.wav",false)
    Squash = Sound.load("Sounds/Squash.wav",false)
    Levelstart = Sound.load("Sounds/Levelstart.wav",false)
    
    -- Vars
    
    Win = screen:print(200, 100, "Well Done, You Won!", red1)
    Lose = screen:print(200, 100, "Sorry, You Lost!", cyan)
    Score = screen:print(200, 100, "Your score is", salmon1)
    MadeBy = screen:print(200, 100, "This Game was made by Mraellis And GamefreQ", burlywood4)
    
    -- Tables (enemies and Players are here)
    
    Player = { } Player = { x = 200, y = 50 }
    Enemy = { } Enemy = { x = 50, y = 50 }
    
    screenwidth = 480 - Mouse8:width() -- These are so you cannot move your character off the screen
    screenheight = 272 - Mouse8:height() -- because the PSP screen has 480 x 272 pixels :)
    
    function movePlayer() --/// function to move our player when directionals are pressed///
    pad = Controls.read()
    if pad:left() then
    Player.x = Player.x - 5
    end
    if pad:right() then
    Player.x = Player.x + 5
    end
    if pad:up() then
    Player.y = Player.y - 5
    end
    if pad:down() then
    Player.y = Player.y + 5
    end
    end
    
    function chasePlayer() --/ function to make the enemy chase the player/
    stallchase = math.random(2) 
    if stallchase == 1 then 
    if Enemy.x > Player.x then
    Enemy.x = Enemy.x - 2
    elseif Enemy.x < Player.x then
    Enemy.x = Enemy.x + 2
    end
    end
    stallchase = math.random(2)
    if stallchase == 1 then
    if Enemy.y > Player.y then
    Enemy.y = Enemy.y - 2
    elseif Enemy.y < Player.y then
    Enemy.y = Enemy.y + 2
    end
    end
    end --///end the function///
    
    -- Main loop
    
    while true do
    screen:clear()
    
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, grass)
    end
    end
    
    screen:blit(Player.x,Player.y,Mouse8)
    screen:blit(Enemy.x,Enemy.y,Bat)
    
    movePlayer() --///call movePlayer function///
    
    chasePlayer() --///call chasePlayer function////
    
    screen.waitVblankStart()
    screen.flip()
    end
    can someone help plz.

  17. #7787
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    because you have a bat image, and a bat sound that are named the same

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

    you never put in a function or anything so that the bat/mouse can't go offscreen
    also, with all those sounds and pictures, don't you get some sort of memory error, or the game is a bit slow?
    also, a suggestion for your "movePlayer" function: make it less than + or - 5, that (i think) will be quite choppy

    Your variables should be:
    1. functions
    or
    2. just words

    I'm pretty sure you can't be a built-in luaplayer function in a variable
    just put the words you want in, and when you want to print it to the screen, do this:
    screenrint(x, y, variable, colour)

  19. #7789
    QJ Gamer Green
    Points: 5.971, Level: 50
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    640
    Points
    5.971
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von michaelp
    yes it will....
    the only thing spaces do are make your code look nicer
    DONT ARGUE. it doesn't work i have tred it OK?! also look at the post above and help us with that source code somebody, and I do not know how to do "find and replace" or w/e

  20. #7790
    Banned from QJ for LIFE
    Points: 10.957, Level: 69
    Level completed: 27%, Points required for next Level: 293
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    1.557
    Points
    10.957
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    i'll explain f & r later

  21. #7791
    QJ Gamer Green
    Points: 5.971, Level: 50
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    640
    Points
    5.971
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von mraellis
    i'll explain f & r later
    oh ok
    :Punk:

  22. #7792
    QJ Gamer Bronze
    Points: 5.934, Level: 49
    Level completed: 92%, Points required for next Level: 16
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    654
    Points
    5.934
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Hey does anyone know how to edit my code while having it on my psp w/o exiting Luaplayer? I've tried this

    System.usbDiskModeActivat e()

    But i cant edit my code... any help?

    Edit: Ok im following tutorial #2 from psp-programming.com and when i try it i says
    Error SCRPIT.LUA:130: /=/ expected near /pad/. Any help?
    Geändert von _-Tiger-_ (07-24-2007 um 01:13 PM Uhr)

  23. #7793
    QJ Gamer Green
    Points: 5.971, Level: 50
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    640
    Points
    5.971
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von _-Tiger-_
    Hey does anyone know how to edit my code while having it on my psp w/o exiting Luaplayer? I've tried this

    System.usbDiskModeActivat e()

    But i cant edit my code... any help?

    Edit: Ok im following tutorial #2 from psp-programming.com and when i try it i says
    Error SCRPIT.LUA:130: /=/ expected near /pad/. Any help?
    look at line 130 in your code

  24. #7794
    QJ Gamer Bronze
    Points: 5.934, Level: 49
    Level completed: 92%, Points required for next Level: 16
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    654
    Points
    5.934
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    I did i tried to fix it about 10 times and still nothing... lol

  25. #7795
    Banned from QJ for LIFE
    Points: 10.957, Level: 69
    Level completed: 27%, Points required for next Level: 293
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    1.557
    Points
    10.957
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    post the full code and we can see where the problem is

  26. #7796
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Da_MerV
    i've been trying to find a way around this since saturday and i finally found one! yes its true that a screenshot will capture the scaled image but it would take way too long to write to the ms. remember the weird things that were happening with fillRect and print? well those weird things helped me to figure it out. when it blits from the screen, all it sees is alpha=0. when you fillRect or print before Gu.blit, it sees this as alpha=255. we can use this to our advantage to create masks! so in short, the quick fix is:
    Code:
    screen:fillRect(x,y,image:width(), image:height())
    before the call to Gu.start3d()
    Thanks for the tip, I was wondering about that.

    Also, here's Gu.blit2:

    Code:
    function Gu.blit2(x, y, image, img_x, img_y, width, height, scale, flip)
    	
    	if not scale or type(scale) == "string" then 
    		flip = scale
    		scale = 1
    	end
    	
    	
    	if flip then
    		if flip == "H" then
    			x_start = img_x + width
    			y_start = img_y
    			x_end  = img_x
    			y_end = img_y + height
    		elseif  flip == "V" then
    			x_start = img_x
    			y_start = img_y + height
    			x_end  = img_x + width
    			y_end = img_y
    		elseif flip == "HV" then
    			x_start = img_x + width
    			y_start = img_y + height
    			x_end = img_x
    			y_end = img_y
    		end
    	else
    		x_start = img_x
    		y_start = img_y
    		x_end = img_x + width
    		y_end = img_y + height
    	end
    	
    	
    	
    	
    	width = (width*scale)+y or (image:width()*scale)+x
    	height = (height*scale)+y or (image:height()*scale)+y
    	temp = {
    	{x_start, y_start, x, y, 0},
    	{x_end, y_end, width, height, 0}
    	}
    	Gu.enable(Gu.TEXTURE_2D)
    	Gu.texImage(image)
    	Gum.drawArray(Gu.SPRITES, Gu.TEXTURE_32BITF+Gu.VERTEX_32BITF+Gu.TRANSFORM_2D, temp)
    end
    it's basically the same as the first Gu.blit, except this version can draw parts of the image:

    Gu.blit2(10, 10, image, 10, 10, 40, 90, 1.5, "HV")

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

    Zitat Zitat von _-Tiger-_
    Hey does anyone know how to edit my code while having it on my psp w/o exiting Luaplayer? I've tried this

    System.usbDiskModeActivat e()

    But i cant edit my code... any help?

    Edit: Ok im following tutorial #2 from psp-programming.com and when i try it i says
    Error SCRPIT.LUA:130: /=/ expected near /pad/. Any help?
    are you sure you completely exited your app or game and were in Lowser when trying to edit your code?

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

    Once you edit your going to need to quit your game and restart lowser.

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

    Zitat Zitat von Anti-QuickJay
    Once you edit your going to need to quit your game and restart lowser.
    you dont need to restart lowser, just exit the app then restart the app after editing it.

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

    Thats if you include a exit call.


 

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

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