[HBM] Hitman: Blood Money Autosplitter
May 14, 2016 11:24:14 GMT
Post by lordazuel on May 14, 2016 11:24:14 GMT
Hello Everyone
I made a Livesplit autosplitter for Hitman: Blood Money.
To use it, save the code below into a text file. In Livesplit, add a Scriptable Auto Splitter component to your layout, and use the saved file as the script.
This code starts the timer on the first level load (after the loading screen). The timer resets when starting A Vintage Year.
Splits occurs when the game transitions to the post-mission screen. This does mean that the You Better Watch Out... level splits at the end of the helicopter cutscene. The split for Requiem works a bit differently, as this transition only occurs after the credits music sequence. Instead, the autosplitter checks that you've killed the required number of targets. This causes the split to happen at the start of the final cutscene.
Thanks to NoFaTe's Statman, which helped me identify relevant memory addresses.
Also, this script includes code for automatically removing load times (and is currently commented out). For whatever reason, I can't get Livesplit to pause during the loading screens, even though the logic seems to be correct.
Let me know how this works.
I made a Livesplit autosplitter for Hitman: Blood Money.
To use it, save the code below into a text file. In Livesplit, add a Scriptable Auto Splitter component to your layout, and use the saved file as the script.
This code starts the timer on the first level load (after the loading screen). The timer resets when starting A Vintage Year.
Splits occurs when the game transitions to the post-mission screen. This does mean that the You Better Watch Out... level splits at the end of the helicopter cutscene. The split for Requiem works a bit differently, as this transition only occurs after the credits music sequence. Instead, the autosplitter checks that you've killed the required number of targets. This causes the split to happen at the start of the final cutscene.
Thanks to NoFaTe's Statman, which helped me identify relevant memory addresses.
Also, this script includes code for automatically removing load times (and is currently commented out). For whatever reason, I can't get Livesplit to pause during the loading screens, even though the logic seems to be correct.
state("HitmanBloodMoney")
{
//Image base is at 0x400000
//level and time are set to 0 when starting, and only set to their actual values upon completing a level
int level : 0x5B2550;// absolute address 0x9B2550;
int time : 0x5B25D4; //
//this changes throughout a level
int npcs_remaining : 0x0059b864, 0x40;
//this shows where you are in the game (in a level, in a menu screen, in a loading screen, etc)
string30 scene : 0xFFD4D0CC; //0x0014D0cc; using a large offset to make it wrap around again.
}
start
{
//start the timer when any level starts
return !current.scene.Equals(old.scene) && current.scene.EndsWith("_main.prp");
}
reset
{
//reset an already started run when A Vintage Year starts
return !current.scene.Equals(old.scene) && current.scene.Equals("scenes/m01/m01_main.prp");
}
split
{
//most of the levels will end and set the time and level to non-zero values
//using time instead of level because Death of a Showman has a Level value of zero, so there's no change when the level ends
//In the final level, check that the number of npcs remaining has dropped low enough
return ((current.time != 0) && (old.time == 0)) || (current.scene.Equals("scenes/m13/m13_main.prp") && ((current.npcs_remaining == 1) && (old.npcs_remaining >= 2)));
}
isLoading
{
//the loading scene names end with .buf
//return current.scene.EndsWith(".buf");
return false;
}
init
{
//default refresh rate is 60 times per second
refreshRate = 60;
}
Let me know how this works.