10 November 2014

Aion music player (ver 1.04) + more converted scripts for player

Someone may think: "Ha, 1.04 already? Seems he found a few bugs and decided share with fixes". NOPE! :P

Ok, but if seriously, what's new?
1. Property "author" in table s_info not required more, you can skip it if no need.
2. Multi-songs data scripts available now. What's means?
You can store few songs in one script. Two short songs in one slot if it's possible better than in two slots, right? :)
Short example:

-- callback function for OnSoundPlay event for music_01
function onsound01(channel, note, len, label)
-- your code
end

function my_music01
  return "t120 o5 a b c d e f g"
end

-- callback function for OnSoundPlay event for music_02
function onsound02(channel, note, len, label)
-- your code
end

function my_music02
  return "t120 o4 g f e d c b a"
end

-- this table must stay after our functions, better put it in last lines of codes
-- if you need callback for onsound event, type it here too or just skip it
-- also keep in mind "type" property must be "multi_music"
s_info={
  ["type"]="multi_music",["array"]=
  {
   {
    ["name"]="My awesome music 01",
    ["author"]="Aroch",
    ["temp"]=120,
    ["run"]=my_music01,
    ["onsound"]=onsound01
   },
   {
    ["name"]="My another, ok... not awesome - music 02",
    ["author"]="Aroch",
    ["temp"]=120,
    ["run"]=my_music02,
    ["onsound"]=onsound02
   }
  }
}

No comments:

Post a Comment