Seite 19 von 342 ErsteErste ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 69 119 ... LetzteLetzte
Zeige Ergebnis 541 bis 570 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; It still doesnt. It has to do with the pixel checking part. Code: gamebackground:fillRect(PixelRX + 1, PixelRY + 1, 9, ...

  
  1. #541
    Psp Dev
    Points: 5.664, Level: 48
    Level completed: 57%, Points required for next Level: 86
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Nebraska
    Beiträge
    228
    Points
    5.664
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    It still doesnt. It has to do with the pixel checking part.

    Code:
    		gamebackground:fillRect(PixelRX + 1, PixelRY + 1, 9, 9, red)
    		gamebackground:fillRect(PixelLX + 1, PixelLY + 1, 9, 9, blue)
                    Color1 = gamebackground:pixel(PixelRX , PixelRY)
    		Color2 = gamebackground:pixel(PixelRX+11, PixelRY)
    		Color3 = gamebackground:pixel(PixelRX, PixelRY+11)
    		Color4 = gamebackground:pixel(PixelRX+11, PixelRY+11)
                    Color5 = gamebackground:pixel(PixelLX, PixelLY)
    		Color6 = gamebackground:pixel(PixelLX+11, PixelLY)
    		Color7 = gamebackground:pixel(PixelLX, PixelLY+11)
    		Color8 = gamebackground:pixel(PixelLX+11, PixelLY+11)
    
                    timer2 = timer2 + 0.1	-- create a delay
    		if timer2 >= 0.7 then
    			if Color5 == red or Color5 == blue or Color6 == red or Color6 == blue or Color7 == red or Color7 == blue or Color8 == red or Color8 == blue then
    			          LastSet = 9
                    		gameover()
                    	end
    		end
    
    
                       timer = timer + 0.1	-- create a delay
    		if timer >= 0.7 then
    			if Color1 == red or Color1 == blue or Color2 == red or Color2 == blue or Color3 == red or Color3 == blue or Color4 == red or Color4 == blue then
    			LastSet = 12
                    		gameover()
                    	end
    		end



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

    hmm maybe i was wrong about what i said earlier. I saw the samething in someone elses code, but still this one is more general.

    Your code is kinda difficult to understand. I get the general idea, but i don't know all the variables. For instance what is pixelRX? Does it mean the x-coordinate of the right side? But i don't know of what. Are you sure its in the pixelchecking part?

    Also what error do you get?
    EDIT: Never mind it just goes to game over, right?
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  3. #543
    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

    Hey Soadnation, how's your game going?
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

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

    well i got my psp confiscated at school that day. now i have it back and im gona learn tables right now. when i make a table can i have it save all the xvars in a table(with a randomly generated number behind it) and then have a movement function that just subtracts the speed from every variable withing the table? because i want them to have independent x vars but i wont them to move at the samew spped.
    Geändert von soadnation (02-24-2006 um 02:27 PM Uhr)

  5. #545
    Psp Dev
    Points: 5.664, Level: 48
    Level completed: 57%, Points required for next Level: 86
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Nebraska
    Beiträge
    228
    Points
    5.664
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Hey Altair can you contact me Via aim or Msn. I can explain it easyer then over a forum.

    Aim: El Legato Sin
    Msn: [email protected]

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

    @soadnation
    I just kinda learned tables todo :P. You can't just say [tablename]=[tablename]-1, unfortunately. However it's possible. You have to use a for loop. Atleast thats what i use and it works perfectly!

    @MikePiP
    I do have MSN. However I'm (almost) never online. Also ill be gone for a week after tomorrow afternoon (is that how you say it?), so i wont be able to help you then but afterwards i'd like to help.
    Maybe you can PM me your whole code? If you thrust me with it, that is. Thats probably the fastest way for now.
    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. #547
    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

    i know i couldnt just tell the table to subtract the speed but would there be a command to subtract the speed from every variable in the table?

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

    i know i couldnt just tell the table to subtract the speed but would there be a command to subtract the speed from every variable in the table?
    should be able to do that with a "for" loop
    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. #549
    QJ Gamer Blue
    Points: 5.016, Level: 45
    Level completed: 33%, Points required for next Level: 134
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    108
    Points
    5.016
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Sir Crx
    What is the code for the port for the headphone extension?
    ......

  10. #550
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    guys, i can't seem to find any decent wa of making a small digital clockim trying to make a small bar for the top of my screen that shows the battery percent and the time digitally next to it, if anyone could help me that would be cool

    my program keeps sayin :61 <eof> exptected near "end"

    its only 61 lines long

    wat does this mean? How do i fix this
    Geändert von Glynnder (02-26-2006 um 12:34 PM Uhr)

  11. #551
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    plz delete
    Geändert von Glynnder (02-26-2006 um 12:33 PM Uhr) Grund: delete

  12. #552
    QJ Gamer Blue
    Points: 4.301, Level: 41
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Portugal
    Beiträge
    60
    Points
    4.301
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Just a question!
    How do you generate a random number?
    Lets say between 0 and 100?

    Just started in lua and im exploring still so sorry if its a noob question.

  13. #553
    Points: 4.248, Level: 41
    Level completed: 49%, Points required for next Level: 102
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    47
    Points
    4.248
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    math.random(0,100)

  14. #554
    QJ Gamer Blue
    Points: 4.301, Level: 41
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Portugal
    Beiträge
    60
    Points
    4.301
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    tnkx m8
    really apreciated.

  15. #555
    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 Glynnder- PSPro
    guys, i can't seem to find any decent wa of making a small digital clockim trying to make a small bar for the top of my screen that shows the battery percent and the time digitally next to it, if anyone could help me that would be cool

    my program keeps sayin :61 <eof> exptected near "end"

    its only 61 lines long

    wat does this mean? How do i fix this
    Your missing an 'end' at the end of your function, or you didnt close the loop, or an if statement, etc.

    And I wouldnt request for battery life, digital clock, etc. Your basically asking for people to do your code, wheres the fun of that? Just make an integer that increases as the SysClock() increases and have a boolean that will determine if the integer has gone past 60 (seconds), then reset the integer to 0, and add 1 (minute) to the time (make it an integer that will display in the right hand corner). Same goes for hours.

    Or just search for some app/source with it in it,

    Windows Shell? possibly

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


  16. #556
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    I worked out the battery life but i needed the clock so thanx for sysclock()
    Hod do you check if you havn't closed everything because i think there may be one thing i havnt closed

  17. #557
    Points: 4.248, Level: 41
    Level completed: 49%, Points required for next Level: 102
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    47
    Points
    4.248
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    show us the code so we can find it

    try: add "end" onto line 61

  18. #558
    QJ Gamer Blue
    Points: 4.301, Level: 41
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Portugal
    Beiträge
    60
    Points
    4.301
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    function DrawSelection(choice)

    if choice = 0 then
    screen:blit(391,74,Select )
    choice = 6
    end

    if choice = 1 then
    screen:blit(21,74,Select)
    end

    if choice = 2 then
    screen:blit(95,74,Select)
    end

    if choice = 3 then
    screen:blit(169,74,Select )
    end

    if choice = 4 then
    screen:blit(243,74,Select )
    end

    if choice = 5 then
    screen:blit(317,74,Select )
    end

    if choice = 6 then
    screen:blit(391,74,Select )
    end

    if choice = 7 then
    screen:blit(21,74,Select)
    choice = 1
    end
    return choice
    end
    K when i run the small program that im making theres an error that says:
    1stprg.lua :15: 'then' expected near '='

    that error is in line 15, and that's the first IF in the function.

    this is my 1st program ever so im a bit noob

  19. #559
    Points: 4.248, Level: 41
    Level completed: 49%, Points required for next Level: 102
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    47
    Points
    4.248
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    in the if statements use == instead of =

  20. #560
    QJ Gamer Blue
    Points: 4.301, Level: 41
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Portugal
    Beiträge
    60
    Points
    4.301
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    thanks again tuna, game menu is working graphicaly speaking, i hope i can get hrough with this
    thanks again

  21. #561
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    OK, when i get home ill post the code. Its REALLY basicbecause its not finishd

    I don't really know if anyone would post this but how would i/ what is the script for making a click function for a cursor? maybe I could use collisions so when the cursor graphic collides with the button graphic and x is pressed it loads what the button links to, if something like that wont work then i can do it in other ways but it must do (crazy paint PSPaint)

    thanx
    Geändert von Glynnder (03-01-2006 um 07:09 AM Uhr)

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

    im still having problems with the tqables. does anyone know a good table tutorial

  23. #563
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    dblue = Color.new(0, 0, 255)
    red = Color.new(230, 0, 0)
    pink = Color.new(255, 0 , 153)
    blue = Color.new(0 , 153, 255)
    orange = Color.new(255, 102, 0)
    gray = Color.new(153, 153, 153)
    black = Color.new(0 , 0 , 0)
    white = Color.new(255, 255, 255)

    screen:Print(194, 136, "loading: 0%", red)
    screen.flip()
    background = Image.load("images/home.png")

    screen:clear()
    screen:Print(194, 136, "loading 20%", pink)
    screen. flip()

    pstype = Image.load("images/pstypebutton.png")

    screen:clear()
    screen:Print(194, 136, "Loading: 40%", pink)
    screen.flip()

    psdraw = Image.load("images/psdrawbutton.png")

    screen:clear()
    screen:Print(194, 136, "Loading: 60%", pink)
    screen.flip()

    pscalc = Image.load("images/pscalcbutton.png")


    screen:clear()
    screen:Print(194, 136, "Loading: 80%", pink)
    screen.flip()

    links = Image.load("images/linksbutton.png")

    screen:clear()
    screenrint(194, 136, "Loading: 90%", pink)
    screen.flip()

    apps = Image.load("images/apps.png")

    screen:clear()
    screenrint(194, 136, "Loading: 100%", pink)
    screen.flip()

    screen.waitVblankStart(60 )

    screen.waitVblankStart()
    screen.flip()
    screen.waitVblankStart(24 0)

    while true do
    screen:blit(0, 0, background, false)
    pad = Controls.read()
    screenrint(465, 0, tostring(System.powerGetB atteryLifePercent()) .. "%")
    end

    end
    theres my code plz say why theres da eroor

  24. #564
    QJ Gamer Silver
    Points: 6.087, Level: 50
    Level completed: 69%, Points required for next Level: 63
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    script.lua
    Beiträge
    426
    Points
    6.087
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Glynnder, I'm guessign its cause you have an extra end at the end of your code that's not closing nothing. Btw, instead of writing all those loading screens, just make a function for it. Like this:

    Code:
    dblue = Color.new(0, 0, 255)
    red = Color.new(230, 0, 0)
    pink = Color.new(255, 0 , 153)
    blue = Color.new(0 , 153, 255)
    orange = Color.new(255, 102, 0)
    gray = Color.new(153, 153, 153)
    black = Color.new(0 , 0 , 0)
    white = Color.new(255, 255, 255)
    
    LoadingSplash=function(NUM)
    local COLOR=pink
       if NUM==0 then COLOR=red
       else COLOR=pink end
       screen:clear()
       screen:print(194,136, "loading: " ..NUM.. "%",COLOR)
       screen.waitVblankStart()
       screen.flip()
    end
    
    LoadingSplash(0)
    background = Image.load("images/home.png")
    LoadingSplash(20)
    pstype = Image.load("images/pstypebutton.png")
    LoadingSplash(40)
    psdraw = Image.load("images/psdrawbutton.png")
    LoadingSplash(60)
    pscalc = Image.load("images/pscalcbutton.png")
    LoadingSplash(80)
    links = Image.load("images/linksbutton.png")
    LoadingSplash(90)
    apps = Image.load("images/apps.png")
    LoadingSplash(100)
    screen.flip()
    screen.waitVblankStart(240)
    
    while true do
     pad=Controls.read()
       screen:blit(0,0,background,false)
       screenrint(465,0,tostring(System.powerGetBatteryLifePercent()) .. "%")
    end

  25. #565
    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

    ell i gave up on the tables because i had a stroke of genuis(well kind of). i thought of a way to get it to work. right now i have the pole generation about half way done(haver it spawning 1 nicely) all i have to do is make it spawn the other ones and then add collisions(should be easy using the pspgolf code)

  26. #566
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Cool, thanks XteticX i got rid of the xtra end and a couple of other things and now it works well

  27. #567
    QJ Gamer Green
    Points: 40.380, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Grand Line
    Beiträge
    5.996
    Points
    40.380
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    umm can i have some help on shooting kunai for my game ok this is what i put right now i dont think its right though

    if pad: circle() then
    kunai = x + 4

    basically it suppose to shot he kunai (which is already loaded) acorrding to naruto's direction

    if he is facing >>> like that then it shoots right if he facing <<<< like that then it shoots left, any help would be appricated.. also the kunai is kunai_l (for left) and kunai_r (for right)
    [CENTER][IMG]http://img130.imageshack.us/img130/1640/acefcbanner2wo9.gif[/IMG]
    [SIZE=1][B]I'm soo hot[/B][/SIZE]
    [/CENTER]
    [SIZE=2][CENTER][/SIZE][/CENTER]
    [center]Sorry. No Advertising[/center]

  28. #568
    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

    i've got a bullet tutorial...may or may not help you for this. see signature below
    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/

  29. #569
    QJ Gamer Green
    Points: 40.380, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Grand Line
    Beiträge
    5.996
    Points
    40.380
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PSPMillionaire
    i've got a bullet tutorial...may or may not help you for this. see signature below
    yes i took a look at this but my game is 2Demension not from a top down view.
    [CENTER][IMG]http://img130.imageshack.us/img130/1640/acefcbanner2wo9.gif[/IMG]
    [SIZE=1][B]I'm soo hot[/B][/SIZE]
    [/CENTER]
    [SIZE=2][CENTER][/SIZE][/CENTER]
    [center]Sorry. No Advertising[/center]

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

    if your project isn't too big you can zip it and email it to me and i'll take a look at it. or you can post more complete code. the above code didn't tell us very much.
    Geändert von PSPMillionaire (03-04-2006 um 06:27 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/


 
Seite 19 von 342 ErsteErste ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 69 119 ... 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 07:53 AM Uhr.

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