Seite 53 von 342 ErsteErste ... 3 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 103 153 ... LetzteLetzte
Zeige Ergebnis 1.561 bis 1.590 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; no prob man...

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

    no prob man


    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  2. #1562
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Would this work?
    Code:
    time = Timer:new()
    score = 0
    
    while true do 
    
    if time = time + 1 then
    score = score + 5
    end
    (i just wrote that)

    --XBL Gamertag: PhenoM904--

  3. #1563
    OMFG
    Points: 19.453, Level: 88
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Toronto
    Beiträge
    2.814
    Points
    19.453
    Level
    88
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von MaSt3r_ShAk3
    Would this work?
    Code:
    time = Timer:new()
    score = 0
    
    while true do 
    
    if time = time + 1 then
    score = score + 5
    end
    (i just wrote that)
    nope that won't work. if I knew sorta what you were trying to accomplish I can try and help.

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

    i dont think so because the timer is in miliseconds and the highest framerate is 60 fps so then time is never time+1 but more. you can also just use time as a variable and increment it by 1 each time it goes through the loop.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  5. #1565
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Slasher
    nope that won't work. if I knew sorta what you were trying to accomplish I can try and help.
    I want it that every half second the score increases by 5

    @altair- how would I do that? just put score = score + 1 at the bottom of the loop?

    --XBL Gamertag: PhenoM904--

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

    This would work:
    Code:
    when true do
    
    if time/1000=timeold/1000 +1 then
    score = score + 5
    end
    
    "more code here"
    
    timeold=time
    end
    Notice: Put "timeold=time" at the end of the loop
    BTW Maybe you need to make it like this:
    Code:
    if time/1000>=timeold/1000 +1 then
    Because the loop is probably not precisely 1 second or a multiple of that. This wont affect the rest of the game because the timer will keep running so you still get 5 points per second. Hope thats clear

    NVM the var-thing I didn't know you wanted to do that after each second
    Geändert von Altair (04-15-2006 um 07:28 AM Uhr)
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  7. #1567
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Ok.. would i do time = timer:new() before the loop? or store a nil value in time

    --XBL Gamertag: PhenoM904--

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

    yeah time = timer:new() before the loop. Also you should start the timer at the beginning of the game. SO maybe something like this:
    Code:
    if start==false then
    time:start()
    start==true
    end
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  9. #1569
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    I get, Error: attempt to index global 'timer' (a nil value)...

    --XBL Gamertag: PhenoM904--

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

    ok i forgot i just used your code but its like this:
    time=Timer.new()
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  11. #1571
    Jesus loves me more.
    Points: 11.452, Level: 70
    Level completed: 51%, Points required for next Level: 198
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Illegal Abric Sites
    Beiträge
    1.551
    Points
    11.452
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    i got this error whats rong?
    C:\Documents and Settings\Mori\Desktop\lua \luaplayerwindows>luaplay er rock.lua
    error: rock.lua:41: Argument error: The Controls functions take no arguments (an
    d also, must be called with a colon from an instance: e g mycontrols:left().


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

    show the rest of your code and atleast line 41
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  13. #1573
    Jesus loves me more.
    Points: 11.452, Level: 70
    Level completed: 51%, Points required for next Level: 198
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Illegal Abric Sites
    Beiträge
    1.551
    Points
    11.452
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    its the one you helped me w/


  14. #1574
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    wtf??? this is annoying "error: Calling 'new' on bad self (number expected, got table)" its reffering to the time = Timer:new()

    --XBL Gamertag: PhenoM904--

  15. #1575
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    ah, ill hold off on score til the 2nd release

    --XBL Gamertag: PhenoM904--

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

    did you read my last post on that? Its on the bottom of the page before this.
    I sain it should be:
    time=Timer.new()
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  17. #1577
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Yeah... I still got errors But I realized I do need it to increase speed every 10 seconds...
    Code:
    Error: Calling 'new' on bad self (number expected, got table)
    its referring to the time = Timer:new()
    Geändert von Mast3r_Shak3 (04-15-2006 um 08:34 AM Uhr)

    --XBL Gamertag: PhenoM904--

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

    its time=Timer.new() NOT time = Timer:new() note the point instead of the double colon
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  19. #1579
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Ah, lemme try it out...

    Error: Attempt to perform arithmetic on global 'time' (a userdata value)

    --XBL Gamertag: PhenoM904--

  20. #1580
    Jesus loves me more.
    Points: 11.452, Level: 70
    Level completed: 51%, Points required for next Level: 198
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Illegal Abric Sites
    Beiträge
    1.551
    Points
    11.452
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    i cant get a pause to work... what i would like is for ex

    screenrint(10, 20, "BLALALALAL" color1)
    -- Have it pause for x amount of time then play the next line


  21. #1581
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    You have to add a screen.waitVblankStart() and put your delay in the (). Keep in mind 60 will have a 1 second delay

    --XBL Gamertag: PhenoM904--

  22. #1582
    Jesus loves me more.
    Points: 11.452, Level: 70
    Level completed: 51%, Points required for next Level: 198
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Illegal Abric Sites
    Beiträge
    1.551
    Points
    11.452
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    that is what did but it seems to add up all the time and have ya wait in the begining


  23. #1583
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Do you want the same interval between each string?

    --XBL Gamertag: PhenoM904--

  24. #1584
    Jesus loves me more.
    Points: 11.452, Level: 70
    Level completed: 51%, Points required for next Level: 198
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Illegal Abric Sites
    Beiträge
    1.551
    Points
    11.452
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    nope could that be why?


  25. #1585
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Well, if you wanted different intervals you would be putting screen.waitVblankStart() after every string. Then putting screen.flip() at the end... post ur code

    --XBL Gamertag: PhenoM904--

  26. #1586
    Jesus loves me more.
    Points: 11.452, Level: 70
    Level completed: 51%, Points required for next Level: 198
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Illegal Abric Sites
    Beiträge
    1.551
    Points
    11.452
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    k here it is:
    ----joke
    white= Color.new(225,225,225)
    brick=Image.load("Smile.p ng")
    ------ end load
    screen.flip()
    screenrint(10, 10, "Opening Flash0", white)
    screen.waitVblankStart(12 0)
    screenrint(10, 20, "Cant Open... Starting Brute Force", white)
    screen.waitVblankStart(12 0)
    screenrint(10, 25, "jfklafdjoaiudfjkfdajklfd afdjlkadfkl", white)
    screen.waitVblankStart(10 )
    screenrint(10, 35, "980341809314789312489132 748913298478913", white)
    screen.waitVblankStart(10 )
    screenrint(10, 40, "324902023423043204023490 234023943204932", white)
    screen.waitVblankStart(5)
    screenrint(10, 50, "Flash0 Open.. Shuting Down will cuas a brick.", white)
    screen.waitVblankStart(20 )
    screenrint(10, 60, "Flash0:/vsh is being delited", white)
    screen.waitVblankStart(60 )
    screenrint(10, 70, "There you Go Pricked PSP", white)
    screen.waitVblankStart(5)
    screenrint(10, 80, "Enjoy By-By now", white)
    screen.waitVblankStart(30 )
    screen.flip()


  27. #1587
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    ----joke
    white= Color.new(225,225,225)
    brick=Image.load("Smile.png")
    ------ end load
    
    while true do
    
    screen:print(10, 10, "Opening Flash0", white)
    screen.waitVblankStart(120)
    screen.flip()
    
    screen:print(10, 20, "Cant Open... Starting Brute Force", white)
    screen.waitVblankStart(120)
    screen.flip()
    
    screen:print(10, 25, "jfklafdjoaiudfjkfdajklfda fdjlkadfkl", white)
    screen.waitVblankStart(10)
    screen.flip()
    
    screen:print(10, 35, "9803418093147893124891327 48913298478913", white)
    screen.waitVblankStart(10)
    screen.flip()
    
    screen:print(10, 40, "3249020234230432040234902 34023943204932", white)
    screen.waitVblankStart(5)
    screen.flip()
    
    screen:print(10, 50, "Flash0 Open.. Shuting Down will cuas a brick.", white)
    screen.waitVblankStart(20)
    screen.flip()
    
    screen:print(10, 60, "Flash0:/vsh is being delited", white)
    screen.waitVblankStart(60)
    screen.flip()
    
    screen:print(10, 70, "There you Go Bricked PSP", white)
    screen.waitVblankStart(5)
    screen.flip()
    
    screen:print(10, 80, "Enjoy By-By now", white)
    screen.waitVblankStart(30)
    screen.flip()
    
    end
    try that...

    --XBL Gamertag: PhenoM904--

  28. #1588
    Jesus loves me more.
    Points: 11.452, Level: 70
    Level completed: 51%, Points required for next Level: 198
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Illegal Abric Sites
    Beiträge
    1.551
    Points
    11.452
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    no error it just does not show any thing


  29. #1589
    Is in your zone.
    Points: 24.342, Level: 94
    Level completed: 99%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Jacksonville, FL
    Beiträge
    3.429
    Points
    24.342
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    What?? That doesnt make sense...

    --XBL Gamertag: PhenoM904--

  30. #1590
    Jesus loves me more.
    Points: 11.452, Level: 70
    Level completed: 51%, Points required for next Level: 198
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Illegal Abric Sites
    Beiträge
    1.551
    Points
    11.452
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    there is no text on the psp it did not print to screen



 

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

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