Seite 163 von 342 ErsteErste ... 63 113 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 213 263 ... LetzteLetzte
Zeige Ergebnis 4.861 bis 4.890 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; Zitat von GuitarGod1134 Did you search for some functions. THeres probaly one to blit an image at an angle. Ok ...

  
  1. #4861
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von GuitarGod1134
    Did you search for some functions. THeres probaly one to blit an image at an angle.

    Ok heres my questinos
    I want to open a text file and print the whole file to the screen ie if the text file contains

    aslkdfjaoidnfaoijdfoiajfo ;ia
    dfiojasoifjaodijfoaijd;fi asjf

    i want the psp to say that too. on all the lines. how would i do that?
    Ummm.. there is 2 ways you could do this.
    1) Take some of the code from Snake you know from the Lua Player ;)

    2) Use some of HarleyG's tuts (there in C you have to convert them to Lua script)
    I would go with snake cause there is no conversion. But here is the link to HarleyG's tuts.
    http://www.psp-programming.com/forum...sg2555#msg2555

    -= Double Post =-
    And i think it is possible to read more than one line cause ive seen some text editors......


    Geändert von pspfreak9 (12-27-2006 um 09:08 AM Uhr) Grund: Automerged Doublepost

  2. #4862
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Freshmilk
    Guys, I've tried everything, and I'm stuck.

    This maybe a weird question, but is there any way i could blit an image at an angle with having to make about 360 pictures of the same car facing in different directions?

    Eg. this number 9 is my car

    '9'

    If i wanted to flip it veritcally, (or any other direction) it would look like this:

    ,6,

    So, from the one image, how would i do this in lua?
    You can only do that using the GU..

  3. #4863
    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 head_54us
    You can only do that using the GU..

    sceGumRotateX() i think.

    anyway, there was a rotation snippet for lua, but its really slow, and moves the image itself. so yeah.

    your best bet it to learn C/C++ ans use oslib.
    --------------------------------------------------------------------------------------

  4. #4864
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    sceGumRotateX() i think.

    anyway, there was a rotation snippet for lua, but its really slow, and moves the image itself. so yeah.

    your best bet it to learn C/C++ ans use oslib.
    Shouldn't it be around the Z axis (as long the Z axis is pointing into the screen)

  5. #4865
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Actually I believe the function is Gum.rotateXYZ(number,numb er,number)

  6. #4866
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Can someone help. I get an error saying loop is ingettable or not gettable (if thats a word) at line 32. Also it may contain more errors lol.


    Spoiler for Siege RPG:
    Code:
    --Siege RPG 
    --By GuitarGod
    --basically this is an rpg where your objective
    -- is to destroy the castle
    
    --lets define some colors.
    red = Color.new(255,0,0)
    
    --load all the pics
    arrow = Image.load("pics/arrow.png")
    battleground = Image.load("pics/battleground.png")
    boulder = Image.load("pics/boulder.png")
    ram = Image.load("pics/ram.png")
    
    
    --some variables for health
    --health for you
    yourhealth = 100
    --castles health
    castlehp = 100
    
    --whos turn?
    currentturn = "player"
    
    --attack selector variable
    selector = 1
    
    
    while true do
    
    --blit the whole area
    screen:blit(0,0,battleground.png)
    
    --print castles hp
    screen:print(380,8,"Castle HP ="..castlehp,red)
    
    --print your hp
    screen:print(10,180,"Army HP = "..yourhealth,red)
    
    --print the current turn
    screen:print(210,17,"Current turn ="..currentturn,red)
    
    --controls
    pad = Controls.read()
    
    --print the different attacks you have
    screen:print(11,14,"Battering Ram",red)
    screen:print(11,20,"Archers",red)
    screen:print(11,25,"Catapult",red)
    
    --now for the selector
    if selector == 1 then
    screen:print(30,14,"<--",red)
    end
    if selector == 2 then
    screen:print(30,20,"<--",red)
    end
    if selector == 3 then
    screen:print(30,25,"<--",red)
    end
    
    --move the selector
    if pad:up() then 
    selector = selector - 1
    end
    if pad:down() then
    selector = selector + 1
    end
    
    --if it reaches the end of the selections
    if selector == 0 then
    selector = 3
    end
    if selector == 4 then
    selector = 1
    end
    
    --player attacks
    if currentturn == "player" and selector == 1 and pad:cross() then
    screen:blit(345,233,ram)
    castlehp = castlehp - math.random(1,7)
    currentturn = "comp"
    end
    
    if currentturn == "player" and selector == 2 and pad:cross() then
    screen:blit(276,99,arrow)
    castlehp = castlehp - math.random(1,2)
    currentturn = "comp"
    end
    
    if currentturn == "player" and selector == 3 and pad:cross() then
    screen:blit(295,15,boulder)
    castlehp = castlehp - math.random(5,10)
    end
    
    --comp attacks
    if currentturn == "comp" and math.random(1,2) == 1 then
    screen:blit(56,228,arrow)
    yourhealth = yourhealth - math.random(1,2)
    currentturn = "player"
    end
    
    if currentturn == "comp" and math.random(1,2) == 2 then
    screen:blit(56,228,boulder)
    yourhealth = yourhealth - math.random(5,10)
    currentturn = "player"
    end
    
    --all done
    screen:clear()
    screen.waitVblankStart()
    screen.flip()
    end
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  7. #4867
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    screen:blit(0,0,battlegro und.png)

    Needs to be

    screen:blit(0,0,battlegro und)

  8. #4868
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    ok now when i run it its just a black screen but i get no errors.
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  9. #4869
    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 TacticalPenguin
    Actually I believe the function is Gum.rotateXYZ(number,numb er,number)

    well, i was talking about the C function. also, you dont have to change all 3 axes. you can also just do one axis. like:

    sceGumRotateX()
    sceGumRotateY()
    sceGumRotateZ()

    (convert that to lua)
    -= Double Post =-
    Zitat Zitat von head_54us
    Shouldn't it be around the Z axis (as long the Z axis is pointing into the screen)

    ah, yes, thats true. i totally ignored the Z axis for some reason. but that makes total sense.
    -= Double Post =-
    Zitat Zitat von GuitarGod1134
    Can someone help. I get an error saying loop is ingettable or not gettable (if thats a word) at line 32. Also it may contain more errors lol.


    Spoiler for Siege RPG:
    Code:
    --Siege RPG 
    --By GuitarGod
    --basically this is an rpg where your objective
    -- is to destroy the castle
    
    --lets define some colors.
    red = Color.new(255,0,0)
    
    --load all the pics
    arrow = Image.load("pics/arrow.png")
    battleground = Image.load("pics/battleground.png")
    boulder = Image.load("pics/boulder.png")
    ram = Image.load("pics/ram.png")
    
    
    --some variables for health
    --health for you
    yourhealth = 100
    --castles health
    castlehp = 100
    
    --whos turn?
    currentturn = "player"
    
    --attack selector variable
    selector = 1
    
    
    while true do
    
    --blit the whole area
    screen:blit(0,0,battleground.png)
    
    --print castles hp
    screen:print(380,8,"Castle HP ="..castlehp,red)
    
    --print your hp
    screen:print(10,180,"Army HP = "..yourhealth,red)
    
    --print the current turn
    screen:print(210,17,"Current turn ="..currentturn,red)
    
    --controls
    pad = Controls.read()
    
    --print the different attacks you have
    screen:print(11,14,"Battering Ram",red)
    screen:print(11,20,"Archers",red)
    screen:print(11,25,"Catapult",red)
    
    --now for the selector
    if selector == 1 then
    screen:print(30,14,"<--",red)
    end
    if selector == 2 then
    screen:print(30,20,"<--",red)
    end
    if selector == 3 then
    screen:print(30,25,"<--",red)
    end
    
    --move the selector
    if pad:up() then 
    selector = selector - 1
    end
    if pad:down() then
    selector = selector + 1
    end
    
    --if it reaches the end of the selections
    if selector == 0 then
    selector = 3
    end
    if selector == 4 then
    selector = 1
    end
    
    --player attacks
    if currentturn == "player" and selector == 1 and pad:cross() then
    screen:blit(345,233,ram)
    castlehp = castlehp - math.random(1,7)
    currentturn = "comp"
    end
    
    if currentturn == "player" and selector == 2 and pad:cross() then
    screen:blit(276,99,arrow)
    castlehp = castlehp - math.random(1,2)
    currentturn = "comp"
    end
    
    if currentturn == "player" and selector == 3 and pad:cross() then
    screen:blit(295,15,boulder)
    castlehp = castlehp - math.random(5,10)
    end
    
    --comp attacks
    if currentturn == "comp" and math.random(1,2) == 1 then
    screen:blit(56,228,arrow)
    yourhealth = yourhealth - math.random(1,2)
    currentturn = "player"
    end
    
    if currentturn == "comp" and math.random(1,2) == 2 then
    screen:blit(56,228,boulder)
    yourhealth = yourhealth - math.random(5,10)
    currentturn = "player"
    end
    
    --all done
    screen:clear()
    screen.waitVblankStart()
    screen.flip()
    end
    first, change line 32 to what tactical said. then, move the screen:clear() to the top of your while true do. why? because, when you have it at the bottom, the program draws everything in your loop, then when it gets to the very end, it sees the screen:clear() and clears the entire screen to black. (which is the default color.) thus, you see nothing. have your loop like this:



    Code:
    while true do
    screen:clear()
    
    -- all the drawing/pad/other stuff --
    
    screen.waitVblankStart()
    screen.flip()
    end

    should work.
    Geändert von Grimfate126 (12-28-2006 um 11:24 AM Uhr) Grund: Automerged Doublepost
    --------------------------------------------------------------------------------------

  10. #4870
    QJ Gamer Blue
    Points: 5.636, Level: 48
    Level completed: 44%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    300
    Points
    5.636
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard Music slows the game down

    I am trying to add music to my game PSPOmok. It sounds great untill I get to the actual game, then it starts to get laggy, and sounds bad. It gets worse as you add more and more pieces. Does somone know a way I may be able to get it to sound better? They are XM files BTW.

  11. #4871
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Convert your Xm to MP3 ;)

  12. #4872
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    thanks grimfate ill try that.
    -= Double Post =-
    Zitat Zitat von JOVENASO
    uhmm need some help how to make a pad that make two buttons make one function
    pad = Controls.read()
    if pad:cross() then
    break
    end

    thanks
    If your asking the question I think you are then you need to use an "and" like
    Code:
    pad = Controls.read()
    if pad:cross() and pad:square() then
    break
    end
    Or whatever function you want.
    -= Double Post =-
    In my game when I use a weapon the weapon blits for like a millasecond because its in "if" statements. Is there anyway I can make it blit longer??
    Heres my source
    Spoiler for Siege RPG:
    Code:
    --Siege RPG 
    --By GuitarGod
    --basically this is an rpg where your objective
    -- is to destroy the castle
    
    --lets define some colors.
    red = Color.new(255,0,0)
    
    --load all the pics
    arrow = Image.load("pics/arrow.png")
    battleground = Image.load("pics/battleground.png")
    boulder = Image.load("pics/boulder.png")
    ram = Image.load("pics/ram.png")
    
    
    --some variables for health
    --health for you
    yourhealth = 100
    --castles health
    castlehp = 100
    
    --whos turn?
    currentturn = "player"
    
    --attack selector variable
    selector = 1
    
    
    while true do
    --keep the screen refresed
    screen:clear()
    
    --blit the whole area
    screen:blit(0,0,battleground)
    
    --print castles hp
    screen:print(380,8,"C HP = "..castlehp,red)
    
    --print your hp
    screen:print(11,181,"Army HP = "..yourhealth,red)
    
    --print the current turn
    screen:print(210,17,"Current turn = "..currentturn,red)
    
    --controls
    pad = Controls.read()
    
    --print the different attacks you have
    screen:print(11,14,"Battering Ram",red)
    screen:print(11,22,"Archers",red)
    screen:print(11,31,"Catapult",red)
    
    --now for the selector
    if selector == 1 then
    screen:print(120,14,"<--",red)
    end
    if selector == 2 then
    screen:print(120,22,"<--",red)
    end
    if selector == 3 then
    screen:print(120,31,"<--",red)
    end
    
    --move the selector
    if pad:up() then 
    selector = selector - 1
    end
    if pad:down() then
    selector = selector + 1
    end
    
    --if it reaches the end of the selections
    if selector == 0 then
    selector = 3
    end
    if selector == 4 then
    selector = 1
    end
    
    --player attacks
    if currentturn == "player" and selector == 1 and pad:cross() then
    screen:blit(345,233,ram)
    castlehp = castlehp - math.random(1,7)
    currentturn = "comp"
    end
    
    if currentturn == "player" and selector == 2 and pad:cross() then
    screen:blit(276,99,arrow)
    castlehp = castlehp - math.random(1,2)
    currentturn = "comp"
    end
    
    if currentturn == "player" and selector == 3 and pad:cross() then
    screen:blit(295,15,boulder)
    castlehp = castlehp - math.random(5,10)
    end
    
    --comp attacks
    if currentturn == "comp" and math.random(1,2) == 1 then
    screen:blit(56,228,arrow)
    yourhealth = yourhealth - math.random(1,2)
    currentturn = "player"
    end
    
    if currentturn == "comp" and math.random(1,2) == 2 then
    screen:blit(56,228,boulder)
    yourhealth = yourhealth - math.random(5,10)
    currentturn = "player"
    end
    
    --all done
    screen.waitVblankStart()
    screen.flip()
    end

    -= Double Post =-
    In my game when I use a weapon the weapon blits for like a millasecond because its in "if" statements. Is there anyway I can make it blit longer??
    Heres my source
    Spoiler for Siege RPG:
    Code:
    --Siege RPG 
    --By GuitarGod
    --basically this is an rpg where your objective
    -- is to destroy the castle
    
    --lets define some colors.
    red = Color.new(255,0,0)
    
    --load all the pics
    arrow = Image.load("pics/arrow.png")
    battleground = Image.load("pics/battleground.png")
    boulder = Image.load("pics/boulder.png")
    ram = Image.load("pics/ram.png")
    
    
    --some variables for health
    --health for you
    yourhealth = 100
    --castles health
    castlehp = 100
    
    --whos turn?
    currentturn = "player"
    
    --attack selector variable
    selector = 1
    
    
    while true do
    --keep the screen refresed
    screen:clear()
    
    --blit the whole area
    screen:blit(0,0,battleground)
    
    --print castles hp
    screen:print(380,8,"C HP = "..castlehp,red)
    
    --print your hp
    screen:print(11,181,"Army HP = "..yourhealth,red)
    
    --print the current turn
    screen:print(210,17,"Current turn = "..currentturn,red)
    
    --controls
    pad = Controls.read()
    
    --print the different attacks you have
    screen:print(11,14,"Battering Ram",red)
    screen:print(11,22,"Archers",red)
    screen:print(11,31,"Catapult",red)
    
    --now for the selector
    if selector == 1 then
    screen:print(120,14,"<--",red)
    end
    if selector == 2 then
    screen:print(120,22,"<--",red)
    end
    if selector == 3 then
    screen:print(120,31,"<--",red)
    end
    
    --move the selector
    if pad:up() then 
    selector = selector - 1
    end
    if pad:down() then
    selector = selector + 1
    end
    
    --if it reaches the end of the selections
    if selector == 0 then
    selector = 3
    end
    if selector == 4 then
    selector = 1
    end
    
    --player attacks
    if currentturn == "player" and selector == 1 and pad:cross() then
    screen:blit(345,233,ram)
    castlehp = castlehp - math.random(1,7)
    currentturn = "comp"
    end
    
    if currentturn == "player" and selector == 2 and pad:cross() then
    screen:blit(276,99,arrow)
    castlehp = castlehp - math.random(1,2)
    currentturn = "comp"
    end
    
    if currentturn == "player" and selector == 3 and pad:cross() then
    screen:blit(295,15,boulder)
    castlehp = castlehp - math.random(5,10)
    end
    
    --comp attacks
    if currentturn == "comp" and math.random(1,2) == 1 then
    screen:blit(56,228,arrow)
    yourhealth = yourhealth - math.random(1,2)
    currentturn = "player"
    end
    
    if currentturn == "comp" and math.random(1,2) == 2 then
    screen:blit(56,228,boulder)
    yourhealth = yourhealth - math.random(5,10)
    currentturn = "player"
    end
    
    --all done
    screen.waitVblankStart()
    screen.flip()
    end
    Geändert von GuitarGod1134 (12-28-2006 um 12:56 PM Uhr) Grund: Automerged Doublepost
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  13. #4873
    QJ Gamer Blue
    Points: 5.636, Level: 48
    Level completed: 44%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    300
    Points
    5.636
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von pspfreak9
    Convert your Xm to MP3 ;)
    I didn't think LUA Played MP3s. o_O Are you sure it does?

  14. #4874
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Yes of course it does

  15. #4875
    QJ Gamer Blue
    Points: 5.636, Level: 48
    Level completed: 44%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    300
    Points
    5.636
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Just tried it, didn't work. LUA does not read MP3s. :/

  16. #4876
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    What!!!! Huh how did you convert it??
    -= Double Post =-
    Oh wait sorry my mistake it plays WAV files try converting it to that
    -= Double Post =-
    Sorry about that i was was thinking of C ;)
    Geändert von pspfreak9 (12-28-2006 um 08:39 PM Uhr) Grund: Automerged Doublepost

  17. #4877
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Actually with the luaplayer mod by cools it can.

  18. #4878
    QJ Gamer Blue
    Points: 5.636, Level: 48
    Level completed: 44%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Beiträge
    300
    Points
    5.636
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TacticalPenguin
    Actually with the luaplayer mod by cools it can.
    Well, I don't want to waste my time recoding everything twice only to find out it didn't make it faster. So are you sure that if I use the mod to run MP3s instead of XMs, the music will run smoother? :/

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

    Here is a useful post from Zion, creator of Linken's Quest, that teaches you how to make your game able to run in XMB:
    http://www.psp-hacks.com/forums/about40812.html

    just thought this was helpful and decided to post it up. :)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  20. #4880
    QJ Gamer Bronze
    Points: 9.316, Level: 64
    Level completed: 89%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Denmark
    Beiträge
    664
    Points
    9.316
    Level
    64
    Downloads
    0
    Uploads
    0

    Standard

    Hi everyone!

    I'm currently working on LuaMM or LuaMusicMaker.

    Right now its just a couple of mp3 sounds, which you can play at the same time.

    But i need to know:

    How do i load more than one mp3 sound?

    It just says:

    Mp3.load("my file goes here.mp3")

    And Mp3.play()

    How do i create more variables with it?

    Sorry im not so experienced in lua...
    My PSP Projects:
    ___________________
    None.

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

    try thinking of it as an image sorta.
    photo = Image.load(blahblah)
    music = Mp3.load(blahblah)
    edit - hehe i dont know how i double posted...
    Geändert von EminentJonFrost (12-30-2006 um 07:31 AM Uhr) Grund: Automerged Doublepost
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  22. #4882
    QJ Gamer Bronze
    Points: 9.316, Level: 64
    Level completed: 89%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Denmark
    Beiträge
    664
    Points
    9.316
    Level
    64
    Downloads
    0
    Uploads
    0

    Standard

    Allright, that helped! Thx!
    -= Double Post =-
    Wait... now it gives me an error.

    I'll just post my main script.

    --Colors

    white = Color.new(255, 255, 255)

    --Loading

    screen.waitVblankStart(60 )

    screenrint(194, 136, "Loading Images...", white)
    screen.flip()

    background = Image.load("bg.png")

    screen:clear()
    screenrint(194, 136, "Done.", white)
    screen.flip()

    screen.waitVblankStart(40 )

    screen:clear()
    screenrint(194, 136, "Loading Sounds...", white)
    screen.flip()

    Guitar = Mp3.load("guitar.mp3")

    Guitar2 = Mp3.load("guitar2.mp3")

    Drum = Mp3.load("drum.mp3")

    screen:clear()
    screenrint(194, 136, "Done.", white)
    screen.flip()

    screen.waitVblankStart(40 )

    screen:clear()
    screenrint(194, 136, "Loading LuaMM", white)
    screen.flip()

    screen.waitVblankStart(60 )

    screen:clear()
    screen:blit(0, 0, background, false)
    screen.flip()

    oldpad = Controls.read()

    while true do

    pad = Controls.read()

    if pad:cross() then
    Guitarlay()
    end

    if pad:circle() then
    Guitar2lay()
    end

    if pad:triangle() then
    Drumlay()
    end

    if pad:start() then
    break
    end
    oldpad=pad
    end

    The error says: "attempt to index global "drum" (a nil value)

    And it says that with drum, guitar, and guitar2.
    Geändert von gameo (12-30-2006 um 04:04 AM Uhr) Grund: Automerged Doublepost
    My PSP Projects:
    ___________________
    None.

  23. #4883
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Then your variables are not being loaded correctly. Check the directories and all that stuff and make sure your loading them right.
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  24. #4884
    QJ Gamer Green
    Points: 6.453, Level: 52
    Level completed: 52%, Points required for next Level: 97
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    BEHIND YOU!!
    Beiträge
    1.061
    Points
    6.453
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    And you can also get rid of that screen.waitVblankStart(60 ) in the beginning of your code. It is pointless to have that there.
    [url=http://xs.to][img]http://xs313.xs.to/xs313/07106/wmnp8z.png[/img][/url]

    What's a recovery.elf
    [QUOTE=iball]
    He's the one that fixes Santa's sleigh when it breaks down[/QUOTE]

    [QUOTE=Deturbanator]why are we allowed to see the whole flesh and being of the boob but we MUST blur out the tit?[/QUOTE]
    [PRE][B]sg57 i love you for turning on the light of homebrew when i was in the darkness of sony[/b][/pre]

  25. #4885
    QJ Gamer Bronze
    Points: 9.316, Level: 64
    Level completed: 89%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Denmark
    Beiträge
    664
    Points
    9.316
    Level
    64
    Downloads
    0
    Uploads
    0

    Standard

    I have it to make the loading a little serious... else you wont reach to see anything.

    But the problem is, there is NO error! I don't know why it says so.
    My PSP Projects:
    ___________________
    None.

  26. #4886
    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

    Guitargod - Somehow I think it wouldve told him it couldnt find/load the MP3 when loading it, not playing it *rolls eyes*

    gameo - I havent messede with the MP3 capable Lua Player library before, but Im positive a sound effect, such as a drum or guitar, should be played using the Sound System (WAV). Convert the MP3's to WAV, get a good sound + good size, and do a simple:

    Code:
    guitar = Sound.load("guitar.wav")
    
    ...
    
    guitar:play()
    Oh and your doing that whole oldpad new pad thing pretty obviously wrong ('pad' isnt even being manipulated at all...)

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


  27. #4887
    QJ Gamer Bronze
    Points: 9.316, Level: 64
    Level completed: 89%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Denmark
    Beiträge
    664
    Points
    9.316
    Level
    64
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    Guitargod - Somehow I think it wouldve told him it couldnt find/load the MP3 when loading it, not playing it *rolls eyes*

    gameo - I havent messede with the MP3 capable Lua Player library before, but Im positive a sound effect, such as a drum or guitar, should be played using the Sound System (WAV). Convert the MP3's to WAV, get a good sound + good size, and do a simple:


    Code:
    guitar = Sound.load("guitar.wav")

    ...

    guitarlay()Oh and your doing that whole oldpad new pad thing pretty obviously wrong ('pad' isnt even being manipulated at all...)
    I did that when i was using LuaPlayer v0.18.
    They gave me the error: ERROR Loading sound.

    So i started on Luaplayer v0.20 and converted them to Mp3's.
    My PSP Projects:
    ___________________
    None.

  28. #4888
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Ok ok . gosh just made that guess by the look of his erros. and besides mp3's are usually used for background music not really for game sounds. theres another way to load wav files it says in evilmana. did u try that way?
    Spoiler for What evilmana has to say..:
    Let's learn a few more commands now. The next command will play the file. Use the name of the variable you used to load your sound. Like this:

    bonkSoundlay()

    I do not recommend using this way to play the file however. This can lead to a common error which will mention something along the lines of "loop ingettable". Here's how I would play my file. The only thing you would need to change from this code is the bonkSound if you used a different variable.

    local sound = bonkSound
    voice = soundlay()

    To stop the sound use:

    voice:stop()

    We can also use a command as we did with the music commands to see if the sound is playing. This command is:

    voicelaying()


    http://evilmana.com/tutorials/lua_tutorial_10.php
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  29. #4889
    QJ Gamer Bronze
    Points: 9.316, Level: 64
    Level completed: 89%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Denmark
    Beiträge
    664
    Points
    9.316
    Level
    64
    Downloads
    0
    Uploads
    0

    Standard

    A little more confusing, but i may just try that...
    My PSP Projects:
    ___________________
    None.

  30. #4890
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Hi, I need help with my highscore saving code. I have a file called scorefile in the same directory as this file is:


    function saveHighscore()
    file = io.open(scorefile, "w")
    if file then
    file:write(score[1].s1)
    file:close()
    end
    end

    function loadHighscore()
    file = io.open(scorefile, "r")
    if file then
    oldhigh = file:read("*n")
    file:close()
    end
    end


    I have this code too:

    if score[1].s1 > oldhigh then
    saveHighscore()
    end

    I get the error:

    Error: level1.lua:112: bad argument #1 to 'open' (string expected, got nil)

    Thanks,
    Nicko01


 

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 .