2 Console
.Print(tostring(s
) .. "\n");
9 -- Just for debugging the new physics code...
12 runMapCmd("wait(3); crate_001:SetGravity(0, 0, "..grav
..");");
15 -- Load the console variables with persistent values.
17 CleanupPersistentConfig("config_p.lua");
18 local Result
, ErrorMsg
=loadfile("config_p.lua");
23 print("\nWarning: Error when running config_p.lua ("..ErrorMsg
..").\n");
28 -- Get the (sorted) list of files available as level intro music.
29 MusicFiles
=Console
.GetDir("Games/DeathMatch/Music", "f");
30 table.sort(MusicFiles
, function (s1
, s2
) return s1
:lower()<s2
:lower(); end); -- Sort the titles regardless of case.
32 -- Filter the list (not every file is a good candidate for level intro music) and add the full path.
34 for FileNr
, FileName
in ipairs(MusicFiles
) do
35 if ((FileName
:sub(-4, -1)==".ogg" or FileName
:sub(-4, -1)==".mp3") and FileName
:find("Franka Jones, Track3")==nil) then
36 LevelIntroTitles
[#LevelIntroTitles
+1]="Games/DeathMatch/Music/"..FileName
;
40 -- The client calls this function whenever the player enters a new level.
41 function StartLevelIntroMusic()
42 if (#LevelIntroTitles
==0) then return end;
46 -- Read the index number of the next title to play.
47 local File
=io
.open("Games/DeathMatch/Music/NextTitle.txt", "r");
50 NextTitleNr
=(File
:read("*number") or 0) % #LevelIntroTitles
;
54 -- Update the next index number count.
55 local File
=io
.open("Games/DeathMatch/Music/NextTitle.txt", "w");
58 File
:write((NextTitleNr
+1) % #LevelIntroTitles
);
62 MusicLoad(LevelIntroTitles
[NextTitleNr
+1]); -- First array index is 1, not 0.
68 function pts2csv(fileName
)
69 if fileName
:sub(-4, -1):lower()==".pts" then
70 -- Strip the .pts suffix, if present.
71 fileName
=fileName
:sub(1, -5);
74 -- Load and run the point file in order to obtain the Points table.
75 dofile(fileName
.. ".pts");
77 -- Write all points into a new csv file.
78 local csvFile
=assert(io
.open(fileName
.. ".csv", "w"));
80 csvFile
:write('"time","x","y","z","heading","info"\n');
82 csvFile
:write("\"", table.concat(Points
[i
], "\",\""), "\"\n");
89 -- sv_AutoAddCompanyBot=true;
93 sv_rc_password
="ca3de"; -- Change this for your own (dedicated) servers!
94 cl_rc_password
="ca3de";
97 print("config.lua processed.");