Seite 4 von 342 ErsteErste 1 2 3 4 5 6 7 8 9 10 11 12 13 14 54 104 ... LetzteLetzte
Zeige Ergebnis 91 bis 120 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; .................

  
  1. #91
    QJ Gamer Blue
    Points: 4.648, Level: 43
    Level completed: 49%, Points required for next Level: 102
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    In your garage
    Beiträge
    73
    Points
    4.648
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    ..............


    Geändert von Bilo (10-05-2005 um 03:38 PM Uhr)

  2. #92
    Developer
    Points: 8.545, Level: 62
    Level completed: 32%, Points required for next Level: 205
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Beiträge
    472
    Points
    8.545
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    I am sorry to say that this one doent even display the text... i have noticed in whitehawks tutorial that he did it, so i am going to try and recreate that effect.

    PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
    http://www.cools.biaklan.com
    Currently Working on ?????

    Quote of the Week

  3. #93
    QJ Gamer Blue
    Points: 4.648, Level: 43
    Level completed: 49%, Points required for next Level: 102
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    In your garage
    Beiträge
    73
    Points
    4.648
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    board = Image.load("boardnew.png")
    screen:blit(0, 0, board, false)
    black = Color.new(0, 0, 0)
    screen:print(200, 130, "Board", black)
    screen.flip()
    while true do
    screen.waitVblankStart()
    
    end
    Sorry, I hadnt even tried what I told you to do. The above WILL work. I tested it :)


    My excuse is that I'm not well. And so thats why what I told you to do was wrong
    Geändert von Bilo (10-05-2005 um 03:48 PM Uhr)

  4. #94
    Developer
    Points: 8.545, Level: 62
    Level completed: 32%, Points required for next Level: 205
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Beiträge
    472
    Points
    8.545
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Thanks! It works perfectly! :icon_smil
    Geändert von cools (10-05-2005 um 04:42 PM Uhr)

    PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
    http://www.cools.biaklan.com
    Currently Working on ?????

    Quote of the Week

  5. #95
    QJ Gamer Green
    Points: 5.337, Level: 46
    Level completed: 94%, Points required for next Level: 13
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    52
    Points
    5.337
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    I've commeted your program to help you find out why it was doing what it was doing..
    Zitat Zitat von cools
    well more troubles sadly

    Lua will only load the first part of my script, which displays text... It wont load any thing after that.

    Code:
    black = Color.new(0, 0, 0)
    screen:print(200, 130, "Board", black)
    screen.flip()
    while true do              -- your program hangs here
    screen.waitVblankStart()  -- because this is going to loop
    end                      -- forever since true is always true
    
    board = Image.load("boardnew.png")
    screen:blit(0, 0, board, false) -- putting the picture over your text is going to erase the text. Maybe print the board first, then the text
    screen:flip()
    while true do
    screen:waitVblankStart()
    end

  6. #96
    Developer
    Points: 8.545, Level: 62
    Level completed: 32%, Points required for next Level: 205
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Beiträge
    472
    Points
    8.545
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Thanks Jenay. Hopefully this will not happen again!

    PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
    http://www.cools.biaklan.com
    Currently Working on ?????

    Quote of the Week

  7. #97
    QJ Gamer Blue
    Points: 4.648, Level: 43
    Level completed: 49%, Points required for next Level: 102
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    In your garage
    Beiträge
    73
    Points
    4.648
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von cools
    Thanks! It works perfectly! :icon_smil




    No problem :)

  8. #98
    NDS Mod
    Points: 18.386, Level: 86
    Level completed: 8%, Points required for next Level: 464
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    w00+land
    Beiträge
    645
    Points
    18.386
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Dremth
    How can I make something where the user enters text? Like on the PSP when you click on a text box the dialog comes up that has the letters and numbers like on a cell phone. Is there a way to get that?

    PLEASE PLEASE PLEASE EMAIL ME!!!!!!
    [email protected]
    Wow that took me a while...
    Ok put keyboard.lua (rename it to that) in the same file as your main code.
    Then put this in your main code:
    Code:
    dofile("keyboard.lua")
    When you want define a variable or print something you can define the variable or what it's printing as keyboard()
    Code:
    -- Examples
    print(keyboard())
    thetext = keyboard()
    This will allow you to input what it is going to register the value as.

    =================
    Start - Enter Value
    D-pad - select key
    R - Space
    L - Delete
    Select - Like holding down shift
    Control pad - Press the button corresponding with the character on the selected key
    ================

    I've tested it and it seems to work on luaplayer v9 but not v11
    Angehängte Dateien Angehängte Dateien
    Geändert von MagicianFB (10-05-2005 um 05:18 PM Uhr)
    "15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
    [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]

  9. #99
    Points: 4.399, Level: 42
    Level completed: 25%, Points required for next Level: 151
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    3
    Points
    4.399
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    I'm having a bit of trouble with the Timer function.

    Using this as code:

    Code:
    Timer = Timer.new(0)
    I get:

    Code:
    error: DEFUSE.LUA:27: attempt to index global 'Timer' (a nil value)
    Error: No script file found.
    
    Press start to restart
    Thanks in advance for any help.

  10. #100
    NDS Mod
    Points: 18.386, Level: 86
    Level completed: 8%, Points required for next Level: 464
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    w00+land
    Beiträge
    645
    Points
    18.386
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von goldnetx
    I'm having a bit of trouble with the Timer function.

    Using this as code:

    Code:
    Timer = Timer.new(0)
    I get:

    Code:
    error: DEFUSE.LUA:27: attempt to index global 'Timer' (a nil value)
    Error: No script file found.
    
    Press start to restart
    Thanks in advance for any help.
    It's Timer:new(0)
    You have to use a colon.
    "15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
    [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]

  11. #101
    Points: 4.399, Level: 42
    Level completed: 25%, Points required for next Level: 151
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    3
    Points
    4.399
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Hm...I've got the timer now working, but I'm having another problem with it.

    If I run the program once it works fine, but once I try and run it a second time I get this error:

    Code:
    error: DEFUSE.LUA:152: loop in gettable
    Error: No script file found.
    
    Press start to restart
    The code I have at Line 152 is this:

    Code:
    Timer:start()

  12. #102
    QJ Gamer Blue
    Points: 5.446, Level: 47
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    330
    Points
    5.446
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    MagicianFB, can you tell a little about your rpg? Are you just using screen sized backgrounds or can you do the scrolling bg most rpgs have?
    I'm interested in doing an rpg myself, and since there seems to be no rpg maker in site for psp, I'm learning lua now. It'd be nice to hear a little about your project so I have a general idea of how to get started.
    Also, this may be a little advanced, but would there be a way to display some sort of fmv? I'm not expecting to be able to do a Final Fantasy or something as my very first project, but it seems like with the psp's power it shouldn't be a problem to have decent looking backgrounds and even a movie or two, right? Is there maybe a way for your lua script to make calls to the psp firmware functions? Like to use the psp's built in mp4 or mp3 playback? Or is that something that would need to be built into the actual lua player?
    Geändert von Snaku (10-06-2005 um 06:59 AM Uhr)

  13. #103
    QJ Gamer Blue
    Points: 4.995, Level: 45
    Level completed: 23%, Points required for next Level: 155
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    122
    Points
    4.995
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Can u make lua loop this kind of code?
    Code:
    pad = Controls.read()
    
    	if pad:circle() then
    		screen:blit(0, 0, lua, false)
    		screen:print(220, 170, "Fel", svart)
    		screen:print(220, 190, "Triangel: Tillbaka", svart)
    		screen:print(220, 210, "[]: Avsluta", svart)
    		screen.flip()
    	
    		while true do
    		
    		jag = Controls.read()
    		
    		if jag:triangle() then
    			screen:blit(0, 0, lua, false)
    			screen:print(220, 170, "Hejsan", svart)
    			screen:print(220, 190, "O: Nåt trevligt", svart)
    			screen:print(220, 200, "X: Info", svart)
    			screen:print(220, 210, "[]: Avsluta", svart)
    			screen.flip()
    		end
    		end

  14. #104
    NDS Mod
    Points: 18.386, Level: 86
    Level completed: 8%, Points required for next Level: 464
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    w00+land
    Beiträge
    645
    Points
    18.386
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Just put a while true loop around the entire thing, too
    Zitat Zitat von lingon
    Can u make lua loop this kind of code?.
    Code:
    pad = Controls.read()
    
    	if pad:circle() then
    		screen:blit(0, 0, lua, false)
    		screen:print(220, 170, "Fel", svart)
    		screen:print(220, 190, "Triangel: Tillbaka", svart)
    		screen:print(220, 210, "[]: Avsluta", svart)
    		screen.flip()
    	
    		while true do
    		
    		jag = Controls.read()
    		
    		if jag:triangle() then
    			screen:blit(0, 0, lua, false)
    			screen:print(220, 170, "Hejsan", svart)
    			screen:print(220, 190, "O: Nåt trevligt", svart)
    			screen:print(220, 200, "X: Info", svart)
    			screen:print(220, 210, "[]: Avsluta", svart)
    			screen.flip()
    		end
    		end
    I'm posting from school
    "15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
    [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]

  15. #105
    QJ Gamer Blue
    Points: 4.995, Level: 45
    Level completed: 23%, Points required for next Level: 155
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    122
    Points
    4.995
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Okay, thanks alot.

  16. #106
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Does anyone know how I can change a number to the numer-1 or +1 with the triggers (or any button) like in PSP Soduko?? So if I program a button to insert a 5 or any numer in 1, 1, then how can i change the 5 to go +1 each time I press the right trigger?

  17. #107
    QJ Gamer Green
    Points: 5.337, Level: 46
    Level completed: 94%, Points required for next Level: 13
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    52
    Points
    5.337
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    if pad:r() then
       if var >= 5 then
          var = var + 1
       else
          var = 5
       end -- if
    end -- if
    something like this?

  18. #108
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Jenay
    Code:
    if pad:r() then
       if var >= 5 then
          var = var + 1
       else
          var = 5
       end -- if
    end -- if
    something like this?
    I only get this error when I use your code: "attempt to comprare number with nil"

  19. #109
    Points: 4.421, Level: 42
    Level completed: 36%, Points required for next Level: 129
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    6
    Points
    4.421
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    hi im new to the whole modding a psp thing... im from england and just downgraded my firmware and started to learna bit of lua

    heres the code of my first program (after that tutorial):

    System.usbDiskModeActivat e()

    cursor = Image.load("cursor.png")

    x = 200
    y = 140

    screen.waitVblankStart()

    while true do

    pad = Controls.read()


    if pad:analogX() < -30
    then x = x - 1 end

    if pad:analogx() > 30
    then x = x + 1 end

    if pad:analogy() < -30
    then y = y - 1 end

    if pad:analogy() > 30
    then y = y + 1 end

    if pad:start()
    then break end

    screen:blit(x, y, cursor)
    screen.flip()


    end
    im not sure if its going the right way to making a cursor move on the screen, ive had experience with java and things but all i get is an error that reads:

    error: SCRIPT2.LUA18 loop in gettable
    help will be appreciated :Jump:

  20. #110
    QJ Gamer Blue
    Points: 4.995, Level: 45
    Level completed: 23%, Points required for next Level: 155
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    122
    Points
    4.995
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Maybe it has something to do with this
    Code:
    if pad:analogy() < -30 --I think you should have a big Y here instead of  a small one
    then y = y - 1 end
    
    if pad:analogy() > 30
    then y = y + 1 end
    I'm not sure though. Try it out and see what happens =)

  21. #111
    NDS Mod
    Points: 18.386, Level: 86
    Level completed: 8%, Points required for next Level: 464
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    w00+land
    Beiträge
    645
    Points
    18.386
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von lingon
    Maybe it has something to do with this
    Code:
    if pad:analogy() < -30 --I think you should have a big Y here instead of  a small one
    then y = y - 1 end
    
    if pad:analogy() > 30
    then y = y + 1 end
    I'm not sure though. Try it out and see what happens =)
    Yeah, I've never programmed using the analog stick, but I think you're right. It has to be analogX and analogY rather that analogx and analogy.

    Edit: It make me sorta happy that this thread has lasted so long without being stickied.
    "15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
    [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]

  22. #112
    Points: 4.421, Level: 42
    Level completed: 36%, Points required for next Level: 129
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    6
    Points
    4.421
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    ah... you were both right... lol capitilization errors.... always the way

    thanks

  23. #113
    Developer
    Points: 8.545, Level: 62
    Level completed: 32%, Points required for next Level: 205
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Beiträge
    472
    Points
    8.545
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Im having some trouble creating dice. I just want to show the random number in a spot, then get rid of it, but i keep getting an error.

    Code:
    while true do
    pad  = Controls.read()
    dice2 = math.random(6)
    if pad:cross() then
    if dice2==1
    then screen:print(90, 50, "1", black)
    screen.flip()
    if dice2==2
    then screen:print(90, 50, "2", black)
    screen.flip()
    if dice2==3
    then screen:print(90, 50, "3", black)
    screen.flip()
    if dice2==4
    then screen:print(90, 50, "4", black)
    screen.flip()
    if dice2==5
    then screen:print(90, 50, "5", black)
    screen.flip()
    if dice2==6
    then screen:print(90, 50, "6", black)
    screen.flip()
    screen.waitVblankStart()
    end
    end

    PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
    http://www.cools.biaklan.com
    Currently Working on ?????

    Quote of the Week

  24. #114
    Developer
    Points: 8.360, Level: 61
    Level completed: 70%, Points required for next Level: 90
    Overall activity: 16,0%

    Registriert seit
    Jun 2005
    Ort
    At my house...
    Beiträge
    886
    Points
    8.360
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von cools
    Im having some trouble creating dice. I just want to show the random number in a spot, then get rid of it, but i keep getting an error.

    Code:
    while true do
    pad  = Controls.read()
    dice2 = math.random(6)
    if pad:cross() then
    if dice2==1
    then screen:print(90, 50, "1", black)
    screen.flip()
    if dice2==2
    then screen:print(90, 50, "2", black)
    screen.flip()
    if dice2==3
    then screen:print(90, 50, "3", black)
    screen.flip()
    if dice2==4
    then screen:print(90, 50, "4", black)
    screen.flip()
    if dice2==5
    then screen:print(90, 50, "5", black)
    screen.flip()
    if dice2==6
    then screen:print(90, 50, "6", black)
    screen.flip()
    screen.waitVblankStart()
    end
    end
    Use elseif statements.
    Geändert von Twenty 2 (10-06-2005 um 02:36 PM Uhr)
    F.A.L.O?

  25. #115
    Points: 4.421, Level: 42
    Level completed: 36%, Points required for next Level: 129
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    6
    Points
    4.421
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    can anybody tell me how to set transparency colour for the pngs, e.g i want to make the edges of a cursor transparent

    thanks

  26. #116
    Developer
    Points: 8.360, Level: 61
    Level completed: 70%, Points required for next Level: 90
    Overall activity: 16,0%

    Registriert seit
    Jun 2005
    Ort
    At my house...
    Beiträge
    886
    Points
    8.360
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    If you use fireworks then you set the canvas to transparent and draw on to it.
    F.A.L.O?

  27. #117
    QJ Gamer Green
    Points: 5.337, Level: 46
    Level completed: 94%, Points required for next Level: 13
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    52
    Points
    5.337
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SodR
    I only get this error when I use your code: "attempt to comprare number with nil"
    put:
    var = 0

    at the begining of your code.

  28. #118
    QJ Gamer Green
    Points: 5.337, Level: 46
    Level completed: 94%, Points required for next Level: 13
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    52
    Points
    5.337
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von cools
    Im having some trouble creating dice. I just want to show the random number in a spot, then get rid of it, but i keep getting an error.
    Code:
    while true do
    pad  = Controls.read()
    dice2 = math.random(6)
    if pad:cross() then
    screen:print(90, 50,string.format("%d", dice2), black)
    screen.flip()
    screen.waitVblankStart()
    end
    end
    try something like this.

  29. #119
    Developer
    Points: 8.360, Level: 61
    Level completed: 70%, Points required for next Level: 90
    Overall activity: 16,0%

    Registriert seit
    Jun 2005
    Ort
    At my house...
    Beiträge
    886
    Points
    8.360
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    You might actually want to try
    Code:
    blue = Color.new(0, 0, 225)
    while true do
    pad  = Controls.read()
    dice2 = math.random(6)
    if pad:cross() then
    screen:clear()
    screen:print(90, 50,string.format("%d", dice2), blue)
    screen.flip()
    screen.waitVblankStart()
    end
    end
    I changed the color so you could actualy see the number and I added a screen clear so that it doesnt print over it self so you cant read it.
    F.A.L.O?

  30. #120
    QJ Gamer Blue
    Points: 4.784, Level: 44
    Level completed: 17%, Points required for next Level: 166
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    100
    Points
    4.784
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Can lua load .mp3 files?


 
Seite 4 von 342 ErsteErste 1 2 3 4 5 6 7 8 9 10 11 12 13 14 54 104 ... LetzteLetzte

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

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