Seite 63 von 342 ErsteErste ... 13 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 113 163 ... LetzteLetzte
Zeige Ergebnis 1.861 bis 1.890 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; SG57 Now what could it be wrong this time ? Lua player load my index with out any error but ...

  
  1. #1861
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    SG57
    Now what could it be wrong this time ? Lua player load my index with out any error but with the eboot and changing system.lua to load mine it gives error, it dosent load my index but it dose load airhockey index
    i added the luasplash and and comp.wav to my index it loads but when its time to load the program it gives error ???? and with luaplayer it dosent ?????? am i missing a code?


    Bequiet!!!
    I'm learning cc©cc

  2. #1862
    QJ Gamer Silver
    Points: 9.678, Level: 66
    Level completed: 7%, Points required for next Level: 372
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    The Migrant Fleet
    Beiträge
    908
    Points
    9.678
    Level
    66
    Downloads
    0
    Uploads
    0

    Standard

    Hey what does this error mean?

    Code:
    stack overflow

  3. #1863
    Points: 4.325, Level: 41
    Level completed: 88%, Points required for next Level: 25
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    41
    Points
    4.325
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    hey guys,

    what im trying to do is create a moving allow/launcher for a homebrew game.

    i loaded the image, then i want it to move to the left when you press up.
    so this is the code i used
    Code:
    --[[
    launcher  loaded in default position)
    ]]
    
    screen:blit(20,98,launcher7)
    screen:flip()
    
    pad = Controls.read()
    
    if pad:cross() then break end
    end
    
    if pad:up() then
    launcher7.clear()
    screen:blit(20,98,launcher6)
    screen:flip()
    the problem i have is when you press up - the original launcher/arrow doesnt clear - so you cant see the second launcher (which is slightly aimed more towards the left)

    can anyone help me with this
    or
    is there an easier way of moving the laucher/arrow

    thanks for all your help

    RL

    {Edit}

    so now i got it to do something - by moving the "end" after
    if pad:cross() then break end
    but i get the error
    image:clear([color]) zero or one arguement

  4. #1864
    Think, Do, Gloat.
    Points: 12.687, Level: 73
    Level completed: 60%, Points required for next Level: 163
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    England, Norwich
    Beiträge
    1.422
    Points
    12.687
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von montrob
    Hey what does this error mean?

    Code:
    stack overflow
    I think it means something could not be found like a file maybe? But i'm only guessing here!

  5. #1865
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    aaaa donno what is wrong but i m rebuiding the paint program again
    learning this things is almost making me downgrade again >.< and i dont feal comfortable doing it =/
    Bequiet!!!
    I'm learning cc©cc

  6. #1866
    Think, Do, Gloat.
    Points: 12.687, Level: 73
    Level completed: 60%, Points required for next Level: 163
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    England, Norwich
    Beiträge
    1.422
    Points
    12.687
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Raven_lif
    hey guys,

    what im trying to do is create a moving allow/launcher for a homebrew game.

    i loaded the image, then i want it to move to the left when you press up.
    so this is the code i used
    Code:
    --[[
    launcher  loaded in default position)
    ]]
    
    screen:blit(20,98,launcher7)
    screen:flip()
    
    pad = Controls.read()
    
    if pad:cross() then break end
    end
    
    if pad:up() then
    launcher7.clear()
    screen:blit(20,98,launcher6)
    screen:flip()
    the problem i have is when you press up - the original launcher/arrow doesnt clear - so you cant see the second launcher (which is slightly aimed more towards the left)

    can anyone help me with this
    or
    is there an easier way of moving the laucher/arrow

    thanks for all your help

    RL

    {Edit}

    so now i got it to do something - by moving the "end" after
    if pad:cross() then break end
    but i get the error
    You have described launcher6 and 7 haven't you, it's just it doesn't say it there.oh, is that the image, i guess it is.
    How about adding waitVblankstart() or something?

  7. #1867
    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 Raven_lif
    hey guys,

    what im trying to do is create a moving allow/launcher for a homebrew game.

    i loaded the image, then i want it to move to the left when you press up.
    so this is the code i used
    Code:
    --[[
    launcher  loaded in default position)
    ]]
    
    screen:blit(20,98,launcher7)
    screen:flip()
    
    pad = Controls.read()
    
    if pad:cross() then break end
    end
    
    if pad:up() then
    launcher7.clear()
    screen:blit(20,98,launcher6)
    screen:flip()
    the problem i have is when you press up - the original launcher/arrow doesnt clear - so you cant see the second launcher (which is slightly aimed more towards the left)

    can anyone help me with this
    or
    is there an easier way of moving the laucher/arrow

    thanks for all your help

    RL

    {Edit}

    so now i got it to do something - by moving the "end" after
    if pad:cross() then break end
    but i get the error
    are u even ALLOWED to do launch7.claer()??
    --------------------------------------------------------------------------------------

  8. #1868
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    usbin = System.usbDiskModeActivate
    
    while true do
    screen:clear()
    pad = Controls.read()
    
    if pad:l() then usbin = true
    end
    
    if pad:select() then
    break
    end
    
    screen.flip()
    screen.waitVblankStart()
    end
    this is just an example. there are more codes in
    Guys i put into the script. but usb dosnt show up. how can I make it work ?
    ( i have firmware 2.0 though)
    Geändert von natan333 (04-28-2006 um 02:10 PM Uhr)
    Bequiet!!!
    I'm learning cc©cc

  9. #1869
    Points: 4.325, Level: 41
    Level completed: 88%, Points required for next Level: 25
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    41
    Points
    4.325
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    yes i defined launcher6 and 7 amognst others

    ill try
    waitVblankstart()
    but doesnt that make the screen pause?

    are u even ALLOWED to do launch7.claer()??
    well i assume so - its just a code to clear the image isn't it? launch7 being the image

    but anyway it doesnt work - because it just dies and gives the error i mentioned

  10. #1870
    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 PSPduh
    Hello all, can someone help me with this code? For some reason, when I try to run it on the PC, it creates a luaplayer.exe.stackdump file. The code:

    Code:
     
    
    red=Color.new(255,0,0)
    green=Color.new(0,255,0)
    blue=Color.new(0,0,255)
    white=Color.new(255,255,255)
    
    duh=Image.load("duh.png")
    counter=Timer.new()
    counter:start()
    screen:blit(50,50,"duh.png")
    while true do
    pad=Controls.read()
    
    if pad:up() then
    duh.y=duh.y + 2
    end
    
    if pad:down() then
    duh.y=duh.y - 2
    end
    
    if pad:right() then
    duh.x=duh.x + 2
    end
    
    if pad:left() then
    duh.x=duh.x - 2
    end
    
    currentTime=counter:time()
    screen:clear(blue)
    screen:print(10,10,"Counter Time: " .. currentTime, white)
    
    if currentTime > 2500 and currentTime < 5000 then
    screen:clear(red)
    end
    
    if currentTime > 5001 then
    counter:reset(0)
    counter:start()
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    When the stackdump is opened with notepad, its:

    Code:
    Stack trace:
    Frame     Function  Args
      49774 [sig] luaplayer 2112 handle_threadlist_exception: handle_threadlist_exception called with threadlist_ix -1
      75965 [sig] luaplayer 2112 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
    Exception: STATUS_ACCESS_VIOLATION at eip=61015E82
    eax=7C802542 ebx=610E7ECC ecx=00000000 edx=0000001B esi=00000000 edi=00000001
    ebp=00A2E6E8 esp=00A2E6E4 program=C:\Documents and Settings\FattyMcFat\Desktop\luaplayerwindows\luaplayer.exe, pid 2112, thread sig
    cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
    Stack trace:
    Frame     Function  Args
    00A2E6E8  61015E82  (610E7ECC, 0022E598, 00000001, 00000000)
    00A2E708  61015FAC  (00000001, 00A2E760, 00000000, 00000000)
    00A2EA58  610179AB  (000006F4, 00A2EED0, 000000A4, 00A2EE9C)
    00A2EF98  6108A497  (610E6D18, 00000000, 00000F84, 00000000)
    00A2EFC8  6100327F  (610E6D18, 00A2F000, 61003160, 00000000)
    00A2EFF8  61003E94  (00000000, 00000000, 00000000, 00000000)
    00A2FF98  61003EDA  (00000000, 00000000, 00000000, 00000000)
    End of stack trace
    Can someone help? And thanks in advance!
    You need spaces between the "=" signs for all variables.

    example

    What you have:
    black=Color.new(0, 0, 0)

    Should be:
    black = Color.new(0, 0, 0) <--space out the words from the equal (=) sign.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  11. #1871
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    guys wasnt this supposed to work ?. already put CursorsDimensionY and X before while true do
    Code:
    if letterPosy < 0 then letterPosy = 0
    	 else if letterPosy > 272 - CursorsDimensionY then letterPosy = 272 - CursorsDimensionY
    	 else if letterPosx < 0 then letterPosx = 0
    	 else if letterPosx > 480 - CursorsDimensionX then 480 - CursorsDimensionX
    	 end
    end
    Bequiet!!!
    I'm learning cc©cc

  12. #1872
    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 Raven_lif
    yes i defined launcher6 and 7 amognst others

    ill try
    waitVblankstart()
    but doesnt that make the screen pause?



    well i assume so - its just a code to clear the image isn't it? launch7 being the image

    but anyway it doesnt work - because it just dies and gives the error i mentioned
    yes. thats what "screen.waitVblankStart() " does. it stops the screen at leaving whatever is blitted right where it is for eternity, unless its used in a "while true do" loop.

    Code:
    --[[
    launcher  loaded in default position)
    ]]
    
    screen:blit(20,98,launche  r7)
    screen:flip() <-- whats this here for? I only see a need for one "screen.flip()", and thats placed at the bottom of the script just before "screen.waitVblanStart()".
    
    pad = Controls.read()
    
    if pad:cross() then break end
    end
    
    if pad:up() then
    launcher7.clear()
    screen:blit(20,98,launche  r6)
    screen:flip()
    end
    you missed an "end" for that last "if" loop.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  13. #1873
    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 natan333
    guys wasnt this supposed to work ?. already put CursorsDimensionY and X before while true do
    Code:
    if letterPosy < 0 then letterPosy = 0
    	 else if letterPosy > 272 - CursorsDimensionY then letterPosy = 272 - CursorsDimensionY
    	 else if letterPosx < 0 then letterPosx = 0
    	 else if letterPosx > 480 - CursorsDimensionX then 480 - CursorsDimensionX
    	 end
    end
    only one "end" is necessary.

    thats whats good about using "elseif".
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  14. #1874
    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

    damn...I just realized I'm making too many posts..oh well.

    Code:
    if pad:up() then
    launcher7.clear() -- just use a normal "screen.clear()"
    screen:blit(20,98,launche    r6)
    screen:flip()
    end
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  15. #1875
    Points: 4.325, Level: 41
    Level completed: 88%, Points required for next Level: 25
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    41
    Points
    4.325
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    you missed an "end" for that last "if" loop.
    the end is there was just on the next line down

    screen:blit(20,98,launche r7)
    screen:flip() <-- whats this here for? I only see a need for one "screen.flip()", and thats placed at the bottom of the script just before "screen.waitVblanStar t
    becuase its loading ht elauncher - as well as some other images - that i dont have a problem with - which is why they are not included in the code

    also a screen:clear()
    doesnt do anything

    oh........god
    Geändert von Raven_lif (04-28-2006 um 02:57 PM Uhr)

  16. #1876
    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 Raven_lif
    the end is there was just on the next line down


    becuase its loading ht elauncher - as well as some other images - that i dont have a problem with - which is why they are not included in the code
    ah.

    i think you should post a little more coding next time around so people avoid confusion.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  17. #1877
    Points: 4.325, Level: 41
    Level completed: 88%, Points required for next Level: 25
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    41
    Points
    4.325
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    XD..... sorry
    Geändert von Raven_lif (04-29-2006 um 05:34 AM Uhr)

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

    Thanks EminentJonFrost, but it still creates a stackdump file. I spaced out everything that was cramped on the equal sign; the new code:

    Code:
    red = Color.new(255,0,0)
    green = Color.new(0,255,0)
    blue = Color.new(0,0,255)
    white = Color.new(255,255,255)
    
    duh = Image.load("duh.png")
    counter = Timer.new()
    counter:start()
    screen:blit(50,50,duh)
    while true do
    pad = Controls.read()
    
    if pad:up() then
    duh.y = duh.y + 2
    end
    
    if pad:down() then
    duh.y = duh.y - 2
    end
    
    if pad:right() then
    duh.x = duh.x + 2
    end
    
    if pad:left() then
    duh.x = duh.x - 2
    end
    
    currentTime = counter:time()
    screen:clear(blue)
    screen:print(10,10,"Counter Time: " .. currentTime, white)
    
    if currentTime > 2500 and currentTime < 5000 then
    screen:clear(red)
    end
    
    if currentTime > 5001 then
    counter:reset(0)
    counter:start()
    end
    And the stackdump file: (not sure if it changed)

    Code:
    Stack trace:
    Frame     Function  Args
    7C8107FD  7C81084D  (32000000, 907C83AB, 90909090, FC489D39)
     322869 [sig] luaplayer 2956 handle_threadlist_exception: handle_threadlist_exception called with threadlist_ix -1
     339374 [sig] luaplayer 2956 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
    Exception: STATUS_ACCESS_VIOLATION at eip=61015E82
    eax=00FFFFFF ebx=610E7ECC ecx=00000000 edx=FF001CC6 esi=00000001 edi=00000001
    ebp=00A2E6E8 esp=00A2E6E4 program=C:\Documents and Settings\FattyMcFat\Desktop\luaplayerwindows\luaplayer.exe, pid 2956, thread sig
    cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
    Stack trace:
    Frame     Function  Args
    00A2E6E8  61015E82  (610E7ECC, 6110BA74, FC489D39, 00000000)
    00A2E708  61015FAC  (00000001, 00A2E760, 00000000, 00000000)
    00A2EA58  610179AB  (000006F4, 00A2EED0, 000000A4, 00A2EE9C)
    00A2EF98  6108A497  (610E6D18, 00000000, 00000F84, 00000000)
    00A2EFC8  6100327F  (610E6D18, 00A2F000, 61003160, 00000000)
    00A2EFF8  61003E94  (00000000, 00000000, 00000000, 00000000)
    00A2FF98  61003EDA  (00000000, 00000000, 00000000, 00000000)
    End of stack trace
    Thanks in advance!
    Geändert von PSPduh (04-28-2006 um 03:18 PM Uhr)

  19. #1879
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    hmm. that code was wrong for me
    the code bellow worked with me like a charm =PP
    Code:
    if letterPosy < 2 then letterPosy = 2 end
    if letterPosy > 269 then letterPosy = 269 end
    if letterPosx < 2 then letterPosx = 2 end
    if letterPosx > 477 then letterPosx = 477 end
    Anyways, i dont know how will be for users bellow 2.0, is the lua windows eboot have a home button included ?
    and How can i take screenshot like
    Code:
    if pad:l() and pad:triangle() then screen:save("PortablePaint.tga") end
    but to go to the root of the memory stick ?
    and by making it to change to portablepaint to like portablepaint02 if i pres l trigger and triangle twice and so on?
    Geändert von natan333 (04-28-2006 um 04:12 PM Uhr)
    Bequiet!!!
    I'm learning cc©cc

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

    Zitat Zitat von natan333
    SG57
    Now what could it be wrong this time ? Lua player load my index with out any error but with the eboot and changing system.lua to load mine it gives error, it dosent load my index but it dose load airhockey index
    i added the luasplash and and comp.wav to my index it loads but when its time to load the program it gives error ???? and with luaplayer it dosent ?????? am i missing a code?
    omg... Just look at the structure of the app and how it is loaded. Then replace it with your structurea dn stuff

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


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

    Thanks EminentJonFrost, but it still creates a stackdump file. I spaced out everything that was cramped on the equal sign; the new code:

    Code:
    red = Color.new(255,0,0)
    green = Color.new(0,255,0)
    blue = Color.new(0,0,255)
    white = Color.new(255,255,255)
    
    duh = Image.load("duh.png")
    counter = Timer.new()
    counter:start()
    screen:blit(50,50,duh)
    while true do
    pad = Controls.read()
    
    if pad:up() then
    duh.y = duh.y + 2
    end
    
    if pad:down() then
    duh.y = duh.y - 2
    end
    
    if pad:right() then
    duh.x = duh.x + 2
    end
    
    if pad:left() then
    duh.x = duh.x - 2
    end
    
    currentTime = counter:time()
    screen:clear(blue)
    screen:print(10,10,"Counter Time: " .. currentTime, white)
    
    if currentTime > 2500 and currentTime < 5000 then
    screen:clear(red)
    end
    
    if currentTime > 5001 then
    counter:reset(0)
    counter:start()
    end
    And the stackdump file: (not sure if it changed)

    Code:
    Stack trace:
    Frame     Function  Args
    7C8107FD  7C81084D  (32000000, 907C83AB, 90909090, FC489D39)
     322869 [sig] luaplayer 2956 handle_threadlist_excepti  on: handle_threadlist_excepti  on called with threadlist_ix -1
     339374 [sig] luaplayer 2956 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
    Exception: STATUS_ACCESS_VIOLATION at eip=61015E82
    eax=00FFFFFF ebx=610E7ECC ecx=00000000 edx=FF001CC6 esi=00000001 edi=00000001
    ebp=00A2E6E8 esp=00A2E6E4 program=C:\Documents and Settings\FattyMcFat\Deskt  op\luaplayerwindows\luapl  ayer.exe, pid 2956, thread sig
    cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
    Stack trace:
    Frame     Function  Args
    00A2E6E8  61015E82  (610E7ECC, 6110BA74, FC489D39, 00000000)
    00A2E708  61015FAC  (00000001, 00A2E760, 00000000, 00000000)
    00A2EA58  610179AB  (000006F4, 00A2EED0, 000000A4, 00A2EE9C)
    00A2EF98  6108A497  (610E6D18, 00000000, 00000F84, 00000000)
    00A2EFC8  6100327F  (610E6D18, 00A2F000, 61003160, 00000000)
    00A2EFF8  61003E94  (00000000, 00000000, 00000000, 00000000)
    00A2FF98  61003EDA  (00000000, 00000000, 00000000, 00000000)
    End of stack trace
    Thanks in advance!
    hmm..I'm not sure. But my guess is that you change this:

    Code:
    screen:print(10,10,"Counter Time: " .. currentTime, white)
    To This:

    Code:
    screen:print(10, 10, currentTime, white)
    see if that works.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

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

    It'll only print the word currentTime.

  23. #1883
    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 PopcOrn DeVil
    It'll only print the word currentTime.
    here: try this:


    Code:
    red = Color.new(255,0,0)
    green = Color.new(0,255,0)
    blue = Color.new(0,0,255)
    white = Color.new(255,255,255)
    
    duhx = 50
    duhy = 50
    
    duh = Image.load("duh.png")
    counter = Timer.new()
    
    while true do
    
    screen:clear(blue)
    
    pad = Controls.read()
    
    screen:blit(duhx,duhy,duh)
    
    if pad:up() then
    duhy = duhy - 2
    end
    
    if pad:down() then
    duhy = duhy + 2
    end
    
    if pad:right() then
    duhx = duhx + 2
    end
    
    if pad:left() then
    duhx = duhx - 2
    end
    
    currentTime = counter:time()
    screen:print(10,10,"Counter Time: " .. currentTime, white)
    
    if currentTime > 2500 and currentTime < 5000 then
    screen:clear(red)
    end
    
    if currentTime > 5001 then
    counter:reset()
    counter:start()
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    problems in your original code:

    1.whenever you print OR blit something to the screen: it MUST be done inside a function, or a loop. you blitted "duh" in neither, so it appeared for only a bit, and then cleared.

    2. at the end of your loop, you stated screen:clear(blue), and then printed the time. when you cleared, you ALSO cleared the picture, so it only showed you the time.

    3. you did not give duhx and duhy a value. how is luaplayer supposed to know?

    4. you did not end your loop.

    5. there were more, but im too lazy right now.

    bb! and good luck!

    EDIT: @ EminentJonFrost, you DO NOT need spaces between your ='s, <'s, or >',s. although they do make your code easier to read.
    --------------------------------------------------------------------------------------

  24. #1884
    QJ Gamer Bronze
    Points: 5.975, Level: 50
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Alabama
    Beiträge
    272
    Points
    5.975
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    that wont work, but only for one simple reason. the screen:clear(red) near the bottom of the loop will clear the whole screen on top of the print command and the duh image, leaving a blank red screen until it goes back to blue.

    Doing ALL your screen clearing at the top is a better approach, try this one.

    Code:
    red = Color.new(255,0,0)
    green = Color.new(0,255,0)
    blue = Color.new(0,0,255)
    white = Color.new(255,255,255)
    
    duhx = 50
    duhy = 50
    
    duh = Image.load("duh.png")
    counter = Timer.new()
    
    while true do
    
    currentTime = counter:time()
    
    if currentTime > 2500 and currentTime < 5000 then
    screen:clear(red)
    else
    screen:clear(blue)
    end
    
    pad = Controls.read()
    
    screen:blit(duhx,duhy,duh  )
    
    if pad:up() then
    duhy = duhy - 2
    end
    
    if pad:down() then
    duhy = duhy + 2
    end
    
    if pad:right() then
    duhx = duhx + 2
    end
    
    if pad:left() then
    duhx = duhx - 2
    end
    
    
    screen:print(10,10,"Counter Time: " .. currentTime, white)
    
    
    
    if currentTime > 5001 then
    counter:reset()
    counter:start()
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    My lua tutorials for PSP - www.evilmana.com/tutorials
    PSP Lua CodeBase - Add your own code examples to the codebase! - www.evilmana.com/tutorials/codebase/

  25. #1885
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    I have an question: how can i make trigger R to do multiple, Triple Things like an example below
    Code:
    if pad:r() and screen:blit(3,0, color) then screen:blit(3,50, color)
    end
    But i get error =/
    Bequiet!!!
    I'm learning cc©cc

  26. #1886
    QJ Gamer Silver
    Points: 9.678, Level: 66
    Level completed: 7%, Points required for next Level: 372
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    The Migrant Fleet
    Beiträge
    908
    Points
    9.678
    Level
    66
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von natan333
    I have an question: how can i make trigger R to do multiple, Triple Things like an example below
    Code:
    if pad:r() and screen:blit(3,0, color) then screen:blit(3,50, color)
    end
    But i get error =/
    try this
    Code:
    if pad:r() then 
    screen:blit(3,0, color) and screen:blit(3,50, color)
    end
    end

  27. #1887
    QJ Gamer Bronze
    Points: 5.975, Level: 50
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Alabama
    Beiträge
    272
    Points
    5.975
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von natan333
    I have an question: how can i make trigger R to do multiple, Triple Things like an example below
    Code:
    if pad:r() and screen:blit(3,0, color) then screen:blit(3,50, color)
    end
    But i get error =/
    Yeah, that definitely would cause an error ;)
    What exactly do you want it to do?

    If you want to blit 2 images at once in one if statement then do this:

    Code:
    if pad:r() then
    screen:blit(3,0, color)
    screen:blit(3,50,color)
    end
    There is not limit how many lines you can put in there.
    My lua tutorials for PSP - www.evilmana.com/tutorials
    PSP Lua CodeBase - Add your own code examples to the codebase! - www.evilmana.com/tutorials/codebase/

  28. #1888
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    thx so much.
    Now there is only one thing that i really need to learn for further releases and etc's
    The code bellow is part of the script
    Code:
    if pad:cross() then
    		canvas:drawLine(letterPosx, letterPosy, x1, y1, black)
    	end
    	x1 = letterPosx
    	y1 = letterPosy
    	screen:blit(0, 0, canvas, 0, 0, canvas:width(), canvas:height(), false)
    
    
    
    
    screen:blit(letterPosx,letterPosy, arrow)
    ---------------------------------------------------
    if pad:r() then screen:blit(3,0, color) end
    if pad:r() and pad:square() then 
    if letterPosx >= 4 and letterPosx <= 16 and letterPosy >= 19 and letterPosy <= 30 then
    canvas:drawLine(letterPosx, letterPosy, x1, y1, red)
    end
    end
    I dont know if you really going to get it.

    You can see that Holding Cross and moving the arrows will have black pixels.
    The Code above the ----- line is the default color of the paint (Black).
    The code bellow the ---- line is what i m trying to change the black pixel to become red. The thing i want to make it work is to hold R trigger to pop up an image of a bunch of colors then select the color and press square button to activate it to change black to the color that is selected.
    The code bellow
    Code:
    letterPosx >= 4 and letterPosx <= 16 and letterPosy >= 19 and letterPosy <= 30
    is showing the red color position. so when i press square in that place, it will change black pixels to red so then i can unhold R trigger and square and press Cross and move arround with red color .

    Can anyone help me with this one ?
    Geändert von natan333 (04-28-2006 um 08:26 PM Uhr)

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

    Thanks everybody for helping me! What I did to fix the code was I used the Image.createEmpty instead of loading the image. Then I put the 0 in counter:reset(0). Now it works like I want it to. Thanks!

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

    Zitat Zitat von Grimfate126
    here: try this:


    Code:
    red = Color.new(255,0,0)
    green = Color.new(0,255,0)
    blue = Color.new(0,0,255)
    white = Color.new(255,255,255)
    
    duhx = 50
    duhy = 50
    
    duh = Image.load("duh.png")
    counter = Timer.new()
    
    while true do
    
    screen:clear(blue)
    
    pad = Controls.read()
    
    screen:blit(duhx,duhy,duh)
    
    if pad:up() then
    duhy = duhy - 2
    end
    
    if pad:down() then
    duhy = duhy + 2
    end
    
    if pad:right() then
    duhx = duhx + 2
    end
    
    if pad:left() then
    duhx = duhx - 2
    end
    
    currentTime = counter:time()
    screen:print(10,10,"Counter Time: " .. currentTime, white)
    
    if currentTime > 2500 and currentTime < 5000 then
    screen:clear(red)
    end
    
    if currentTime > 5001 then
    counter:reset()
    counter:start()
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    problems in your original code:

    1.whenever you print OR blit something to the screen: it MUST be done inside a function, or a loop. you blitted "duh" in neither, so it appeared for only a bit, and then cleared.

    2. at the end of your loop, you stated screen:clear(blue), and then printed the time. when you cleared, you ALSO cleared the picture, so it only showed you the time.

    3. you did not give duhx and duhy a value. how is luaplayer supposed to know?

    4. you did not end your loop.

    5. there were more, but im too lazy right now.

    bb! and good luck!

    EDIT: @ EminentJonFrost, you DO NOT need spaces between your ='s, <'s, or >',s. although they do make your code easier to read.
    Uhm it wasn't me who needed help. I was just saying that what he wrote will just display currentTime.


 

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 .