Skip to content

Commit

Permalink
Uploaded main script
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovoyage authored Mar 11, 2023
1 parent 554a176 commit 7692cb4
Showing 1 changed file with 177 additions and 0 deletions.
177 changes: 177 additions & 0 deletions BMMX.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
print("// Generated by BMMX")
print("// the BEE2 Music Adder Script")

SamplePath = "custom/" -- don't change
TrackPath = "music/" -- don't change
ImgPath = "music_custom\\" --don't change
version = "2" --don't change
uniqueSuggestedStyles = {string}
style = {["BTS"]="BEE2_BTS",["Clean"]="BEE2_CLEAN_STYLE",["Clean_original"]="BEE2_CLEAN_STYLE:BEE2_CLEAN_ORIGINAL",["Clean_grass"]="BEE2_CLEAN_GRASSS_STYLE:BEE2_GRASS_CLEAN",["Overgrown"]="BEE2_OVERGROWN:BEE2_OVERGROWN",["P1"]="BEE2_PORTAL_1:BEE2_PORTAL_1",["Devstyle_grey"]="BEE2_DEV_STYLE:BEE2_DEV_GRAY",["Devstyle_lightgrey"]="BEE2_DEV_STYLE:BEE2_DEV_BRIGHT_GRAY",["Devstyle_orange"]="BEE2_DEV_STYLE:BEE2_DEV_ORANGE",["Devstyle"]="BEE2_DEV_STYLE:BEE2_DEV_ORIGINAL",["Devstyle_reflective"]="BEE2_DEV_STYLE:BEE2_DEV_REFLECTIVITY",["Devstyle_white"]="BEE2_DEV_STYLE:BEE2_DEV_WHITE",["Gmod"]="BEE2_DEV_STYLE:BEE2_GMOD",["Rattman"]="BEE2_DEV_STYLE:BEE2_RATMAN_Drgregs",["OldAperture_50s"]="BEE2_OLD_AP:BEE2_1950s",["OldAperture_60s"]="BEE2_OLD_AP:BEE2_1960s",["OldAperture_70s"]="BEE2_OLD_AP:BEE2_1970s",["OldAperture_80s"]="BEE2_OLD_AP:BEE2_1980s"} --dont change, suggestion styles
styleAuthors = {["BTS"]="TeamSpen210",["Clean"]="Valve, Carl Kenner, TeamSpen210, Valve, Valve",["Clean_original"]="Valve",["Clean_grass"]="joethegamer",["Overgrown"]="TeamSpen210",["P1"]="Carl Kenner, TeamSpen210, Carl Kenner, TeamSpen210, Valve, Valve, Valve, Valve, Valve, Valve",["Devstyle_grey"]="Drgregs", ["Devstyle_lightgrey"]="Drgregs", ["Devstyle_orange"]="Drgregs", ["Devstyle"]="Drgregs", ["Devstyle_reflective"]="Drgregs", ["Devstyle_white"]="Drgregs", ["Gmod"]="Drgregs", ["Rattman"]="VALVE, Drgregs.", ["OldAperture_50s"]="Carl Kenner, TeamSpen210, Critfish",["OldAperture_60s"]="Carl Kenner, TeamSpen210, Critfish",["OldAperture_70s"]="Carl Kenner, TeamSpen210",["OldAperture_80s"]="Carl Kenner, TeamSpen210"} --dont change, suggestion style authors
styleNames = {["BTS"]="Behind The Scenes",["Clean"]="Clean",["Clean_original"]="Clean (Original Textures)",["Clean_grass"]="Grass Clean",["Overgrown"]="Overgrown",["P1"]="Portal 1 Style",["Devstyle_grey"]="Gray Developer Style", ["Devstyle_lightgrey"]="Lighter Gray Developer Style", ["Devstyle_orange"]="Orange Developer Style", ["Devstyle"]="Original Developer Style", ["Devstyle_reflective"]="Reflective Developer Style", ["Devstyle_white"]="White Developer Style", ["Gmod"]="Garry's Mod Style", ["Rattman"]="Ratman", ["OldAperture_50s"]="1950s Old Aperture",["OldAperture_60s"]="1960s Old Aperture",["OldAperture_70s"]="1970s Old Aperture",["OldAperture_80s"]="1980s Old Aperture"} --dont change, suggestion style names

function verifyAllLists() --checks if any of the lists have quotes

for f=1,#Tracks do
if string.match(Tracks[f],"\"") then
error("Critical runtime exception: tracks list contains \" ! Instead, use the ' character!")
end
end

for f=1,#TrackLen do
if string.match(TrackLen[f],"\"") then
error("Critical runtime exception: lengths list contains \" ! Instead, use the ' character!")
end
end

for f=1,#TrackImgSmall do
if string.match(TrackImgSmall[f],"\"") then
error("Critical runtime exception: small image list contains \" ! Instead, use the ' character!")
end
end

for f=1,#TrackImgLarge do
if string.match(TrackImgLarge[f],"\"") then
error("Critical runtime exception: large image list contains \" ! Instead, use the ' character!")
end
end

for f=1,#TrackDescs do
if string.match(TrackDescs[f],"\"") then
error("Critical runtime exception: descriptions list contains \" ! Instead, use the ' character!")
end
end

for f=1,#TrackNames do
if string.match(TrackNames[f],"\"") then
error("Critical runtime exception: names list contains \" ! Instead, use the ' character!")
end
end

