Seite 74 von 342 ErsteErste ... 24 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 124 174 ... LetzteLetzte
Zeige Ergebnis 2.191 bis 2.220 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; Zitat von Tritoch i meant all lua coders... :icon_razz :icon_sad: ...aww man...(lol) :icon_razz...

  
  1. #2191
    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 Tritoch
    i meant all lua coders... :icon_razz
    :icon_sad:
    ...aww man...(lol)
    :icon_razz


    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  2. #2192
    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 a bug in my code

    In my code, all the graphics keep blinking and they should just stay in the center if you move the player close enough to the wolf. Also, the wolfs health should erase so the new value will not write over the old one. Here is my code, any help would be great!

    grass = Image.load("grass.png")
    player = Image.load("player.png")
    wolf = Image. load("wolf.png")
    oldpad = Controls.read()
    red = Color.new(255,0,0)
    green = Color.new(0,255,0)

    screenwidth = 480 - player:width()
    screenheight = 272 - player:height()

    Player = {}
    Player[1] = { x = 100, y = 50 }
    Player[2] = { Health = 100, Weapon = "Sword", Level = 1, Type = "Warrior"}
    Player[3] = { Exp = 0 }
    Wolf = {}
    Wolf[1] = { x = 250, y = 150 }
    Wolf[2] = { Health = 100, Weapon = "Claws", Type = "Wolf", Level = 1}


    --Label the fighting sequence for the Function fight
    function Fight()
    --Paste in the grass
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, grass)
    end
    end
    --Paste player and enemy in center
    screen:blit(75,125, player)
    screen:blit(200,125, wolf)

    screenrint(1,1,"Fight!!!")
    screenrint(50,50,"Weapon: " .. Player[2].Weapon, red)
    screenrint(250,125,"Weapon: " .. Wolf[2].Weapon, red)
    screenrint(250,150,"Type: " .. Wolf[2].Type, red)
    screenrint(250,175,"Level: " .. Wolf[2].Level, red)
    screenrint(50,75,"Type: " .. Player[2].Type, red)
    screenrint(50,100,"Level: " .. Player[2].Level, red)
    screen.flip()
    while true do
    screenrint(250,100,"Wolf's Health: " .. Wolf[2].Health, green)
    screenrint(50,25,"Player's Health: " .. Player[2].Health, green)
    screen:flip()

    pad = Controls.read()
    if pad:cross() and oldpad:cross() ~= pad:cross() and Wolf[2].Health > 0 then
    Wolf[2].Health = Wolf[2].Health - 5
    end

    oldpad = pad
    screen.waitVblankStart()
    end
    end


    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, player)
    screen:blit(Wolf[1].x, Wolf[1].y, wolf)

    --Check to see if they are near enough to battle
    xvalue = Player[1].x - Wolf[1].x
    yvalue = Player[1].y - Wolf[1].y
    if xvalue < 0 then
    xvalue = xvalue * -1
    end
    if yvalue < 0 then
    yvalue = yvalue * -1
    end
    if xvalue < 90 and yvalue < 40 or xvalue < 90 and yvalue <40 then
    screen:clear()
    Fight()
    end

    if pad:left() and Player[1].x > 0 then
    Player[1].x = Player[1].x - 2
    end

    if pad:right() and Player[1].x < screenwidth then
    Player[1].x = Player[1].x + 2
    end

    if pad:up() and Player[1].y > 0 then
    Player[1].y = Player[1].y - 2
    end

    if pad:down() and Player[1].y < screenheight then
    Player[1].y = Player[1].y + 2
    end

    screen.waitVblankStart()
    screen.flip()
    end

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

    the smileys should be periods and then a 'p' btw

  4. #2194
    Points: 4.063, Level: 40
    Level completed: 57%, Points required for next Level: 87
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    41
    Points
    4.063
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    hmm, sorry if this has been asked and answered before but i don't have time to trawl through 220 pages

    I've managed to incorporate sounds in .wav format, but they take up too much space and are not good enough quality.

    i was wondering how i go about making / converting to .XM format which was included with the luaplayer download.

    thanks in advance, Tri

  5. #2195
    QJ Gamer Bronze
    Points: 4.362, Level: 42
    Level completed: 6%, Points required for next Level: 188
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    germany
    Beiträge
    38
    Points
    4.362
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    xm is a tracker format, compare it to midi but the latter unfortunately is not included
    you must keep the wavs at 11250,8-bit mono max, at least that's what i'm using, not to get in trouble with mikmod. (or you could compile a newer ver of mikmod or sth to play midis?)
    wav 2 xm is not an option, just too big. (you could use a wav as a single track and use it like a sample)
    -=imhotep=-

  6. #2196
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    In my code, all the graphics keep blinking and they should just stay in the center if you move the player close enough to the wolf. Also, the wolfs health should erase so the new value will not write over the old one. Here is my code, any help would be great!

    grass = Image.load("grass.png")
    player = Image.load("player.png")
    wolf = Image. load("wolf.png")
    oldpad = Controls.read()
    red = Color.new(255,0,0)
    green = Color.new(0,255,0)

    screenwidth = 480 - player:width()
    screenheight = 272 - player:height()

    Player = {}
    Player[1] = { x = 100, y = 50 }
    Player[2] = { Health = 100, Weapon = "Sword", Level = 1, Type = "Warrior"}
    Player[3] = { Exp = 0 }
    Wolf = {}
    Wolf[1] = { x = 250, y = 150 }
    Wolf[2] = { Health = 100, Weapon = "Claws", Type = "Wolf", Level = 1}


    --Label the fighting sequence for the Function fight
    function Fight()
    --Paste in the grass
    for a = 0, 14 do
    for b = 0,8 do
    screen:blit(32 * a, 32 * b, grass)
    end
    end
    --Paste player and enemy in center
    screen:blit(75,125, player)
    screen:blit(200,125, wolf)

    screenrint(1,1,"Fight!!!")
    screenrint(50,50,"Weapon: " .. Player[2].Weapon, red)
    screenrint(250,125,"Weapon: " .. Wolf[2].Weapon, red)
    screenrint(250,150,"Type: " .. Wolf[2].Type, red)
    screenrint(250,175,"Level: " .. Wolf[2].Level, red)
    screenrint(50,75,"Type: " .. Player[2].Type, red)
    screenrint(50,100,"Level: " .. Player[2].Level, red)
    screen.flip()
    while true do
    screenrint(250,100,"Wolf's Health: " .. Wolf[2].Health, green)
    screenrint(50,25,"Player's Health: " .. Player[2].Health, green)
    screen:flip()

    pad = Controls.read()
    if pad:cross() and oldpad:cross() ~= pad:cross() and Wolf[2].Health > 0 then
    Wolf[2].Health = Wolf[2].Health - 5
    end

    oldpad = pad
    screen.waitVblankStart()
    end
    end


    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, player)
    screen:blit(Wolf[1].x, Wolf[1].y, wolf)

    --Check to see if they are near enough to battle
    xvalue = Player[1].x - Wolf[1].x
    yvalue = Player[1].y - Wolf[1].y
    if xvalue < 0 then
    xvalue = xvalue * -1
    end
    if yvalue < 0 then
    yvalue = yvalue * -1
    end
    if xvalue < 90 and yvalue < 40 or xvalue < 90 and yvalue <40 then
    screen:clear()
    Fight()
    end

    if pad:left() and Player[1].x > 0 then
    Player[1].x = Player[1].x - 2
    end

    if pad:right() and Player[1].x < screenwidth then
    Player[1].x = Player[1].x + 2
    end

    if pad:up() and Player[1].y > 0 then
    Player[1].y = Player[1].y - 2
    end

    if pad:down() and Player[1].y < screenheight then
    Player[1].y = Player[1].y + 2
    end

    screen.waitVblankStart()
    screen.flip()
    end
    Isnt the screen:flip() supposed to be screen.flip()?

  7. #2197
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Is there a way how to see if the LuaPlayer doesn't find a file?
    I mean so i can make it skip to load the ect. picure so it donsen't gives a error and forces you to restart?

    This is the third time i ask this!
    Geändert von HaxxBlaster (05-11-2006 um 03:58 AM Uhr)
    [CENTER]Some of my homebrew Applications/Games:
    [URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
    [URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]

    [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]

  8. #2198
    QJ Gamer Bronze
    Points: 8.803, Level: 63
    Level completed: 18%, Points required for next Level: 247
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Western Australia
    Beiträge
    1.046
    Points
    8.803
    Level
    63
    Downloads
    0
    Uploads
    0

    Standard

    the only way you can possibly do that (as far as I know) is put comment parts in your code then when you need it back to normal take away the comment marks.

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

    just explaining PopcOrn DeVil's answer.

    Code:
    -->anything in the same line as the "--" marks are not read.
    
    >This line, however, is read and will result in an error since its not code.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  10. #2200
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    No no no! WTF, i am not stupid!

    It's like this: In my program Graphic Creator 2.0, that will be released as soon as i fix this last piece. It would load the latest saved work you have done, BUT if you don't have any work done it would be an error "Couldent find the file (xx.png)", and you will be forced to restart the LuaPlayer.

    I would like it to jump over the loading of the picure, i would be something with a "return" comand, no one seems to know how to use it.
    Geändert von HaxxBlaster (05-11-2006 um 08:47 AM Uhr)
    [CENTER]Some of my homebrew Applications/Games:
    [URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
    [URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]

    [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]

  11. #2201
    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 HaxxBlaster
    No no no! WTF, i am not stupid!

    It's like this: In my program Graphic Creator 2.0, that will be released as soon as i fix this last piece. It would load the latest saved work you have done, BUT if you don't have any work done it would be an error "Couldent find the file (xx.png)", and you will be forced to restart the LuaPlayer.

    I would like it to jump over the loading of the picure, i would be something with a "return" comand, no one seems to know how to use it.
    how about in the part where you load the image. you put:

    Code:
    elseif error("Autostart error")
    do return
    end
    end
    i'm not sure if it'll work, its an educated guess.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  12. #2202
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    I don't see why that would work at all.
    But where will the "elseif" fit in to?
    It will give no use if there is no way to see if the image is no able to be load, it it would get that error, there is no way to "return" back.

    I have thought about this much, and the only way to solve my problem is to know if the picture is succesfully loadable or not, but no one seems to know sheit about it.
    [CENTER]Some of my homebrew Applications/Games:
    [URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
    [URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]

    [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]

  13. #2203
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    hmmm.... I probably could do it... I just need the Lua Source adn edit the blitting function/prototype to an 'int' instead of a 'void', that way it will retrun something... i may look into it...

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  14. #2204
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Thanks man!
    [CENTER]Some of my homebrew Applications/Games:
    [URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
    [URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]

    [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]

  15. #2205
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von HaxxBlaster
    No no no! WTF, i am not stupid!

    It's like this: In my program Graphic Creator 2.0, that will be released as soon as i fix this last piece. It would load the latest saved work you have done, BUT if you don't have any work done it would be an error "Couldent find the file (xx.png)", and you will be forced to restart the LuaPlayer.

    I would like it to jump over the loading of the picure, i would be something with a "return" comand, no one seems to know how to use it.
    Mayb something like this:
    Code:
    All your code here...
    Then
    screen:blit(x,y,xx.png)
    if screen:blit(x,y,xx.png) == false then
    screen:print(x,y,"You have not any saved work.", color)
    end
    I'm not the best lua coder...

  16. #2206
    Points: 4.248, Level: 41
    Level completed: 49%, Points required for next Level: 102
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    31
    Points
    4.248
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    How do you get netlib v1.4 to work?

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

    Hi can anyone please help me with my program on page 220? I changed the screen.flip() but it still acts really weird.

  18. #2208
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    PSPduh:

    I tryed that first of all my ideas to solve my problem, it doesn't work.
    I think that it is what SGC is going to take a look at.
    Geändert von HaxxBlaster (05-11-2006 um 11:07 AM Uhr)
    [CENTER]Some of my homebrew Applications/Games:
    [URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
    [URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]

    [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]

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

    Hey, nevermind about my program, i fixed it now by putting my whole function fight() as a loop, and put in a screen:clear() too. Thanks though.

  20. #2210
    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 HaxxBlaster
    I don't see why that would work at all.
    But where will the "elseif" fit in to?
    It will give no use if there is no way to see if the image is no able to be load, it it would get that error, there is no way to "return" back.

    I have thought about this much, and the only way to solve my problem is to know if the picture is succesfully loadable or not, but no one seems to know sheit about it.
    you didnt post any code, so I assumed you made an 'if' statement out of the skip-of-nothing-is-there part of your app.

    sorry, i'm no help to you here...I'm confident SG57 can fix your problem though!
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  21. #2211
    QJ Gamer Silver
    Points: 11.326, Level: 70
    Level completed: 19%, Points required for next Level: 324
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    871
    Points
    11.326
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Hi, i know somone here posted something about it but i can't find it.A sidescrolling code in lua like PSPsoldier to make someone move . counld somone help plz.

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

    Hey does anyone know of a 'goto' command in lua. Like instead of calling a function, just actually skip to a part of you code without have to go back. Like the lbl and goto functions on a ti-83+ calculator.

  23. #2213
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    Hey does anyone know of a 'goto' command in lua. Like instead of calling a function, just actually skip to a part of you code without have to go back. Like the lbl and goto functions on a ti-83+ calculator.
    hmmm.....mayb you could define a variable then check whether it equals a certain number, when it does equal that number then run the code.

    Code:
    duh = 0
    
    if pad:cross() then
    duh = duh + 1
    end
    
    if duh >= 2 then
    duh = 1
    end
    
    if duh == 1 then
    (insert code here)
    end
    On second thought, that might not answer your question. Well, I try.

  24. #2214
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    I'm sorry for the double post, but how would you do that a certain button is held down for 5 seconds or something.
    Code:
    if pad:cross(180) then
    <insert code here>
    end
    Would it be like that or another way?

  25. #2215
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    nope another way. You have to use a timer.

    And no there isn't a goto command and neither a label command. You have to use functions for this.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  26. #2216
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Hmm.... After looking throuigh the source, the Image loading is an integer, and it returns 1 on completion i belive, so give it a try.. So put a true or false statement, if the loading of an image is == 1, then it retruned completed, if not, do if not loadd an imgae ==1, then failed to load an image.

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  27. #2217
    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 ZereoX
    Hi, i know somone here posted something about it but i can't find it.A sidescrolling code in lua like PSPsoldier to make someone move . counld somone help plz.
    that someone suggested looking at the 'music' file bundled with luaplayer. it has a side-scrolling background.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  28. #2218
    QJ Gamer Silver
    Points: 11.326, Level: 70
    Level completed: 19%, Points required for next Level: 324
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    871
    Points
    11.326
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Ok tkz il look at it tonight cause im at school.

  29. #2219
    QJ Gamer Blue
    Points: 5.453, Level: 47
    Level completed: 52%, Points required for next Level: 97
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    166
    Points
    5.453
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    can someone tell we what's wrong with this please?
    I tried making a quick game as a joke and It won't work.
    I read quick guide and built it around what it said, and whenever I try launching it in luaplayer it says that there is no script file found. I tried saving it as both script.lua and index.lua. any help appreciated.

    Code:
    pimppicture=Image.load("pics/pimp.png")
    kidpicture=Image.load("pics/kid.png")
    mom=Image.load("pics/mom.png")
    background=Image.load("pics/background.png")
    winner=Image.load("pics/winner.png")
    loser=Image.load("pics/loser.png")
    distance=nul
    timer=1
    pimp=430
    kid=300
    while true do
    timer=1
    screen:clear()
    pad=Controls.read()
    	if pad:cross() then
    	kid=kid-2
    	end
    kid=kid-.5
    pimp=pimp-.5
    	if kid=40 then
    		while timer=1
    		pad=Controls.read()
    		screen:blit(0, 0, winner)
    		screen.flip()
    			if pad:cross() then
    			timer=2
    			end
    		end
    	end
    distance=kid+30
    	if pimp=distance then
    		while timer=1
    		pad=Controls.read()
    		screen.blit(1, 1, loser)
    		screen.flip()
    			if pad:cross() then
    			timer=2
    			end
    		end
    	end
    	screen.blit(0, 0, background)
    	screen.blit(0, 100, mom)
    	screen.blit(kid, 100, kidpicture)
    	screen.blit(pimp, 100, pimppicture)
    	screen.flip()
    end
    I wanted to make it so that you had to press the cross button really fast to move the kid over to the "mom" befoe the pimp catches him and shanks him.

  30. #2220
    Gutya
    Points: 15.093, Level: 79
    Level completed: 49%, Points required for next Level: 257
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    2.398
    Points
    15.093
    Level
    79
    Downloads
    0
    Uploads
    0

    Standard

    Your code is horribly hard for me to read.
    D:


 

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 .