Seite 24 von 342 ErsteErste ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 74 124 ... LetzteLetzte
Zeige Ergebnis 691 bis 720 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; player:width Do you really mean player.width? That for b loop is kind of useless. You're blitting the screen and then ...

  
  1. #691
    QJ Gamer Green
    Points: 5.382, Level: 47
    Level completed: 16%, Points required for next Level: 168
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    508
    Points
    5.382
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    player:width
    Do you really mean player.width?

    That for b loop is kind of useless.

    You're blitting the screen and then clearing it. You're essentially doing nothing to the screen. ???



  2. #692
    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

    Im not sure. I based that part off of PSPMillionaire's tutorials. I'll try it later though. (Doing homework right now, or at least im supposed to ;) )
    Geändert von Mast3r_Shak3 (03-13-2006 um 02:32 PM Uhr)

    --XBL Gamertag: PhenoM904--

  3. #693
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Altair, i get the error on line 314 whidch is thise line

    Code:
    	if write==1 then
    		loadHighscore()
    		if high<score then
    			high=score
    			saveHighscore()
    			write=2
    		end
    	end
    also I'm pretty sure the error is only in the loadhighscore function because earlier I had called the function at the start and then had it print the highscore(so you knew what u had to beat) and it gave me the error that it cant display nil.

  4. #694
    6201ymereJ
    Points: 7.062, Level: 55
    Level completed: 56%, Points required for next Level: 88
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Baltimore
    Beiträge
    588
    Points
    7.062
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    	if write==1 then
    		loadHighscore()
    		if high<score then
    			high == score
    			saveHighscore()
    			write=2
    		end
    	end

  5. #695
    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

    Can anyone recommend (and link if possible) a good text editor?

    --XBL Gamertag: PhenoM904--

  6. #696
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Jeremy1026
    Code:
    	if write==1 then
    		loadHighscore()
    		if high<score then
    			high == score
    			saveHighscore()
    			write=2
    		end
    	end
    that wotn work because im not comparing the high variable and score variable right there. im assigning the high variable the value of the score variable because the save function saves the high variables

  7. #697
    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, but with that. You are reassigning the high variable. Even though thats not how you would do it normally, I would give it a try

    --XBL Gamertag: PhenoM904--

  8. #698
    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 MaSt3r_ShAk3
    Im not sure. I based that part off of PSPMillionaire's tutorials. I'll try it later though. (Doing homework right now, or at least im supposed to ;) )
    Code:
    player:width()
    will get the width of the image "player"

    of course normally i would do something like

    Code:
    player.width = player:width()
    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/

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

    Hmm... But can anyone help me out with that error? My code is on the page before this. (And the reason that segment of code is there is to prevent the character from going offscreen when I move him)

    --XBL Gamertag: PhenoM904--

  10. #700
    Quality Haxing Since 1991
    Points: 29.255, Level: 99
    Level completed: 55%, Points required for next Level: 745
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Pennsylvania, USA Fi
    Beiträge
    6.206
    Points
    29.255
    Level
    99
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von MaSt3r_ShAk3
    Can anyone recommend (and link if possible) a good text editor?
    Check the first PSPMillionaire tutorial. It has a great highlighter for Context programmer's editor. I love it.
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  11. #701
    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

    Hmm... But can anyone help me out with that error? My code is on the page before this. (And the reason that segment of code is there is to prevent the character from going offscreen when I move him)
    player:width should be player:width() :P
    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/

  12. #702
    Simon Champion!
    Points: 11.489, Level: 70
    Level completed: 60%, Points required for next Level: 161
    Overall activity: 99,0%

    Registriert seit
    Mar 2006
    Ort
    Calgary, Alberta, Ca
    Beiträge
    537
    Points
    11.489
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    hey guys! How do you make a picture overlap another picture? I have a normal picture and when you press a button the old picture is supposed to dissapear and a new one come. help please!

  13. #703
    Quality Haxing Since 1991
    Points: 29.255, Level: 99
    Level completed: 55%, Points required for next Level: 745
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Pennsylvania, USA Fi
    Beiträge
    6.206
    Points
    29.255
    Level
    99
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    black=Color.new(0, 0, 0)
    
    player={}
    player[1]={x=240, y=250}
    
    screenwidth=480 - player:width()
    
    while true do
    
    screen:blit(0, 0, background, false)
    screen:blit(player[1].x,player[1].y,player)
    
    for a=0,10 do
    screen:blit(45*a, 45*b, spike)
    end
    for b=0,0 do
    screen:blit(45*a, 45*b, spike)
    end
    
    pad = Controls.read()
    screen:clear()
    
    if pad:left() then
    player[1].x = player.x - 2
    end
    if pad:right() then
    player[1].x = player.x + 2
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    Try that.
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



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

    make some variables at the beginning of your program to store the images.

    myImage = Image.load("yeahyeah.png" )
    newImage = Image.load("newimage.png" )

    in your code for your x button use something like

    if pad:cross() then myImage = newImage end

    make sure your blitting command is outside of the pad:cross() statement

    ex... screen:blit(100,100,myIma ge)
    Geändert von PSPMillionaire (03-13-2006 um 03:56 PM Uhr)
    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/

  15. #705
    Quality Haxing Since 1991
    Points: 29.255, Level: 99
    Level completed: 55%, Points required for next Level: 745
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Pennsylvania, USA Fi
    Beiträge
    6.206
    Points
    29.255
    Level
    99
    Downloads
    0
    Uploads
    0

    Standard

    I think he did in his loading screen scipt, otherwise where would "player" come from in the second screen:blit? Either that or there is some made up image loading names going around here.
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  16. #706
    Simon Champion!
    Points: 11.489, Level: 70
    Level completed: 60%, Points required for next Level: 161
    Overall activity: 99,0%

    Registriert seit
    Mar 2006
    Ort
    Calgary, Alberta, Ca
    Beiträge
    537
    Points
    11.489
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSPMillionaire
    make some variables at the beginning of your program to store the images.

    myImage = Image.load("yeahyeah.png" )
    newImage = Image.load("newimage.png" )

    in your code for your x button use something like

    if pad:cross() then myImage = newImage end

    make sure your blitting command is outside of the pad:cross() statement

    ex... screen:blit(100,100,myIma ge)
    thanks but I ran into a problem. When I run it and press the button, the top of the old image flickers at the top of the new image. Help please! Oh and how do you make it so the old image reappears when you let go of the button?
    Geändert von Greenskull (03-13-2006 um 04:20 PM Uhr)

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

    to make it reappear put your blit command inside your pad:cross statement
    could make these variables at the top of your code, or use the last, i forgot them lol..

    imageOne = Image.load("whatever.png" )
    imageTwo = Image.load("whatever.png" )

    then your pad:cross() could look like so..

    if pad:cross() then
    screen:blit(100,100,image One)
    else
    screen:blit(100,100,image Two)
    end

    make sure you use screen:clear() in your while true do loop, right after it starts is a good place.
    Geändert von PSPMillionaire (03-13-2006 um 04:26 PM Uhr)
    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/

  18. #708
    Simon Champion!
    Points: 11.489, Level: 70
    Level completed: 60%, Points required for next Level: 161
    Overall activity: 99,0%

    Registriert seit
    Mar 2006
    Ort
    Calgary, Alberta, Ca
    Beiträge
    537
    Points
    11.489
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSPMillionaire
    to make it reappear put your blit command inside your pad:cross statement
    could make these variables at the top of your code, or use the last, i forgot them lol..

    imageOne = Image.load("whatever.png" )
    imageTwo = Image.load("whatever.png" )

    then your pad:cross() could look like so..

    if pad:cross() then
    screen:blit(100,100,image One)
    else
    screen:blit(100,100,image Two)
    end

    make sure you use screen:clear() in your while true do loop, right after it starts is a good place.
    sorry I'm just learning to code. I need to put a while true statement? Can you show me waht you mean please?

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

    however your programming is looping, put the screen:clear() in the loop.
    paste your code if you want, and still dont understand
    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/

  20. #710
    Simon Champion!
    Points: 11.489, Level: 70
    Level completed: 60%, Points required for next Level: 161
    Overall activity: 99,0%

    Registriert seit
    Mar 2006
    Ort
    Calgary, Alberta, Ca
    Beiträge
    537
    Points
    11.489
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSPMillionaire
    however your programming is looping, put the screen:clear() in the loop.
    paste your code if you want, and still dont understand
    mind if I PM it to you? I don't want anyone stealing my idea...

  21. #711
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von MaSt3r_ShAk3
    Yeah, but with that. You are reassigning the high variable. Even though thats not how you would do it normally, I would give it a try
    I know but thats what i want it to do. in my save funtion it saves the variable high. so if i didnt assign high the value of score to it it would save the same score as before. also you cant use == when its not part of a condition. so when i put that in it gives me an error telling me it wanted a = instead of a ==

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

    Hmm... I successfully got the error to go away! Now I get the error "Attempt to call method "width" a nil value. Do I need to assign a direct value to "screen:width" intead of "480-player:width"?

    --XBL Gamertag: PhenoM904--

  23. #713
    Quality Haxing Since 1991
    Points: 29.255, Level: 99
    Level completed: 55%, Points required for next Level: 745
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Pennsylvania, USA Fi
    Beiträge
    6.206
    Points
    29.255
    Level
    99
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSPMillionaire
    player:width should be player:width() :P
    ^^^^^
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  24. #714
    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

    NEVERMIND

    and errors are evil

    --XBL Gamertag: PhenoM904--

  25. #715
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    i have a question=-)

    when using luaplayerwindows how do i get it to read images?
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  26. #716
    Simon Champion!
    Points: 11.489, Level: 70
    Level completed: 60%, Points required for next Level: 161
    Overall activity: 99,0%

    Registriert seit
    Mar 2006
    Ort
    Calgary, Alberta, Ca
    Beiträge
    537
    Points
    11.489
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever
    i have a question=-)

    when using luaplayerwindows how do i get it to read images?
    what do you mean "Read"?

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

    In ConTEXT editor, how do you use the lua.chl?

    EDIT: agh, nevermind I found out how... This coding stuff makes me all confused lol

    --XBL Gamertag: PhenoM904--

  28. #718
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    every time i use a script it always say: Image.load: Error loading image.

    so how do i get it to load the image?
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

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

    Post your script

    --XBL Gamertag: PhenoM904--

  30. #720
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    i just want it to read my pics thats all but if what i have in mind doesn't work then i well post it
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been


 

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 .