for f=1,#TrackSmallNames do
if string.match(TrackSmallNames[f],"\"") then
error("Critical runtime exception: short names list contains \" ! Instead, use the ' character!")
end
end

for f=1,#TrackAuthors do
if string.match(TrackAuthors[f],"\"") then
error("Critical runtime exception: authors list contains \" ! Instead, use the ' character!")
end
end

for f=1,#TrackFiles do
if string.match(TrackFiles[f],"\"") then
error("Critical runtime exception: full track filenames list contains \" ! Instead, use the ' character!")
end
end

for f=1,#TrackSamples do
if string.match(TrackSamples[f],"\"") then
error("Critical runtime exception: track sample filenames list contains \" ! Instead, use the ' character!")
end
end

end

--IMPORTANT:
--All following parameters MUST be filled in in the same order
--This means the first track in Tracks has the parameters of the
--First item of all the other lists here

--do not use the " symbol ANYWHERE IN THE LISTS, instead use '
--" causes BEE2 errors

--ALL filenames MUST include extensions
--.ogg appears to be supported but .wav, 44100 hertz, stereo always works

TrackIDPrefix = "" --prefix of the track IDs, i.e. "ambient" could cause conflicts, but "mde_ambient" would likely not
--adding an underscore to the end of the prefix is NOT NEEDED, it is automatically added
Tracks = {""} --all songs (IDs)
TrackLen = {""} --lengths of all songs, minutes:seconds (01:11 is not allowed, 1:11 is)
TrackImgSmall = {""} --all small imgs (1:1 ratio, square)
TrackImgLarge = {""} --all full images (4:3 ratio, rectangle)
TrackDescs = {""} --descriptions
TrackNames = {""} --full track names (>3 chars)
TrackSmallNames = {""} --short track names (<20 chars)
TrackAuthors = {""} --track authors
TrackFiles = {""} --track filenames
TrackSamples = {""} --track sample filenames, each must be EXACTLY 10 seconds long

TrackStyleSuggestion = "Clean" --style suggestion of all songs
suggestionsEnabled = true --self-explanatory
--alternatively you can set the suggestion to nil

Group = "" --name of group of these songs

PackageID = "" --software package ID
PackageName = "" --actual UI name
PackageDesc = "" --UI package desc

verifyAllLists()

print("\"ID\" " .. "\"" .. PackageID .. "\"")
print("\"Name\" ".."\""..PackageName.."\"")
print("\"Desc\" ".."\""..PackageDesc.."\"")

if suggestionsEnabled and TrackStyleSuggestion~=nil then --generation of suggestions, if enabled
print("")
print("\"Overrides\"")
print("{")
print("\"Style\"")
print("{")
print("\"ID\" ".."\""..style[TrackStyleSuggestion].."\"")
print("\"Authors\" ".."\""..styleAuthors[TrackStyleSuggestion].."\"")
print("\"Name\" ".."\""..styleNames[TrackStyleSuggestion].."\"")
print("\"Suggested\"")
print("{")
for u=1,#Tracks do
print("\"Music\" ".."\""..(TrackIDPrefix.."_"..Tracks[u]).."\"")
end
print("}")
print("}")
print("}")
end

for f=1,#Tracks do -- actual generator code
-- DO NOT ALTER ANYTHING HERE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING
print("// Generated by BMMX v."..version)

print("\"Music\"")
print("{")

print(" \"ID\" ".."\""..(TrackIDPrefix.."_"..Tracks[f]).."\"")
print(" \"Name\" ".."\""..TrackNames[f].."\"")
print(" \"ShortName\" ".."\""..TrackSmallNames[f].."\"")
print(" \"Group\" ".."\""..Group.."\"")
print(" \"Icon\" ".."\""..(ImgPath..TrackImgSmall[f]).."\"")
print(" \"IconLarge\" ".."\""..(ImgPath..TrackImgLarge[f]).."\"")
print("")
print(" \"Authors\" ".."\""..TrackAuthors[f].."\"")
print(" \"Sort_key\" ".."\""..f.."\"")
print(" \"Description\" ".."\""..TrackDescs[f].."\"")
print(" \"loop_len\" ".."\""..TrackLen[f].."\"")
print(" \"Sample\"")
print(" {")
print(" \"Base\" ".."\""..(SamplePath..TrackSamples[f]).."\"")
print(" }")
print(" \"SoundScript\"")
print(" {")
print(" \"Base\" ".."\""..(TrackPath..TrackFiles[f]).."\"")
print(" }")

print("}")

if f<#Tracks then
print("")
end

end

print("//Compile sequence ended")
print("Please copy all the logs until \"Compile sequence ended\" and paste them into a text file named \"info.txt\".")
print("Then put it in a ZIP. Create a folder named \"resources\". In it, make three folders: \"music_samp\", \"BEE2\" and \"sound\".")
print("In \"BEE2\", make another folder, called \"music_custom\". In it, place all the small and large images. They MUST have different filenames, e.g. \"track1-small.png\" and \"track1-large.png\".")
print("In \"music_samp\", make a folder called \"custom\". Put all the ten second-long samples there.")
print("In \"sound\", make a folder called \"music\". Put all the full sound files there.")
print("Then, optionally rename the archive to have \".bee_pack\" as its file extension. BEE2 will take either format for backwards compatibility, though, so this is purely optional.")

0 comments on commit 7692cb4

Please sign in to comment.