Seite 64 von 342 ErsteErste ... 14 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 114 164 ... LetzteLetzte
Zeige Ergebnis 1.891 bis 1.920 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; @ EminentJonFrost, you DO NOT need spaces between your ='s, <'s, or >',s. although they do make your code easier ...

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

    @ EminentJonFrost, you DO NOT need spaces between your ='s, <'s, or >',s. although they do make your code easier to read.
    oh, i thought it was only inside parantheses () that spaces didnt matter.


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

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

    I have absolutley no clue on how to do this.. but how do you make a scrolling background..

  3. #1893
    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
    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 =/
    Well, your problem is that the screenblit function does not return an integer/anything bresides the image to tell if its true or not after blitting. Therefore, we must make it return something. If i am not mistakin,, you want to display an image while R and the image color at the co-ordinates 3,0 are all true. well,i do not know if this is orrect, but does the luaplayer currently have the screen:blit function return anything? besides the image? But i dunno, So if the screen:blit function/prototype does return an integer, then u can do, if screen:blit(blahcX, blahY, blah)==1 then ... That is a guess, casue usually functions/prototypes return 1 for completion/a pointer to the newly created obect/memory allocated, or return NULL for an error.

    @montorb - A sidescrolling backround is nothng short of a simple backround, blitted usingthe co-ordsinates of a variabel you can change. Yet another mini-tut by SG57 lol:

    Code:
    SsBg = Image.load("side
    _scrolling_bg.png")
    bgX = 0
    bgY = 0
    bg2X = 479
    ScrollingSpeed = 5
    while true do 
    	screen:blit(bgX, bgY, SsBg)
    	screen:blit(bg2X, bgY, SsBg)
    	bgX=bgX+ScrollingSpeed
    	bg2X=bg2X+ScrollingSpeed
    	if bgX<-475 then
    		bgX=0
    		bg2X=479
    	end
    end
    Just a basic sidescrolling backround. There is a way to do this via either Lumo's tut, or using the offsets of the image to keep verlapping after off the screeen, but thats a little too advanced for new comers to understand So ya, all this is doing is blitting the backround 2 times, making there X Co-ordinates move via bgX and bg2X, and once bgX is almost offscreen, itll reset back to the start/right of the screen and keep going. Also, in C, you can declare your image's dimensions, and if the dimensions are too big, they just blit the image again until it fills those dimensions, so in C i use only have to blit my image once, use only 1 variable to change/move, etc.

    Hope this gives someone a basic un derstanding.

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


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

    Yes it's me again! I have had another problem. This time, I'm trying to code a game/useful tool to release, and I am having a problems. One, how would you print the result from a function? Like:

    function duh()
    [some code]
    end

    screenrint(x, y, "duh: " .. duh(), color)

    would that be it? Also, I am getting the error: script.lua:11: '=' expected near *
    that line of code is:

    function caf()
    r*r*3.14 < line #11
    end

    then later I want to:

    screenrint(x, y, "caf: " .. caf(), color)
    Is that the right way?

    If you get the kind of useful tool that I am trying to make, please don't steal it or post it.
    And no, I tryed it spacing the *'s out, but it still doesn't work.
    Thanks in advance!
    Geändert von PSPduh (04-29-2006 um 11:04 AM Uhr)

  5. #1895
    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
    Yes it's me again! I have had another problem. This time, I'm trying to code a game/useful tool to release, and I am having a problems. One, how would you print the result from a function? Like:

    function duh()
    [some code]
    end

    screenrint(x, y, "duh: " .. duh(), color)

    would that be it? Also, I am getting the error: script.lua:11: '=' expected near *
    that line of code is:

    function caf()
    r*r*3.14 < line #11
    end

    If you get the kind of useful tool that I am trying to make, please don't steal it or post it.
    And no, I tryed it spacing the *'s out, but it still doesn't work.
    Thanks in advance!
    you have to say

    something = r*r*3.14 -- the mathematical sentence equals 'something'

    i cant really tell what your app is by what your showing. but i think its a *a***l*t*r. (lol)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

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

    LOL. Sort of, but not really. How would I print that result out?

    function caf()
    x = r*r*3.14
    end

    then later...

    screenrint(x, y, "caf: " .. x, color)

    If i do that then it gives me an error of: attempt to concatenate global 'x' (a nil value) On line 48. That screenrint line is line 48.

    And also, how do I make something happen when a button is held down for a certain amount of time?
    Thanks again! (Once I release this, should be in a couple of days, I'll mention you, PSPmillionare, and whitehawk in the credits!)

  7. #1897
    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
    LOL. Sort of, but not really. How would I print that result out?

    function caf()
    x = r*r*3.14
    end

    then later...

    screenrint(x, y, "caf: " .. x, color)

    If i do that then it gives me an error of: attempt to concatenate global 'x' (a nil value) On line 48. That screenrint line is line 48.

    And also, how do I make something happen when a button is held down for a certain amount of time?
    Thanks again! (Once I release this, should be in a couple of days, I'll mention you, PSPmillionare, and whitehawk in the credits!)
    Code:
    screen:print(#, #, x, color) -- no parantheses, just 'x'
    thanks! (for the credit)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

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

    Ughhh, another problem...I got everything to load, the background and the r = 0 part, so now the screen is green and R = 0 appears, but when I press up, down, left, or right, it still stays the same:
    This is the whole code:

    Code:
    red = Color.new(255,0,0)
    yellow = Color.new(255, 255, 0)
    blue = Color.new(0, 0, 255)
    orange = Color.new(223, 88, 6)
    grey = Color.new(94, 97, 111)
    black = Color.new(0, 0, 0)
    white = Color.new(255, 255, 255)
    green = Color.new(0,255,0)
    
    r = 0
    
    function caf()
    x = r*r*3.14
    end
    
    while true do
    
    screen:clear(green)
    
    pad = Controls.read()
    oldpad = Controls.read()
    
    if pad:up() and oldpad:up() ~= pad:up() then
    r = r + 1
    end
    
    if pad:down() and oldpad:down() ~= pad:down() then
    r = r + 5
    end
    
    if pad:right() and oldpad:right() ~= pad:right() then
    r = r + 20
    end
    
    if pad:left() and oldpad:left() ~= pad:left() then
    r = r + 10
    end
    
    if r > 500 then
    r = 0
    end
    
    if pad:cross() then
    caf() 
    screen:print(50, 10, 'x', black)
    end
    
    
    screen:print(10,10,"R = " .. r, black)
    
    
    oldpad = pad
    
    screen.waitVblankStart()
    screen.flip()
    end
    Now you are probably guessing what it is, but I'll never say until its done. :icon_razz
    Thanks a bunch again!

  9. #1899
    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
    Ughhh, another problem...I got everything to load, the background and the r = 0 part, so now the screen is green and R = 0 appears, but when I press up, down, left, or right, it still stays the same:
    This is the whole code:

    Code:
    red = Color.new(255,0,0)
    yellow = Color.new(255, 255, 0)
    blue = Color.new(0, 0, 255)
    orange = Color.new(223, 88, 6)
    grey = Color.new(94, 97, 111)
    black = Color.new(0, 0, 0)
    white = Color.new(255, 255, 255)
    green = Color.new(0,255,0)
    
    r = 0
    
    function caf()
    x = r*r*3.14
    end
    
    while true do
    
    screen:clear(green)
    
    pad = Controls.read()
    oldpad = Controls.read()
    
    if pad:up() and oldpad:up() ~= pad:up() then
    r = r + 1
    end
    
    if pad:down() and oldpad:down() ~= pad:down() then
    r = r + 5
    end
    
    if pad:right() and oldpad:right() ~= pad:right() then
    r = r + 20
    end
    
    if pad:left() and oldpad:left() ~= pad:left() then
    r = r + 10
    end
    
    if r > 500 then
    r = 0
    end
    
    if pad:cross() then
    caf() 
    screen:print(50, 10, 'x', black)
    end
    
    
    screen:print(10,10,"R = " .. r, black)
    
    
    oldpad = pad
    
    screen.waitVblankStart()
    screen.flip()
    end
    Now you are probably guessing what it is, but I'll never say until its done. :icon_razz
    Thanks a bunch again!
    Try taking out the part that I put in bold letters.
    edit - oh, and you dont need these marks: ' '
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

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

    Now that I did, it works, but it goes up WAY to fast. That was the point of that oldpad. But now that its out, it works...Anyway to make it go slower without the oldpad, or a way to work it with the oldpad? Because besides that, my app does not have any other problems. Once that's worked out, then all I have to do is some more coding.
    It just printed x without the ' ' marks. That line works now; it is:
    screenrint(100, 100, 'caf = ' .. x, black)
    Thanks.

  11. #1901
    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
    Now that I did, it works, but it goes up WAY to fast. That was the point of that oldpad. But now that its out, it works...Anyway to make it go slower without the oldpad, or a way to work it with the oldpad? Because besides that, my app does not have any other problems. Once that's worked out, then all I have to do is some more coding.
    just before (in other words RIGHT ABOVE) the 'end' for each of your 'if' loops. put a "screen.waitVblankStart(5 )".

    put a small number in the parantheses, whichever you want. that should slow things down to how you want.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

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

    so it would look like this:

    Code:
    if pad:up() then
    r = r + 1
    screen.waitVblankStart(5)
    end
    
    if pad:down() then
    r = r + 5
    screen.waitVblankStart(5)
    end
    
    if pad:right() then
    r = r + 20
    screen.waitVblankStart(5)
    end
    
    if pad:left() then
    r = r + 10
    screen.waitVblankStart(5)
    end
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  13. #1903
    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

    SO MUCH THANKS! And also, another problem. (I never stop having problems) This should be the last one. In my code I have:

    Code:
    r = 0
    d = r*2
    
    function caf()
    x = r*r*3.14
    end
    
    function cac()
    y = d*3.14
    end
    Yet as r increases, d stays the same. If i set r as 1, d would show up as d = 2, and never go up no matter how much r goes up. THis is the final problem, (I hope!)
    THANKS again.

  14. #1904
    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
    SO MUCH THANKS! And also, another problem. (I never stop having problems) This should be the last one. In my code I have:

    Code:
    r = 0
    d = r*2
    
    function caf()
    x = r*r*3.14
    end
    
    function cac()
    y = d*3.14
    end
    Yet as r increases, d stays the same. If i set r as 1, d would show up as d = 2, and never go up no matter how much r goes up. THis is the final problem, (I hope!)
    THANKS again.
    can you post all the code again, i need to see it all in one place as it is. (its confusing going back and forth between posts to see where we are)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  15. #1905
    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

    Whoops, here is the whole code:

    Code:
    red = Color.new(255,0,0)
    yellow = Color.new(255, 255, 0)
    blue = Color.new(0, 0, 255)
    orange = Color.new(223, 88, 6)
    grey = Color.new(94, 97, 111)
    black = Color.new(0, 0, 0)
    white = Color.new(255, 255, 255)
    green = Color.new(0,255,0)
    
    r = 0
    d = r*2
    
    function caf()
    x = r*r*3.14
    end
    
    function cac()
    y = d*3.14
    end
    
    while true do
    
    screen:clear(green)
    
    pad = Controls.read()
    
    if pad:up() then
    r = r + 1
    screen.waitVblankStart(7)
    end
    
    if pad:down() then
    r = r + 5
    screen.waitVblankStart(7)
    end
    
    if pad:right() then
    r = r + 20
    screen.waitVblankStart(7)
    end
    
    if pad:left() then
    r = r + 10
    screen.waitVblankStart(7)
    end
    
    if r > 500 then
    r = 0
    end
    
    if pad:cross() then
    caf() 
    screen:print(100, 100, 'Circles area = ' .. x, black)
    end
    
    if pad:square() then
    cac()
    screen:print(10,10,'Circles circumfence = ' .. y, black)
    end
    
    screen:print(10,20,"Diameter = " .. d, black)
    screen:print(10,10,"Radius = " .. r, black)
    
    oldpad = pad
    
    screen.waitVblankStart()
    screen.flip()
    end
    Now you can kinda see what I am trying to make.

  16. #1906
    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
    Whoops, here is the whole code:

    Code:
    red = Color.new(255,0,0)
    yellow = Color.new(255, 255, 0)
    blue = Color.new(0, 0, 255)
    orange = Color.new(223, 88, 6)
    grey = Color.new(94, 97, 111)
    black = Color.new(0, 0, 0)
    white = Color.new(255, 255, 255)
    green = Color.new(0,255,0)
    
    r = 0
    d = r*2
    
    function caf()
    x = r*r*3.14
    end
    
    function cac()
    y = d*3.14
    end
    
    while true do
    
    screen:clear(green)
    
    pad = Controls.read()
    
    if pad:up() then
    r = r + 1
    screen.waitVblankStart(7)
    end
    
    if pad:down() then
    r = r + 5
    screen.waitVblankStart(7)
    end
    
    if pad:right() then
    r = r + 20
    screen.waitVblankStart(7)
    end
    
    if pad:left() then
    r = r + 10
    screen.waitVblankStart(7)
    end
    
    if r > 500 then
    r = 0
    end
    
    if pad:cross() then
    caf() 
    screen:print(100, 100, 'Circles area = ' .. x, black)
    end
    
    if pad:square() then
    cac()
    screen:print(10,10,'Circles circumfence = ' .. y, black)
    end
    
    screen:print(10,20,"Diameter = " .. d, black)
    screen:print(10,10,"Radius = " .. r, black)
    
    oldpad = pad
    
    screen.waitVblankStart()
    screen.flip()
    end
    Now you can kinda see what I am trying to make.
    do the circle's diameter and circumference show correctly? (i cant find my PSP's usb wire so i cant test it)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

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

    Yeah, both of them show correctly. It's just that I would like them to d to increase as r is. It would make the app much simpler.

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

    I really dont know..all the coding looks fine. dont know why it doesnt work.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

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

    Meh, then thanks anyway. I could work around that...Do you know how to code menus? Because if you do, then just PM me, because I could use you for this app.

  20. #1910
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    JW, In LUA is it possible to find out the PSP Username?


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

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

    JW, In LUA is it possible to find out the PSP Username?
    dont think so...
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

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

    1 hour ago i found out how to change the pixels of the paint =PP
    when i finish i will release my 2nd verson
    =PPP
    Bequiet!!!
    I'm learning cc©cc

  23. #1913
    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 PSPduh
    Meh, then thanks anyway. I could work around that...Do you know how to code menus? Because if you do, then just PM me, because I could use you for this app.

    i could help. i have just written a guide on menus. search "menus in lua" and youll see it. or i can do it for you.
    --------------------------------------------------------------------------------------

  24. #1914
    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 PSPduh
    SO MUCH THANKS! And also, another problem. (I never stop having problems) This should be the last one. In my code I have:

    Code:
    r = 0
    d = r*2
    
    function caf()
    x = r*r*3.14
    end
    
    function cac()
    y = d*3.14
    end
    Yet as r increases, d stays the same. If i set r as 1, d would show up as d = 2, and never go up no matter how much r goes up. THis is the final problem, (I hope!)
    THANKS again.
    This is because you only defined "d" in the top of your code.
    It isn't anywhere in your loop so it can't be updated. It's only created at the top of your code. You need to either put it somewhere in your loop to update the variable, or into a function that gets called.
    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. #1915
    &lt;img src=&quot;images/smilies/psp.gif&quot; border=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot; cl***=&quot;inlineimg&quot; /&gt; &lt;img src=&quot;images/smilies/Punk.gif&quot; border=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot; cl***=&
    Points: 11.105, Level: 69
    Level completed: 64%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Canada
    Beiträge
    1.944
    Points
    11.105
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    how would you 'refresh' a randomly chosen number,
    so when i tell it to, it will randomize again,(pick a new number)

  26. #1916
    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 Sousanator
    how would you 'refresh' a randomly chosen number,
    so when i tell it to, it will randomize again,(pick a new number)
    Do it the same way you made the first number.

    If you did

    Code:
    number = math.random(1,10)
    to get the first number then just call that command again wherever you want a new random number.

    I would also recommend at the top of your code before your loop to "seed" your random numbers so that the same ones arent generated each time you run your app.Here's a good way to do that.

    Code:
    math.randomseed(os.time))
    That's a good way
    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/

  27. #1917
    &lt;img src=&quot;images/smilies/psp.gif&quot; border=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot; cl***=&quot;inlineimg&quot; /&gt; &lt;img src=&quot;images/smilies/Punk.gif&quot; border=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot; cl***=&
    Points: 11.105, Level: 69
    Level completed: 64%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Canada
    Beiträge
    1.944
    Points
    11.105
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    thanks,,

    and is there a way turn rotate/ or zoom in on an image,

  28. #1918
    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. i put a qustion in a page but no one answered
    Code:
    if pad:l() and pad:triangle() then screen:save("PortablePaint.tga") end
    what do i change so the tga picture will go to root of the memory stick or in another location ?
    Bequiet!!!
    I'm learning cc©cc

  29. #1919
    Points: 4.107, Level: 40
    Level completed: 79%, Points required for next Level: 43
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Beiträge
    17
    Points
    4.107
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von natan333
    guys. i put a qustion in a page but no one answered
    Code:
    if pad:l() and pad:triangle() then screen:save("PortablePaint.tga") end
    what do i change so the tga picture will go to root of the memory stick or in another location ?
    screen:save("ms0:/PortablePaint.tga") to save to root of ms, or
    screen:save("ms0:/PSP/SCREENIES/PortablePaint.tga") to save in "screenies" folder within the "psp" folder on the ms.

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

    thank you so much dragon
    dragaron
    Bequiet!!!
    I'm learning cc©cc


 

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 .