-
Notifications
You must be signed in to change notification settings - Fork 2
Block Settings
For the mod to determine which type of blocks are actually used in-game they have to appear inside the blocks.xml! This can be as small as a <Sand /> mention! This is to prevent unneeded behaviours and function calls from being added to the game. If the blocks are "there" but they do not function chances are they are not enabled.
Certain blocks have a duration modifier that can be modified, certain blocks have a solid lever that can have its sides turned off. This is done via a blocks.xml file.
This file is located in the switchBlocksMod folder with the name blocks.xml
The file may begin with an xml header, but it is not needed. The Blocks tag however has to be the last element in the xml file.
You may then add any of the available block types as tag.
All block types can have the Multiplier tag that modifies the speed the animation associated with that type of block are played. The default multiplier is 1.0 making the animation take half a second to complete.
The block types:
AutoCountdownGroup
are blocks associated with a timed gimmick, these can additionally have the tags Duration and Warn. Group while associated with duration does not warn.
The Duration tag contains a float number. I am not preventing you from hurting yourself, so please insert a sensible number. Because the game takes 17ms per frame, realtime durations will be exactly 2% larger than the values you set. However you are limited by the 17ms update interval, durations will clamp to it. Keep this in mind if you want to sync anything.
As for the Warn tag it is used to specify properties related to the warn sound. The two properties that can be changed are
CountDuration
The Count being the setting for how often the sound plays and Duration the time between plays.
Under normal circumstances these blocks, as they are prone to certain weird behaviours will not switch until the player is not inside them making it safe to switch, if it is desired for the player to be able to abuse those weird behaviours you may add ForceStateSwitch as a tag. You can use the shorthand <ForceStateSwitch /> as the tag doesn't need anything inside it.
- Select music that has one solid tempo throughout
- Figure out the bpm (technically optional, but this lets you skip counting bars manually)
- Determine the amount of bars (#bars) either through math or counting. It's probably a multiple of 4
- Cut audio to loop perfectly (Audacity)
- Divide loop length by #bars to get a duration
- Multiply duration by 100/102, then round duration to the nearest 17ms, set this value in blocks.xml
- Multiply new duration by 102/100 and #bars to get a new loop length
- Speed up/down song to match the new loop length as closely as possible (Audacity)
- Sync up the start of the song with the auto timer in-game using a forcibly synced screen transition
- This may be good enough for your purposes, but will likely still be off. If you want to improve it further, then record footage in-game and figure out the exact length you need the music loop to be, and adjust the song length accordingly. This will take some trial and error to perfect and is a very tedious process. Bear in mind when you edit .mp3 files there will be about 40-45ms of silence added at the start each time.
Lastly, the audio quality will degrade if you shifted the tempo without the pitch in step 8, or it will be slightly out of tune if you adjust both (this only matters if for some reason you want to harmonize with other sounds)
The block types:
BasicCountdownGroupSandSequence
are blocks associated with a lever (or reset "lever") controlled gimmick, these can additionally have the tag LeverSideDisable.
The LeverSideDisable tag contains a comma separated list of directions you want to disable the lever from. This feature only works with solid levers, non-solid levers cannot have their side disabled.
Blocks like the group and sequence type have functionality tied to the platform, these similarly can have side disabled. The tag PlatformSideDisable should be used in this case.
The sides are:
UpDownLeftRight
An example file enabling blocks may look like this:
<?xml version="1.0"?>
<Blocks xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Auto />
<Basic />
</Blocks>
This would enable the auto and basic blocks behaviours in-game, other blocks like countdown, jump and sand would not function correctly.
An example file changing settings of the block may look like this:
<?xml version="1.0"?>
<Blocks xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Auto>
<Duration>10</Duration>
<Multiplier>2</Multiplier>
<Warn>
<Count>3</Count>
<Duration>0.5</Duration>
</Warn>
</Auto>
<Basic>
<Multiplier>0.5</Multiplier>
<LeverSideDisable>Down, Right</LeverSideDisable>
</Basic>
<Countdown>
<Duration>5</Duration>
</Countdown>
</Blocks>
This would set the duration of the auto block to 10 seconds and the countdown block to 5 seconds.
The animation speed multiplier of the auto block to 2 (animation takes 0.25 seconds to complete), and the basic block multiplier to 0.5. (animation takes 1 second to complete)
The amount of times the warn sound for the auto block is played to 3 as well as the duration before the sound is played to 0.5 seconds. The sound will play at 1.5, 1 and 0.5 seconds.
Disable the solid lever of the basic block from working if approached from down or right.
- The game may crash if a tag is used incorrectly
- If the duration is not specified the default duration will be three seconds
- The warn count default is 2
- The warn duration default is 1
- While in code just deltaTime is added and one would assume the animations take one second to complete, deltaTime in Jump King is twice as large.