Skip to content

Instantly share code, notes, and snippets.

@neivv

neivv/mtl.ini Secret

Last active August 10, 2023 11:51
Show Gist options
  • Save neivv/2b2851b91e697595f7936d69c71516da to your computer and use it in GitHub Desktop.
Save neivv/2b2851b91e697595f7936d69c71516da to your computer and use it in GitHub Desktop.
mtl.ini test example
[render]
;dont_override_shaders = true
[map]
enable_map_dat_files = true
#units_dat = 0, 1
# weapons_dat = 0
# flingy_dat = 0
# sprites_dat = 0
# upgrades_dat = 0
# techdata_dat = 0
# orders_dat = 0
# portdata_dat = 0
[buttons]
tooltip_half_supply = true
# Grayed-out button, Default: (1.0, 1.0, 1.0)
disabled_color = (2.0, 0.0, 0.0)
# Button that is currently being used by the player, Default: (2.0, 2.0, 2.0)
use_color = (0.2, 0.2, 0.8)
# Button that matches current order, Default: (2.0, 2.0, 2.0)
active_color = (0.0, 2.0, 0.0)
# Anything else, Default: (1.96, 1.96, 0.43)
enabled_color = (1.0, 0.0, 1.0)
[timers]
ensnare= 0x48
lockdown = 4800
hallucination_death = 100
unit_deaths = 2: 3000, 65: 250
[orders]
return_cargo_softcode = true
zerg_training = true
; <unit_id>, <attack_sprite_id>, <attack_sprite_directions>
bunker_unit = 0, 377, 8
bunker_unit = 1, 377, 8
bunker_unit = 0x10, 377, 8
bunker_unit = 0x14, 377, 8
bunker_unit = 0x63, 377, 8
bunker_unit = 0x64, 377, 8
bunker_unit = 0x68, 377, 8
bunker_unit = 10, 378, 16
bunker_unit = 32, 378, 16
bunker_unit = 55, 377, 8
[rally]
can_rally = 0x6a, 0x6f, 0x71, 0x72, 0x82, 0x83, 0x84, 0x85, 0x9a, 0xa0, 0xa7, 0x9b, 142
default_order = ground: 14, unit: rclick
unit.38 = ground: 116, unit: 116
[lighting]
#start = (1.0, 1.0, 1.0)
start = (0.0, 0.6, 0.6)
end = (0.0, 1.0, 1.0)
#cycle = 240
death = (0, 1)
;[upgrade.1.level.0]
; Rine
;units = 0
; Stacks with the units.dat default regen (Which is 4)
;hp_regen = 50
[upgrade.1.level.0]
; scv
units = 7
; Stacks with the units.dat default regen (Which is 4)
hp_regen = -96
state = animation(2, 5, 8)
[upgrade.1.level.0]
; geyser
units = 0xbc
resource_regen = -256
[upgrade.1.level.0]
; minerals
units = 0xb0, 0xb1, 0xb2
resource_regen = 256
[upgrade.1.level.1]
; Rine, scv, lot, arbi
units = 0, 7, 0x41, 71
; Works, but can't kill units yet.
; Also currently buggy with burn overlays if the unit doesn't have native regeneration.
;hp_regen = -10
; Stacks with default regen (7)
shield_regen = 50
; Stacks w/ default (8)
energy_regen = 40
[upgrade.1.level.1]
; Ghost
units = 1
state = self_cloaked
energy_regen = 40
[upgrade.1.level.1]
; Ghost
units = 1
state = arbiter_cloaked
energy_regen = -50
[upgrade.1.level.1]
; Hydra
units = 38
state = burrowed
hp_regen = 200
[upgrade.1.level.2]
; lot, arbi
units = 0x41, 71
cooldown = 10
[upgrade.1.level.1]
; rine
units = 0
cooldown = 100
set_unit_id = 20
[upgrade.3.level.1]
; hattu
units = 131
; Default 37
larva_timer = 130
[upgrade.3.level.2]
; hattu
units = 131
larva_timer = 6
[upgrade.3.level.2]
; scv
units = 7
; Default 75
mineral_harvest_time = 20
; Default 37
gas_harvest_time = 3
[upgrade.3.level.3]
; dropship
units = 11
; Default 15
; NOTE: Does not necessarily work all the time with AI
; Also doesn't work yet when clicking on status screen
unload_cooldown = 3
[upgrade.3.level.3]
; sunu, creep
units = 146, 143
; Default 15
creep_spread_timer = 5
[upgrade.15.level.1]
; Pylo
units = 156
; Note: Upgrade bonuses apply to completed units only if the state doesn't explicitly
; require incomplete
state = incomplete
shield_regen = 50
[upgrade.15.level.1]
; Cannon
units = 162
state = disabled
hp_regen = -40
[upgrade.15.level.1]
; Cannon
units = 162
; Note: All state requirements must match if there are multiple
state = disabled, incomplete
hp_regen = -400
[upgrade.15.level.2]
; Cannon
units = 162
state = damaged
hp_regen = -40
[upgrade.15.level.3]
; Cannon
units = 162
; Tower attack
state = order(0x13)
hp_regen = 400
[upgrade.9.level.0]
units = 0
condition = stim_timer > 0x10
hp_regen = 100
[upgrade.9.level.0]
units = 0
condition = stim_timer < 16 && stim_timer != 0
hp_regen = -100
[upgrade.9.level.0]
; scv
units = 7
mineral_harvest_time = hitpoints / 256
mineral_harvest_reduce = 3
mineral_harvest_carry = 88
gas_harvest_reduce = 250
gas_harvest_carry = 100
gas_harvest_carry_depleted = 5
[upgrade.9.level.0]
units = 131, 132, 133
;larva_timer = -1
state = incomplete
[upgrade.9.level.0]
units = 131, 132, 133
;larva_timer = -1
[upgrade.29.level.0]
units = 0
player_color_palette = (120, 121, 75, 3, 0, 0, 0, 4)
condition = stim_timer > 1
;units = 229
player_color = ((sin(frame_count * 360 / 60) + 256) / 4 + 128, (sin(frame_count * 360 / 120 + 120) + 256) * 2 / 5 + 32, (sin(frame_count * 360 / 240 + 240) + 256) * 5 / 12 + 30)
[upgrade.29.level.0]
; ht
units = 67
show_energy = 0
[upgrade.29.level.1]
; ht
units = 67
show_energy = 1
show_shields = 0
# Default weapon tooltip. Variables are written as {variable_name}
# Alternate syntax {variable@id} allows using preset weapon id, which
# is useful for carriers and reavers as shown below.
# Valid variables:
# weapon_name, damage, damage_type, base_weapon_upgrade_bonus, weapon_upgrade_bonus,
# weapon_upgrade_name, cooldown
# Newlines can be used with \n, ascii code (color) NN as \xNN
[status_screen.weapon]
text = {weapon_name}\nDamage: {damage}{weapon_upgrade_bonus} ({damage_type})
[status_screen.weapon]
units = 65, 77, 10, 32
text = {weapon_name}\nDamage: {damage*2}{weapon_upgrade_bonus*2} ({damage_type})
# Armor variables:
# armor_upgrade_name, base_armor, armor_upgrade_bonus, armor_type
# {variable@id} for these refers to unit id
[status_screen.armor]
text = {armor_upgrade_name}\nArmor: {base_armor}{armor_upgrade_bonus} ({armor_type})
# Shield variables:
# shield_upgrade_bonus
[status_screen.shields]
text = Protoss Plasma shields\nShields: 0{shield_upgrade_bonus}
# Can have unit-specific tooltips
# Special tooltips are used by carriers, reavers, vultures, nuke silos (anything else?)
[status_screen.special]
units = 72, 82
text = Interceptors\nDamage: {damage@79}{weapon_upgrade_bonus@79} ({damage_type@79})
[status_screen.special]
units = 81, 83
text = Scarabs\nDamage: {damage@82}{weapon_upgrade_bonus@82} ({damage_type@82})
# The tooltips are looked up in following order, taking the first one that is found.
# If there are multiple tooltips which tie (e.g. different conditions that both match),
# The one that is *later* in config file has priority.
# 1) Weapon-specific tooltip with a condition (Weapon tooltips only)
# 2) Weapon-specific tooltip without condition (Weapon tooltips only)
# 3) Unit-specific tooltip with a condition
# 4) Unit-specific tooltip without condition
# 5) Global tooltip with a condition
# 6) Global tooltip without condition
# 7) BW default handling
[status_screen.weapon]
units = 0, 1
text = gun\nDamage: \x03{damage}{damage}\n\x05:D
# Can have same conditions as upgrades, making tooltip only show if the condition is met.
[status_screen.weapon]
units = 0, 1
text = :Ð\n\n\nStim :D
condition = stim_timer > 0
# Weapon tooltips can be also overridden by weapon id
[status_screen.weapon]
weapons = 16, 18
text = Wraith laser :O\nUpgrade is {weapon_upgrade_name}. It gives {base_weapon_upgrade_bonus} extra damage per level !!!\nAnd cooldown is {cooldown} :OOOOOOOOO
[sound_remaps]
0x7a = 408
666 = 667 if upgrade(player, 1) > 0
142 = 136 if upgrade(player, 1) > 0
143 = 136 if upgrade(player, 1) > 0
144 = 136 if upgrade(player, 1) > 0
145 = 136 if upgrade(player, 1) > 0
148 = 136 if upgrade(player, 1) > 0
[aura]
radius = 128
source_unit = 86
affected_players = 13
shield_regen = 256
source_condition = (upgrade(player, 57) == 2) && (ground_cooldown == 2)
target_condition = (unit_id == 65 || unit_id == 66 || unit_id == 67 || unit_id == 68 || unit_id == 70 || unit_id == 71 || unit_id == 72 || unit_id == 73 || unit_id == 77 || unit_id == 78 || unit_id == 79 || unit_id == 80 || unit_id == 81 || unit_id == 82 || unit_id == 83 || unit_id == 86 || unit_id == 87 || unit_id == 88 || unit_id == 92)
[aura]
# Uses more circular radius based on BW's slightly inaccurate distance algorithm (Default is square)
radius = bw_circle 128
source_unit = 0
affected_players = 13
# Image id 365, spawned above main image
overlay = 365
# Spawned below main image; uses 361, 362, or 363 depending on units.dat overlay size flags
underlay = with_dat_size 361
[lighting]
# Multipliers for Red/Green/Blue
start = (1.0, 1.0, 1.0)
end = (1.0, 1.0, 1.0)
# Time in frames it takes to cycle start->end->start
cycle = 240
# Optional. If `death` is set then the cycle speed depends on deaths of player+unit id. Meant to be used with triggers.
# Below makes cycle speed linked to deaths of player 0 (red)'s ghosts
death = (0, 1)
#This is probably mostly useful in campaign maps combined with mtl_map.ini for different settings to each map.
# > [lighting] section has now new value config_death, which specifies an unit id whose deaths (of all players) are reserved for lighting config
# > Depending on value that P1 deaths are set to, different things will happen; mtl resets the P1 deaths to 0 afterwards
# > - 1: Set lighting cycle position; value = P2 deaths
# > - 2: Set cycle position at which lighting change stops; value = P2 deaths
# > - 3: Clear stop position set by above command
# > - 4: Set cycle length; value = P2 deaths
# > - 5: Set start / end colors; start = P2/3/4 deaths (0-255 each), end = P5/6/7 deaths
# > - 6: Move lighting to color over X frames and stop; color = P2/3/4 deaths, frames = P5 deaths
# > - 7: write to P1 deaths and next frame there will be current color in P2/3/4 deaths and current cycle in P5
#
# > for example to do what you wanted, say you had cycle = 500
# > add config_death = 186, then
#
# > set game.deaths(0, 186) = 1
# > set game.deaths(1, 186) = 250
# > for one extreme and
#
# > set game.deaths(0, 186) = 1
# > set game.deaths(1, 186) = 0
# > for other
#
# > or through triggers of course, just used AICE code for clarity (or confusion? since AICE has 0-based players and I documented above with 1-based)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment