Seite 282 von 342 ErsteErste ... 182 232 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 332 ... LetzteLetzte
Zeige Ergebnis 8.431 bis 8.460 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; Use the latest Luaplayer HM all the Mp3 stuport functions are in the read me...

  
  1. #8431
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    Use the latest Luaplayer HM all the Mp3 stuport functions are in the read me



  2. #8432
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von dan369
    Use the latest Luaplayer HM all the Mp3 stuport functions are in the read me
    okay, i dont know what function to use to load up a random song from a folder, how do i do this?

    Mp3me.load()
    Mp3me.play()
    Mp3me.Stop()
    Mp3me.eos() (EndOfStream)
    Mp3me.getTime()
    Mp3me.percent()
    Mp3me.pause()

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

    ifiwere1337 - Think logically about it. You'd get the folder as a directory list, parse all the entries in the list containing a .mp3 extension and add that filepath (or element #) to another array and randomly select from that which to play. Sub-folder searching would require recursive scanning of the root folder you pass and that's a different story.

    if your still stuck:
    Code:
    -- This will stop any currently playing song
    -- Load and play a random one from PSP/MUSIC/ folder
    function PlayRandomSong()
      -- get the files and folders in our music folder
      mp3List = System.listDirectory("ms0:/PSP/MUSIC/")
    
      -- loop through all the files/folders in our table
      for i = 1, table.getn(mp3List) do
        if string.sub(mp3List[i].name, -4) ~= ".mp3" and   -- if the extension of the file name doesn't end with .mp3
           string.sub(mp3List[i].name, -4) ~= ".Mp3" and   -- and .Mp3
           string.sub(mp3List[i].name, -4) ~= ".mP3" and   -- and .mP3
           string.sub(mp3List[i].name, -4) ~= ".MP3" then  -- and .MP3
          table.remove(mp3List, i)   -- the filename clearly isn't properly named MP3 file so remove it
          i = 0  -- reset the searching variable since our table now has changed
                 -- 0 because for loops, atleast in C, default to increase the iterator at the end of the loop
                 -- try i = i - 1 instead, should produce the same result (if table.remove works like i think it does)
        end
      end
      
      -- if there is atleast 1 filename in the folder
      if table.getn(mp3List) > 0 then
        -- stop the currently playng mp3 if any
        Mp3me.Stop()
        
        -- now just load a random filename that hasn't been removed
        Mp3me.load( mp3List [ math.random (1, table.getn() ) ].name )
        
        Mp3me.play() -- ...
      end
    end
    Untested but should work - the method i'm using is removing the non-MP3s from the directory list.
    Geändert von SG57 (04-03-2008 um 06:41 PM Uhr)

    ...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. #8434
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    ifiwere1337 - Think logically about it. You'd get the folder as a directory list, parse all the entries in the list containing a .mp3 extension and add that filepath (or element #) to another array and randomly select from that which to play.
    you lost me at think logically, i am a newb to lua and i only understood about half of that

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

    Well if you're still stuck take a look at what I made real quick. It's untested as I don't want to download luaplayer etc. etc.

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


  6. #8436
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    i need help!!!
    I what to scroll ONE image right, but without moving anything blitted apart from the player image.
    So when the player's X is more than 260 i will scroll right but not moving anything Blitted (apart from the player.img)
    and also keep Blitting that Image, so if the player's X is 480 u would still see the image scrolling right, BUT won't see anything moving that's been Blitted (apart from the player image )

  7. #8437
    NetGameOrb Maker
    Points: 6.138, Level: 50
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    New York
    Beiträge
    683
    Points
    6.138
    Level
    50
    My Mood
    Cheerful
    Downloads
    2
    Uploads
    0

    Standard

    Zitat Zitat von dan369
    i need help!!!
    I what to scroll ONE image right, but without moving anything blitted apart from the player image.
    So when the player's X is more than 260 i will scroll right but not moving anything Blitted (apart from the player.img)
    and also keep Blitting that Image, so if the player's X is 480 u would still see the image scrolling right, BUT won't see anything moving that's been Blitted (apart from the player image )
    do you mean a scroll map?
    GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.

    Stats Blog:http://netgameorb.blogspot.com/
    Website:http://www.netgameorb.com/

  8. #8438
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Standard

    yes, which only scrolls left but doesn't move any off the images Blitted (apart from the player image )

  9. #8439
    NetGameOrb Maker
    Points: 6.138, Level: 50
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    New York
    Beiträge
    683
    Points
    6.138
    Level
    50
    My Mood
    Cheerful
    Downloads
    2
    Uploads
    0

    Standard

    than maybe you can clear the screen when the player reache the 260 x coordinate and then blit the map again with the new coordinate
    for example

    a = grass
    b = bush
    p = player
    "
    aaaaaaaaa
    aabaapaaa
    aaaaaaaaa
    '
    when map look like this

    aaaaaaaaa
    aabapaaaa
    aaaaaaaaa

    and player press left then map schouold look like this

    '
    aaaaaaaaa
    aaabpaaaa
    aaaaaaaaa

    so really you are moving the map insted of the player

    sorry if i am not clear if you wait a moment i try to make a code for you
    GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.

    Stats Blog:http://netgameorb.blogspot.com/
    Website:http://www.netgameorb.com/

  10. #8440
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    -- This will stop any currently playing song
    -- Load and play a random one from PSP/MUSIC/ folder
    function PlayRandomSong()
    	-- get the files and folders in our music folder
    	mp3List = System.listDirectory("ms0:/PSP/MUSIC/")
    
    	--remove all non-mp3 items in the folder
    	i = 1
    	while i <= table.getn(mp3List) do
    		if string.lower(string.sub(mp3List[i].name, -4)) ~= ".mp3" then 
    			table.remove(mp3List, i)
    		else
    			i = i + 1
    		end
    	end
    
    	if table.getn(mp3List) > 0 then	--if there is atleast 1 song to play
    		Mp3me.Stop()
    		Mp3me.load(mp3List[math.random(1,table.getn(mp3List))].name) --load a random mp3 from the list
    		Mp3me.play()
    	end
    end
    fixed it up a bit, changed how it does the loop to avoid not knowing how lua does it compared to C etc

  11. #8441
    NetGameOrb Maker
    Points: 6.138, Level: 50
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    New York
    Beiträge
    683
    Points
    6.138
    Level
    50
    My Mood
    Cheerful
    Downloads
    2
    Uploads
    0

    Standard

    //here load your map make sure it larger than 272 in length
    map = Image.load("map.png")

    //here you load player
    player = Image.load("player.png")

    //here you have player x and y value
    Px=220
    Py=250

    //here you have the current postion in the map
    mapx = 480
    mapy = 272

    while true do
    pad = Controls.read()

    //here we clean up the screen so we could prepare to blit the new map postion
    screen:clear()

    //here we blit the map from were we are in the map picture
    screen:blit(0, 0, map, [maplx, maply, 480, 272], [alpha = true])

    //here we blit the player
    screen:blit(px, py, player)

    //here we check if the player x postion is greated than 270 so if it is then we will change the new position of the map
    if pad:left() and Px > 270 then
    mapx = mapx + 1
    end
    end
    this is just a example of a scrolling map so it may have some error due to the fact i was doing it in a rush so modifi it as you like
    GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.

    Stats Blog:http://netgameorb.blogspot.com/
    Website:http://www.netgameorb.com/

  12. #8442
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TurtlesPwn
    Code:
    -- This will stop any currently playing song
    -- Load and play a random one from PSP/MUSIC/ folder
    function PlayRandomSong()
    	-- get the files and folders in our music folder
    	mp3List = System.listDirectory("ms0:/PSP/MUSIC/")
    
    	--remove all non-mp3 items in the folder
    	i = 1
    	while i <= table.getn(mp3List) do
    		if string.lower(string.sub(mp3List[i].name, -4)) ~= ".mp3" then 
    			table.remove(mp3List, i)
    		else
    			i = i + 1
    		end
    	end
    
    	if table.getn(mp3List) > 0 then	--if there is atleast 1 song to play
    		Mp3me.Stop()
    		Mp3me.load(mp3List[math.random(1,table.getn(mp3List))].name) --load a random mp3 from the list
    		Mp3me.play()
    	end
    end
    fixed it up a bit, changed how it does the loop to avoid not knowing how lua does it compared to C etc
    thanks for this, it is greatly appreciated, ill mention both you and sg in my credits!!!:Jump:


    --edit--
    im having trouble, i am using a lua script from bumper harvest, and i add this under the functions, and it does not seem to load, i have tried adding it to many different places, but no luck, if you have a fix for this it would be nice
    Geändert von ifiwere1337 (04-04-2008 um 11:08 AM Uhr)
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

  13. #8443
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von ifiwere1337
    thanks for this, it is greatly appreciated, ill mention both you and sg in my credits!!!:Jump:


    --edit--
    im having trouble, i am using a lua script from bumper harvest, and i add this under the functions, and it does not seem to load, i have tried adding it to many different places, but no luck, if you have a fix for this it would be nice
    i think that where it says the math.random bit you need it in a math.floor so that is is an actual number with no decimals

    edit:

    i just tested it and that isn't the problem, make sure its above while true do and use the correct name with the same case for all of the words

    e.g. if it is Word dont use word
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  14. #8444
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG
    i think that where it says the math.random bit you need it in a math.floor so that is is an actual number with no decimals

    edit:

    i just tested it and that isn't the problem, make sure its above while true do and use the correct name with the same case for all of the words

    e.g. if it is Word dont use word
    im not sure what you mean, could you elaborate?
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

  15. #8445
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von ifiwere1337
    im not sure what you mean, could you elaborate?
    it wasnt what i origionally thought but make sure it is like this when you use it

    PlayRandomSong()

    and not like this

    playrandomsong()
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  16. #8446
    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 TurtlesPwn
    Code:
    -- This will stop any currently playing song
    -- Load and play a random one from PSP/MUSIC/ folder
    function PlayRandomSong()
        -- get the files and folders in our music folder
        mp3List = System.listDirectory("ms0:/PSP/MUSIC/")
    
        --remove all non-mp3 items in the folder
        i = 1
        while i <= table.getn(mp3List) do
            if string.lower(string.sub(mp3List[i].name, -4)) ~= ".mp3" then 
                table.remove(mp3List, i)
            else
                i = i + 1
            end
        end
    
        if table.getn(mp3List) > 0 then    --if there is atleast 1 song to play
            Mp3me.Stop()
            Mp3me.load(mp3List[math.random(1,table.getn(mp3List))].name) --load a random mp3 from the list
            Mp3me.play()
        end
    end
    fixed it up a bit, changed how it does the loop to avoid not knowing how lua does it compared to C etc
    I didn't know Lua had a tolower or toupper string member. Neat :) And ya thx for the fix up, I expected no less ;)

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


  17. #8447
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG
    it wasnt what i origionally thought but make sure it is like this when you use it

    PlayRandomSong()

    and not like this

    playrandomsong()
    okay i changed playrandomsong() to PlayRandomSong(), and it still wont work, i dont know why, but it is getting really annoying trying to fix this
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

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

    ifiwere1337 - Post your usage, and keep in mind how bumper harvest's program flow is (it might have nested inifinite loops, etc. keeping it from running)

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


  19. #8449
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    ifiwere1337 - Post your usage, and keep in mind how bumper harvest's program flow is (it might have nested inifinite loops, etc. keeping it from running)
    kk just a minute
    code removed due to length
    Geändert von ifiwere1337 (04-06-2008 um 05:34 PM Uhr)
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

  20. #8450
    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

    ifiwere1337... I didn't say post the entire source, I said post the usage of it. And strangely enough you aren't even using it. I highly suggest you learn a little more before you do stuff like this, it makes alot of people's head aches less frequent when that happens. I made you a function, you have yet to actually call it / use it.

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


  21. #8451
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von ifiwere1337
    kk just a minute

    i didnt know what parts to add so i put them all
    Umm, you need to call it from somewhere...

    EDIT: Beaten.

  22. #8452
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    ifiwere1337... I didn't say post the entire source, I said post the usage of it. And strangely enough you aren't even using it. I highly suggest you learn a little more before you do stuff like this, it makes alot of people's head aches less frequent when that happens. I made you a function, you have yet to actually call it / use it.
    ah damnit, lol sorry a newb mistake, ill try and fix it, sorry for the waste of time, im only learning


    ---edit---

    now i have a prob, i added a line to call the function PlayRandonSong() and all i get is an error on lua player, what i am wondering is if i need to put anything in the parentheses or not?
    Geändert von ifiwere1337 (04-06-2008 um 06:01 PM Uhr)
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

  23. #8453
    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

    Paste the error... seems like common sense when something goes wrong doesn't it? ;)

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


  24. #8454
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    Paste the error... seems like common sense when something goes wrong doesn't it? ;)
    oops sorry on the lua player screen it says this

    Error: index.lua:24 : attempt to call field 'stop' (a nil value)
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

  25. #8455
    Points: 2.588, Level: 30
    Level completed: 92%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    5
    Points
    2.588
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von ifiwere1337
    oops sorry on the lua player screen it says this
    i think it is the way you put it like when you put "stop" is should be "Stop" or something.

    but i dont know because im new to this. i only started learning today but i had to register to see these threads, which are very helpful by the way thank you qj'ers.

    have fun

    wolfy

  26. #8456
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lone_Wolf_O_o
    i think it is the way you put it like when you put "stop" is should be "Stop" or something.

    but i dont know because im new to this. i only started learning today but i had to register to see these threads, which are very helpful by the way thank you qj'ers.

    have fun

    wolfy
    never thought to check that, i seen stop, but didnt think Stop

    --edit--
    no it is Stop, but i took the media engine off and ill try that


    --edit--

    nope its not the media engine thats stopping it
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

  27. #8457
    Points: 2.588, Level: 30
    Level completed: 92%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    5
    Points
    2.588
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    hmm ok then maybe it is this bit

    Code:
            Mp3me.Stop()
            Mp3me.load(mp3List[math.random(1,table.getn(mp3List))].name) --load a random mp3 from the list
            Mp3me.play()
    maybe you cant stop it before loading or playing it

  28. #8458
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lone_Wolf_O_o
    hmm ok then maybe it is this bit

    Code:
            Mp3me.Stop()
            Mp3me.load(mp3List[math.random(1,table.getn(mp3List))].name) --load a random mp3 from the list
            Mp3me.play()
    maybe you cant stop it before loading or playing it
    okay that got rid of that error, but now i have a new error

    Error: index.lua : 25: can't open sound file ms0/PSP/GAME/Bumper Harvest-pegglemod/Led Zepplin - Led Zeppelin - Rock and Roll.mp3.
    the problem is that the player thinks that the song is in the game folder, and i want it to recognize it in the PSP/MUSIC folder.

    any help?
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]

  29. #8459
    Points: 2.588, Level: 30
    Level completed: 92%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Apr 2008
    Beiträge
    5
    Points
    2.588
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    mp3List = System.listDirectory("ms0:/PSP/MUSIC/")
    i think that should be

    Code:
    System.currentDirectory("ms0:/PSP/MUSIC/")
    mp3List = System.listDirectory()
    because i have just looked at a file browser example and that is what it was like
    -= Double Post =-
    wait i just looked at another one and that is fine so i dont think its that

    but it says its a problem loading.

    wouldn't that just load the song file from the current directory ?

    couldn't you just add a bit on

    Code:
    Mp3me.load(ms0:/PSP/MUSIC/mp3List[math.random(1,table.getn(mp3List))].name) --load a random mp3 from the list
    Geändert von Lone_Wolf_O_o (04-07-2008 um 12:02 PM Uhr) Grund: Automerged Doublepost

  30. #8460
    QJ Gamer Green
    Points: 5.889, Level: 49
    Level completed: 70%, Points required for next Level: 61
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    918
    Points
    5.889
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lone_Wolf_O_o
    Code:
    mp3List = System.listDirectory("ms0:/PSP/MUSIC/")
    i think that should be

    Code:
    System.currentDirectory("ms0:/PSP/MUSIC/")
    mp3List = System.listDirectory()
    because i have just looked at a file browser example and that is what it was like
    -= Double Post =-
    wait i just looked at another one and that is fine so i dont think its that

    but it says its a problem loading.

    wouldn't that just load the song file from the current directory ?

    couldn't you just add a bit on

    Code:
    Mp3me.load(ms0:/PSP/MUSIC/mp3List[math.random(1,table.getn(mp3List))].name) --load a random mp3 from the list
    OMG NOW IT WORKS, the only problem is that it is choppy, but the framerate of the game stays the same

    --edit--

    thanks all who helped, i will add you to my credits

    also if anyone can help me with a problem, i want to load a config file, called config.cfg

    say i want redballscore=20
    i put

    config 1
    12
    config 2
    123
    config ...
    1337
    redballscore
    20

    in the config file, and under redball score i put redballscore=config line8
    or something similar, is this possible with lua?
    Geändert von ifiwere1337 (04-07-2008 um 12:29 PM Uhr)
    My Projects
    [URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
    working on Zuno, an uno like game
    [QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]


 

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:54 AM Uhr.

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