Skip to content

Latest commit

 

History

History
178 lines (114 loc) · 8.26 KB

MODDING.md

File metadata and controls

178 lines (114 loc) · 8.26 KB

Modding

Editing the XML files

Modifications of XML files are under Mods folder (./(10)trymemode.stormmap/base.stormdata/Mods).

Generally, You can override the XML Keys that the game has. The game will use your own version instead. However, you must follow the XML level structure similar to the game has. For example, to make Maiev's Fan of Knives (Q) to have no cooldown and do insane damage, your XML should look something like this:

<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
    <CAbilEffectTarget id="MaievFanOfKnives">
        <PrepEffect value="DismountDecloakCasterSet" />
        <Effect value="MaievFanOfKnivesInitialPersistent" />
        <Flags index="ClearLastAttackTargetOutOfRange" value="1" />
        <Flags index="RequireTargetVision" value="0" />
        <Cost>
        <Vital index="Energy" value="30" />
        <Cooldown TimeUse="0" />
        </Cost>
        <Range value="7.25" />
        <Arc value="360" />
        <CastIntroTime value="0.1" />
        <UninterruptibleArray index="Cast" value="1" />
        <UninterruptibleArray index="Channel" value="1" />
        <UninterruptibleArray index="Finish" value="1" />
        <CmdButtonArray index="Execute" DefaultButtonFace="MaievFanOfKnives" />
        <CursorRangeFlags index="ClampMin" value="1" />
        <CursorRangeFlags index="ClampMax" value="1" />
        <CursorEffect value="MaievFanOfKnivesSearchArea" />
    </CAbilEffectTarget>
    <CEffectDamage id="MaievFanOfKnivesDamage" parent="StormSpell">
        <MultiplicativeModifierArray index="MaievFanOfKnivesPinDown" Accumulator="MaievFanOfKnivesPinDownDamageAccumulator" />
        <MultiplicativeModifierArray index="RuthlessSpirit" Validator="MaievSpiritOfVengeanceRuthlessSpiritCombine" Accumulator="MaievSpiritOfVengeanceRuthlessSpiritDamageAccumulator" Crit="1" />
        <Amount value="9999999" />
    </CEffectDamage>
</Catalog>

All XML modifications must be inside the Mods folder (./(10)trymemode.stormmap/base.stormdata/Mods). Any subdirectories, file name, amount are not limited.

I also recommend using the tool buildxml to build the XML file, for more, see TOOLS.md.

Editing the Galaxy Script Files

Modifications of Galaxy files in (./(10)trymemode.stormmap/base.stormdata), same as where the custom command library located at.

I have also published the Modules_Editor.SC2Mod in (10)trymemode.stormmap/base.stormdata/Modules/ that you can open it in SC2 Editor, However due to some issues between SC2 Editor and Heroes (some functions and variables does not exist is both sides or even have incompatible function signature)

IMPORTANT: DO NOT do this to LibModuleLoader.galaxy and Module Loader in SC2Editor or the whole modding will fail.

Modifying Current Library Files:

  1. Change The Viewing mode to Triggers, or Pressing F6:

  2. Change Whatever you like in here, with some exceptions, see below:

  3. Please see the save and modify section below:

Adding New Galaxy Library:

Adding a New lib is also pretty simple:

  1. Adding a new Lib by right click on empty space:

  2. However, I do suggest you change the library ID to a 4 character ID:

  3. Change whatever you like on the first box and uncheck the "Auto Load":

  4. To Save, do the thing similar to above with Export and stuff but not replacing the file when saving. (Also place the new file on the same directory if possible)

  5. Modify the LibModuleLoader.galaxy file with a text editor (NOT the SC2 Editor):

  6. Append the new File without the .galaxy extension. For instance, if your file name is LibNice.galaxy, append the lane: include "Modules/LibNice

  7. Now we need to find the Lib init function by opening up the script file (Ctrl F11 or Data->View Script):

  8. Find the section // Library Initialization (usually at bottom) and copy this section (generally is libXXXXX_InitLib() depends on the name you changed above):

  9. Copy the code (function name) into the LibModuleLoader.galaxy in this section:

  10. Remove the space and add a semicolon at the end (*important) and save the file:

Dealing with Heroes Of the Storm Specific Functions:

Since Heroes is a modified SC2 Engine, it also have some functions that cannot be found on SC2 Editor such as SetTalentEnabled() which is a function to enable or disable a talent (Note: Don't be confused with SetTalentsEnabled() in SC2 Editor.)

Note: As well as some Functions from SC2 Editor is absent in Heroes, such as UnitItem, this will cause error in Heroes that the game cannot be loaded even though it is valid in SC2 editor.

To add the Heroes Specific script, in the Actions:

Select Custom Script:

And Type in the Heroes Code you want, Please also do check the parameter type and adding a semi-colon at the end (Note: It can also include the variables from Sc2Editor, such as lv_* for local variable and gv_* for global variable):

If you attempt to save the SC2Mod file (the one you currently opening in SC2Editor, not the galaxy file), it most likely complain and won't let you save:

To able to save the SC2Mod file, Please add //_heroes_replace// before the custom script:

Using the patchlibrary tool (Recommanded)

  1. When Save, Use the Export Functionality by going view script or Ctrl + F11:

  2. Click On File -> Export

  3. Select the corresponding galaxy file to replace and save (Note: Please do make sure you replace the correct file, as it will not able to launch the game if so.):

  4. Please see TOOLS.md for more details.

Manually modifying for heroes compatibility

This sections demonstrates how to remove the //_heroes_replace_// in SC2 Editor when exporting, allows for custom heroes functionalities.

  1. When Save, Use the Export Functionality by going view script or Ctrl + F11:

  2. After see this screen, Do a Find -> Replace or Ctrl + H:

  3. Type in //_heroes_replace_// for text and empty text box for Replace With and spam the Replace Button (Not Replace All) until it can no longer replace anymore:

  4. Close the Replace Dialog and export the file:

  5. Select the corresponding galaxy file to replace and save (Note: Please do make sure you replace the correct file, as it will not able to launch the game if so.):

Error and Debugging:

If you encounter stuff like this, mostly likely you have error on your galaxy files:

Map script error

Currently it is unable to call the Heroes' specific debug menu like in SC2, the best way to debug is mostly likely just to print out messages (Text Message).

SC2 debug window

Editing Asset Files (.dds)

If you loaded this map, you will noticed the loading screen have changed to our boy jimmy:

Try mode 2.0 loading screen

I recommend using a plugin NVIDIA Texture Tools for Adobe Photoshop to do edit the .dds files with Photoshop.

Note: When saving, remember to choose No MIP maps inside the MIP Map Generation section. (Took me a long time to figure it out why the texture is not loading.....)