Skip to content

HookModules

Ivan Montiel edited this page Apr 3, 2015 · 3 revisions

Introduction

Hook modules are the core of GPTP: they allow modders to directly alter how StarCraft works. The following table lists basic information about the hook modules.

Hook Module List

General Modding

Hook Module Editable Source File Description
Apply Upgrade Flags hooks/apply_upgrade_flags.cpp Controls movement speed/attack speed upgrades
Building Morph hooks/building_morph.cpp Control which buildings can morph into other buildings
Bunker hooks/bunker_hooks.cpp Determine which unit can attack from inside Bunkers; Which sprite overlays are used for units attacking inside Bunkers
Cloak Nearby Units hooks/cloak_nearby_units.cpp Control Arbiters' AoE cloaking field
Cloak Tech hooks/cloak_tech.cpp Determine which units can use the Cloaking Field / Personnel Cloaking tech
Consume hooks/consume.cpp Control Consume target check and spell effects
Detector hooks/detector.cpp Control detector requirement and detection range
Game Hooks hooks/game_hooks.cpp Generic hook functions for modding
Resource Harvest hooks/harvest.cpp Resource amount harvested / carried by workers; Image ID used to represent resource chunks being carried
Psi Field hooks/psi_field.cpp Controls which units can provide Psi Fields
Rally Point hooks/rally_point.cpp Controls how rally points are set and used
Recharge Shields hooks/recharge_shields.cpp Shield recharge requirements; Shield recharge rate and energy cost
Spider Mine hooks/spider_mine.cpp Spider Mine targeting requirements; Spider Mine initial burrow delay
Stim Packs hooks/stim_packs.cpp Stim Packs HP cost and effects
Tech Target Check hooks/tech_target_check.cpp Target check for various tech spells; Tech use error messages
Transfer Tech & Upgrades hooks/transfer_tech_upgrades.cpp Determine which tech and upgrades are transferred by Mind Control
Unit Speed hooks/unit_speed.cpp Controls unit speed, acceleration, and turn speed, factoring in upgrades and status effects
Unit Morph hooks/unit_morph.cpp Control which unit can morph into other units
Update Status Effects hooks/update_status_effects.cpp Irradiate damage effect; Other various status effects
Update Unit State hooks/update_unit_state.cpp HP and shield regeneration; Terran building burn-down rate; Attack delay after unburrowing; Unit energy regeneration rate; Cloaking energy consumption rate; Other unit timers
Weapon Cooldown hooks/weapon_cooldown.cpp Controls weapon cooldown, factoring in upgrades and status effects
Weapon Damage hooks/weapon_damage.cpp Control how weapon damage is applied to a unit. This modifies the behavior of CUnit::damageWith().
Fire Weapon hooks/weapon_fire.cpp Control how weapons are fired. This affects the behavior of CUnit::fireWeapon().

Unit Stats

Hook Module Editable Source File Description
Armor Bonus hooks/unit_stats/armor_bonus.cpp Controls unit armor upgrades
Maximum Energy hooks/unit_stats/max_energy.cpp Sets the maximum energy of a unit. Affects CUnit::getMaxEnergy().
Sight Range hooks/unit_stats/sight_range.cpp Controls unit sight range
Weapon Range hooks/unit_stats/weapon_range.cpp Weapon range upgrades (affects CUnit::getMaxWeaponRange()); Seek range (AKA target acquisition range) upgrades

Game Interface

Hook Module Editable Source File Description
Unit Tooltip hooks/unit_tooltip.cpp Customize the console tooltip text for unit weapon, armor, and shields
Clone this wiki locally