Skip to content

Commit

Permalink
custom track speed without patches
Browse files Browse the repository at this point in the history
  • Loading branch information
LlysiX committed Oct 9, 2022
1 parent 6d7f54d commit 187fa26
Show file tree
Hide file tree
Showing 5 changed files with 595 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Dependencies/DtxCS/Library/DTX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private static void ParseString(string data, DataArray root)
current.AddNode(new DataIfNDef(tmp_constant));
break;
case "include":
current.AddNode(new DataIfNDef(tmp_constant));
current.AddNode(new DataInclude(tmp_constant));
break;
case "merge":
current.AddNode(new DataMerge(tmp_constant));
Expand Down
10 changes: 5 additions & 5 deletions Dependencies/DtxCS/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# DtxCS
A C# library to parse and interpret the data-driven scripting language used in Harmonix games

"DTX" is the name I've decided to use to refer to the .dta/.dtb/.dtx/.\*\_dta\_\* scripting environment that's used in most of Harmonix's games,
including the Rock Band and Guitar Hero series.
"DTX" is used to refer to the .dta/.dtb/.dtx/.\*\_dta\_\* scripting environment that's used in most of Harmonix's games, including the Rock Band and Guitar Hero series.

This library provides an interface to load these scripts and use them from a C# environment. Preliminary support is included for using
the scripting functionality itself.
This library provides an interface to load these scripts and use them from a C# environment. This fork aims to continue to improve on maxton's efforts.

This fork aims to continue to improve on maxton's efforts.
## DTXTool

A command-line utility called DTXTool is provided as a way to convert and/or (en/de)crypt DTX format files.

## Supported Features
- Read data from plaintext DTA or serialized/encrypted DTB format
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 51 additions & 2 deletions RBVR Enhanced Launcher/RBVR Enhanced Launcher/RBVRELauncherApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void UpdateState()
{
groupBox2.Enabled = false;
groupBox3.Enabled = false;
tspeedMult.Text = "";
tspeedMult.Value = 0;
return;
}
else
Expand Down Expand Up @@ -97,6 +97,8 @@ private void buildButton_Click(object sender, EventArgs e)
Action<string> log = x => logBox.AppendText(x + Environment.NewLine);
var rbvrExec = folderName.Text + "/rbvr.exe";
var rbvrPatchDir = folderName.Text + "/rawfiles";
string rbvrtSpeedA = File.ReadAllText("track_graphics.dta");
var rbvrtSpeedB = folderName.Text + "/rawfiles/pc/config/include/track_graphics.dta_dta_pc";
Process rbvr = new Process();
rbvr.StartInfo.WorkingDirectory = folderName.Text;
rbvr.StartInfo.FileName = rbvrExec;
Expand All @@ -113,7 +115,49 @@ private void buildButton_Click(object sender, EventArgs e)
CopyPatches(patch, rbvrDir);
log($"Copying Patch {listBox1.Items[i]} to {folderName.Text}...");
}
log("Starting RBVR!");
if (tspeedMult.Value > 0)
{
if (File.Exists($"{rbvrPatchDir}/pc/config/include/track_graphics.dta_dta_pc"))
File.Delete($"{rbvrPatchDir}/pc/config/include/track_graphics.dta_dta_pc");

if (volumeAdjustCheckBox.Checked)
{
log($"adding track multiplier of {tspeedMult.Value} using RB1-RB4 Multiplier");
decimal ezspd = 2.4m / tspeedMult.Value;
decimal mdspd = 2.0m / tspeedMult.Value;
decimal hdspd = 1.6m / tspeedMult.Value;
decimal exspd = 1.2m / tspeedMult.Value;

Directory.CreateDirectory(rbvrPatchDir + "/pc/config/include/");

rbvrtSpeedA = rbvrtSpeedA.Replace("2.4", $"{ezspd}");
rbvrtSpeedA = rbvrtSpeedA.Replace("2.0", $"{mdspd}");
rbvrtSpeedA = rbvrtSpeedA.Replace("1.6", $"{hdspd}");
rbvrtSpeedA = rbvrtSpeedA.Replace("1.2", $"{exspd}");
}
else
{
log($"adding track multiplier of {tspeedMult.Value} using RBVR Multiplier");
decimal ezspd = 3.4m / tspeedMult.Value;
decimal mdspd = 3.0m / tspeedMult.Value;
decimal hdspd = 2.6m / tspeedMult.Value;
decimal exspd = 2.2m / tspeedMult.Value;

Directory.CreateDirectory(rbvrPatchDir + "/pc/config/include/");

rbvrtSpeedA = rbvrtSpeedA.Replace("2.4", $"{ezspd}");
rbvrtSpeedA = rbvrtSpeedA.Replace("2.0", $"{mdspd}");
rbvrtSpeedA = rbvrtSpeedA.Replace("1.6", $"{hdspd}");
rbvrtSpeedA = rbvrtSpeedA.Replace("1.2", $"{exspd}");
}

using (FileStream fs = File.Create(rbvrtSpeedB))
{
var tspeedA = DTX.FromDtaString(rbvrtSpeedA);
DTX.ToDtb(tspeedA, fs);
}
}
log("Starting RBVR!");
rbvr.Start();
}

Expand Down Expand Up @@ -164,5 +208,10 @@ private void noDeleteCheck_CheckedChanged(object sender, EventArgs e)
{

}

private void tspeedMult_ValueChanged(object sender, EventArgs e)
{

}
}
}
Loading

0 comments on commit 187fa26

Please sign in to comment.