http://wiki.heroesofhammerwatch.com/api.php?action=feedcontributions&user=Miss&feedformat=atomHeroes of Hammerwatch wiki - User contributions [en]2024-03-28T16:24:12ZUser contributionsMediaWiki 1.29.2http://wiki.heroesofhammerwatch.com/index.php?title=Packager&diff=2344Packager2020-05-18T11:00:35Z<p>Miss: /* Command line */</p>
<hr />
<div>The instructions below are outdated, Packager.exe in the game files now has a GUI, and you can right-click on mods to pack, or unpack as you want. You can also select from the commands at the top of the window to extract the base resources. <br />
<br />
The packager tool allows you to package a mod, but it also allows you to unpack or extract mods, as well as base the content from the <code>res/assets.bin</code> file. This is useful if you want to use any of our base resources such as units and scripts, in your mod, or use them as reference material.<br />
<br />
== Unpacking Resources ==<br />
<br />
First, start the packager tool. You will see several icons at the top and groups of mods below<br />
To unpack the base resources, simply click the icon at the top of the window that looks like a packing box, <br />
<br />
To Unpack a mod, locate the Mod you want to unpack from the selection in the main window, right click and "Unpack Mod"<br />
<br />
* '''Workshop''': These mods have been installed from the Steam Workshop. (If you're using the GoG build, you won't see this.)<br />
* '''Packed''': These are all mods packaged as .bin files in the "mods" folder. These can be downloaded and placed there manually.<br />
* '''Unpacked''': These are unpackaged mods organized as directories.<br />
<br />
=== GUI ===<br />
<br />
=== Command line === <br />
First, navigate to your Heroes of Hammerwatch installation folder. In this folder, hold down Shift and F10 at the same time to open the advanced shortcut menu. From here, select "Open command prompt here." (On Windows 10 this is Powershell.) You should now see the Windows command prompt in front of you, in the current folder. Then, run the following command, which will extract all files from <code>res/assets.bin</code> into the <code>assets</code> folder.<br />
<br />
<pre><br />
PACKAGER.exe --unpack=res/assets.bin --destination=unpacked_assets<br />
</pre><br />
<br />
On Powershell, you need to call it like this:<br />
<br />
<pre><br />
.\PACKAGER.exe --unpack=res/assets.bin --destination=unpacked_assets<br />
</pre><br />
<br />
Nothing will appear to happen, but it's currently extracting the assets in the background.<br />
<br />
[[File:Extracted.png|link=]]<br />
<br />
In Linux/Ubuntu:<br />
<br />
<pre><br />
./Packager --unpack=./res/assets.bin --destination=./unpacked_assets<br />
</pre><br />
For some errors in Linux/Ubuntu you may encounter, see [[Unpacking resources for Linux]]<br />
<br />
==== Mods ====<br />
The same process works for mods, except you pass the .bin file to the <code>--unpack</code> parameter. For example:<br />
<br />
<pre><br />
PACKAGER.exe --unpack=mods/trainer.bds --destination=mods/trainer<br />
</pre><br />
<br />
== Packing Mods ==<br />
<br />
=== Command line ===<br />
<br />
Follow the same steps as above however change --unpack to --resources, eg<br />
<br />
Windows Commandline :<br />
<pre><br />
Packager.exe --resources=assets --destination=new_assets.bin<br />
</pre><br />
<br />
Powershell: <br />
<pre><br />
./Packager.exe --resources=assets --destination=new_assets.bin<br />
</pre><br />
<br />
Linux<br />
<pre><br />
./Packager --resources=assets --destination=new_assets.bin<br />
</pre><br />
<br />
A full list of packager commandline help can be listed by using --help, the information is also listed below (note some information may be specific to SSBD rather than HOH) : <br />
<br />
<pre><br />
Usage PACKAGER [/h] [/r < str >] [/l <str>] [/u <str>] [/d <str>] [--sval]<br />
<br />
/h, --help Show this help<br />
/r, --resourcces= <str> Pack Resources<br />
/l --level= <str> Pack Level<br />
/u --unpack= <str> Unpack resources/level<br />
/d --destination= <str> Unpack resources/level destination<br />
--sval Extract (read-only) serialized scenario info as info.sval<br />
</pre><br />
<br />
=== Via GUI === <br />
<br />
First, start the packager tool. You will see several groups of mods:<br />
<br />
* '''Workshop''': These mods have been installed from the Steam Workshop. (If you're using the GoG build, you won't see this.)<br />
* '''Packed''': These are all mods packaged as .bin files in the "mods" folder. These can be downloaded and placed there manually.<br />
* '''Unpacked''': These are unpackaged mods organized as directories.<br />
<br />
You should see your mod in the '''Unpacked''' list. Right click it, and select "Make package". You will be prompted to save a .bin file. Pick any location and any name you want. You can either distribute this file manually, or distribute it via the Steam Workshop.<br />
<br />
== Sharing Mod Files to the Workshop == <br />
<br />
Once your mod is packaged, you can [[Uploading to the workshop|upload it to the Steam Workshop]].<br />
<br />
<br />
<br />
{{Template:BaseNav}}</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Unpacking_resources_for_Linux&diff=2295Unpacking resources for Linux2020-04-16T16:13:18Z<p>Miss: </p>
<hr />
<div>In Linux/Ubuntu in the more recent versions (~18.04), when trying to run Packager binary to unpack resources, you'll probably run into the following errors :<br />
<br />
<pre><br />
error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory<br />
error while loading shared libraries: libtiff.so.4: cannot open shared object file: No such file or directory<br />
</pre><br />
<br />
To solve this, try running the Packager through the Steam Runtime directly. For example:<br />
<br />
<pre>$ ~/.steam/debian-installation/ubuntu12_32/steam-runtime/run.sh ./Packager<br />
</pre><br />
<br />
Alternatively, you can install the missing libraries in your system (though they're old and that wouldn't make that much sense)<br />
<br />
The binary uses an old version of libpng so you'll have to install it. Unfortunately it isn't available directly on Ubuntu, so you'll need to add a ppa. [https://www.linuxuprising.com/2018/05/fix-libpng12-0-missing-in-ubuntu-1804.html Linuxuprising]'s ppa has a working version :<br />
<br />
<pre>sudo add-apt-repository ppa:linuxuprising/libpng12<br />
sudo apt update<br />
sudo apt install libpng12-0<br />
</pre><br />
<br />
As for libtiff, you can get it [https://launchpad.net/ubuntu/saucy/amd64/libtiff4/3.9.7-2ubuntu1 here], download libtiff4_3.9.7-2ubuntu1_amd64.deb package and installing it should work.</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Unpacking_resources_for_Linux&diff=2294Unpacking resources for Linux2020-04-16T16:12:58Z<p>Miss: </p>
<hr />
<div>In Linux/Ubuntu in the more recent versions (~18.04), when trying to run Packager binary to unpack resources, you'll probably run into the following errors :<br />
<br />
<pre><br />
error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory<br />
</pre><br />
<pre><br />
error while loading shared libraries: libtiff.so.4: cannot open shared object file: No such file or directory<br />
</pre><br />
<br />
To solve this, try running the Packager through the Steam Runtime directly. For example:<br />
<br />
<pre>$ ~/.steam/debian-installation/ubuntu12_32/steam-runtime/run.sh ./Packager<br />
</pre><br />
<br />
Alternatively, you can install the missing libraries in your system (though they're old and that wouldn't make that much sense)<br />
<br />
The binary uses an old version of libpng so you'll have to install it. Unfortunately it isn't available directly on Ubuntu, so you'll need to add a ppa. [https://www.linuxuprising.com/2018/05/fix-libpng12-0-missing-in-ubuntu-1804.html Linuxuprising]'s ppa has a working version :<br />
<br />
<pre>sudo add-apt-repository ppa:linuxuprising/libpng12<br />
sudo apt update<br />
sudo apt install libpng12-0<br />
</pre><br />
<br />
As for libtiff, you can get it [https://launchpad.net/ubuntu/saucy/amd64/libtiff4/3.9.7-2ubuntu1 here], download libtiff4_3.9.7-2ubuntu1_amd64.deb package and installing it should work.</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Incompatible_mod&diff=2183Incompatible mod2020-03-21T00:31:32Z<p>Miss: </p>
<hr />
<div>If your mod was marked as incompatible on the Steam Workshop, there can be several reasons for this. Most likely, your mod hasn't been updated in a while and doesn't work properly anymore.<br />
<br />
In this case, we'd like to ask you to contact one of the devs on [https://discord.gg/hammerwatch Discord] (probably Miss) about getting your item made compatible again. Make sure you update your item so that it works again and we can test it!<br />
<br />
You might also have re-uploaded an existing mod or translation file without any changes, which likely means it was uploaded by accident or something else. Either way, we don't want these showing up on the workshop as they could be incompatible with future versions of the game.</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Script_Hooks&diff=2109Script Hooks2020-01-20T16:20:34Z<p>Miss: </p>
<hr />
<div>Hooks are script functions that are called at specific moments. This way, you can insert code into the game.<br />
<br />
They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods.<br />
<br />
The following is an example of such a file:<br />
<br />
namespace MyTestMod<br />
{<br />
[Hook]<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
{<br />
print("Hello, world!");<br />
}<br />
}<br />
<br />
== GameModeConstructor ==<br />
void GameModeConstructor(Campaign@ campaign)<br />
Called when the Campaign gamemode is being constructed. Useful for initial setting up, for example to add new definitions for items, sets, shops, fountain effects, etc.<br />
<br />
== GameModeStart ==<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
Called in the Campaign gamemode's <code>Start()</code> function. This allows to initialize things and additionally loading any saved data saved in the <code>GameModeSave</code> hook using the <code>save</code> parameter. This paramater is null if there is no save.<br />
<br />
== GameModePostStart ==<br />
void GameModePostStart(Campaign@ campaign)<br />
Called in the Campaign gamemode's <code>PostStart()</code> function. This function is usually used to load things after all the unit behaviors have loaded in, and just before the player is ready to spawn.<br />
<br />
== GameModeUpdate ==<br />
void GameModeUpdate(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's update function. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
== GameModeRenderFrame ==<br />
void GameModeRenderFrame(Campaign@ campaign, int idt, SpriteBatch &sb)<br />
Called for each rendered frame before any UI is drawn. If you're looking for a hook called ''after'' the UI is drawn, use the <code>GameModeRenderWidgets</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is the current time in milliseconds since the last update tick, which means the value will be between 0 and 33. Divide this value by <code>33.0f</code> to get a normalized interpolation factor for animations.<br />
<br />
== GameModeUpdateWidgets ==<br />
void GameModeUpdateWidgets(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's widget updating function. Use this for widgets rather than <code>GameModeUpdate</code>, because this still gets called when the game is paused. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
(Added in b100 and onwards)<br />
<br />
== GameModeRenderWidgets ==<br />
void GameModeRenderWidgets(Campaign@ campaign, PlayerRecord@ player, int idt, SpriteBatch &sb)<br />
Called for each rendered frame after the UI is drawn. If you're looking for a hook called ''before'' the UI is drawn, use the <code>GameModeRenderFrame</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is described in the <code>GameModeRenderFrame</code> hook description. The <code>player</code> parameter specifies the player that the UI is currently being rendered for. This is typically the local player, but it can also be a different player for spectators.<br />
<br />
== GameModeSave ==<br />
void GameModeSave(Campaign@ campaign, SValueBuilder &builder)<br />
Save any gamemode info. Note that this is separate from town and player record saves. Gamemode saves contain only information necessary to switch from one level to another, or for drop-in multiplayer joining. Use <code>builder</code> to serialize data.<br />
<br />
== GameModeOnRunEnd ==<br />
void GameModeOnRunEnd(Campaign@ campaign, PlayerRecord@ record, bool died)<br />
Called when a player's run has ended. This can happen if the player dies, or if the player beats the game through the EndOfGame worldscript. The player whose run has ended is specified by the <code>record</code> parameter. The <code>died</code> parameter is true if the run has ended because of the player dying, or false if the game was beaten.<br />
<br />
== GameModeInitializePlayer ==<br />
void GameModeInitializePlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when the player record is initialized.<br />
<br />
== GameModeSpawnPlayer ==<br />
void GameModeSpawnPlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when a player has spawned. (B90+)<br />
<br />
== GameModePlayerDied ==<br />
void GameModePlayerDied(Campaign@ campaign, PlayerRecord@ player, PlayerRecord@ killer, DamageInfo &di)<br />
Called when a player dies. (B90+)<br />
<br />
== TownRecordSave ==<br />
void TownRecordSave(TownRecord@ record, SValueBuilder &builder)<br />
Called when the town record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== TownRecordLoad ==<br />
void TownRecordLoad(TownRecord@ record, SValue@ sval)<br />
Called when the town record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRecordSave ==<br />
void PlayerRecordSave(PlayerRecord@ record, SValueBuilder &builder)<br />
Called when a player record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== PlayerRecordLoad ==<br />
void PlayerRecordLoad(PlayerRecord@ record, SValue@ sval)<br />
Called when a player record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRecordRefreshItemSets ==<br />
void PlayerRecordRefreshItemSets(PlayerRecord@ record)<br />
Called when item sets are refreshed in a player record.<br />
<br />
(Added since b102)<br />
<br />
== PlayerRecordRefreshModifiers ==<br />
void PlayerRecordRefreshModifiers(PlayerRecord@ record)<br />
Called when modifiers are refreshed in a player record.<br />
<br />
(Added since b102)<br />
<br />
== PlayerRefreshScene ==<br />
void PlayerRefreshScene(PlayerBase@ player)<br />
Called each tick to make sure the player's unit scene is up to date. Useful if you want to add or attach any graphical element on top of the player unit.<br />
<br />
== WidgetHosterLoad ==<br />
void WidgetHosterLoad(IWidgetHoster@ host, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget hoster loaded its gui file. <code>host</code> specifies the host object that loaded the gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== WidgetHosterResourceAdded ==<br />
void WidgetHosterResourceAdded(Widget@ parent, Widget@ w, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget adds a resource gui file via <code>AddResource</code>. <code>parent</code> is the widget that the resource was added to as a child. <code>w</code> is the root widget of the added gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== LoadWidgetProducers ==<br />
void LoadWidgetProducers(GUIBuilder@ builder)<br />
Called when widget producers should be loaded. This allows you to initialize custom widget producers that can produce custom widgets. <code>builder</code> is where you would call <code>AddWidgetProducer</code> on to initialize the widget producer.<br />
<br />
(Added since b100 and)<br />
<br />
[[Category:Modding]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Mod_support&diff=2051Mod support2019-08-23T14:45:43Z<p>Miss: /* List of common resources */</p>
<hr />
<div>Welcome to the modding page! This page is dedicated to offering a list of important information to get started with modding Heroes of Hammerwatch.<br />
<br />
= Starting a mod =<br />
* [[Mod base|How to start]]<br />
* [[Info.xml|info.xml specification]]<br />
* [[Unpack resources|Unpacking resources]]<br />
<br />
= Editor =<br />
* [[Editor guide|Getting started with the editor]]<br />
<br />
= Mod examples =<br />
The following pages gives some common examples of basic mods you can make. These are great starting points if you're a beginner!<br />
<br />
* [[Custom items|How to make custom items]]<br />
* [[Custom Materials (Dyes)|How to make custom materials (player dyes)]]<br />
<br />
= Scripting =<br />
Everything in the game is powered by scripts. Getting used to the scripting language (AngelScript) will give you a lot of great insight on how to make more advanced mods.<br />
<br />
== Class models ==<br />
These are the class models that are defined in scripts that do not inherit from any base class directly. Their functions are automatically searched for by the engine and called if they exist.<br />
<br />
* [[WorldScript Class|WorldScript]]<br />
* [[GameMode Class|GameMode]]<br />
* [[Behavior Class|Behavior]]<br />
* [[Toolkit Class|Toolkit]]<br />
<br />
= Upload to workshop =<br />
When you're ready to publish your mod, read about [[Uploading to the workshop|how to upload to the Steam workshop]].<br />
<br />
= List of common resources =<br />
* [[Script Hooks]]<br />
* [[List of modifiers]]<br />
* [[SValue Loaders]]<br />
<br />
<!--<br />
===How to use:===<br />
*Assets<br />
*Tilemaps<br />
*Environment lighting<br />
====.unit,.effect & .inc====<br />
*Doodads<br />
*Actors<br />
*Items<br />
*Link child unit to inc. (Like the act walls!)<br />
====Worldscripts====<br />
*Linking worldscripts<br />
===How to put those into:===<br />
*Levels<br />
*Prefabs<br />
====How to put Prefabs into:====<br />
*Levels<br />
<br />
==Custom assets page==<br />
===How to add:===<br />
*Tilemaps<br />
*Doodads<br />
*Actors<br />
*Worldscripts<br />
<br />
===GUI===<br />
*GUI modification and creation<br />
*GUI scripts<br />
<br />
===Scripting===<br />
*Worldscript<br />
*Gamemode scripts<br />
--><br />
<br />
{{Template:BaseNav}}</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Mod_support&diff=2050Mod support2019-08-23T14:45:30Z<p>Miss: </p>
<hr />
<div>Welcome to the modding page! This page is dedicated to offering a list of important information to get started with modding Heroes of Hammerwatch.<br />
<br />
= Starting a mod =<br />
* [[Mod base|How to start]]<br />
* [[Info.xml|info.xml specification]]<br />
* [[Unpack resources|Unpacking resources]]<br />
<br />
= Editor =<br />
* [[Editor guide|Getting started with the editor]]<br />
<br />
= Mod examples =<br />
The following pages gives some common examples of basic mods you can make. These are great starting points if you're a beginner!<br />
<br />
* [[Custom items|How to make custom items]]<br />
* [[Custom Materials (Dyes)|How to make custom materials (player dyes)]]<br />
<br />
= Scripting =<br />
Everything in the game is powered by scripts. Getting used to the scripting language (AngelScript) will give you a lot of great insight on how to make more advanced mods.<br />
<br />
== Class models ==<br />
These are the class models that are defined in scripts that do not inherit from any base class directly. Their functions are automatically searched for by the engine and called if they exist.<br />
<br />
* [[WorldScript Class|WorldScript]]<br />
* [[GameMode Class|GameMode]]<br />
* [[Behavior Class|Behavior]]<br />
* [[Toolkit Class|Toolkit]]<br />
<br />
= Upload to workshop =<br />
When you're ready to publish your mod, read about [[Uploading to the workshop|how to upload to the Steam workshop]].<br />
<br />
= List of common resources =<br />
* [[ScriptHooks]]<br />
* [[List of modifiers]]<br />
* [[SValue Loaders]]<br />
<br />
<!--<br />
===How to use:===<br />
*Assets<br />
*Tilemaps<br />
*Environment lighting<br />
====.unit,.effect & .inc====<br />
*Doodads<br />
*Actors<br />
*Items<br />
*Link child unit to inc. (Like the act walls!)<br />
====Worldscripts====<br />
*Linking worldscripts<br />
===How to put those into:===<br />
*Levels<br />
*Prefabs<br />
====How to put Prefabs into:====<br />
*Levels<br />
<br />
==Custom assets page==<br />
===How to add:===<br />
*Tilemaps<br />
*Doodads<br />
*Actors<br />
*Worldscripts<br />
<br />
===GUI===<br />
*GUI modification and creation<br />
*GUI scripts<br />
<br />
===Scripting===<br />
*Worldscript<br />
*Gamemode scripts<br />
--><br />
<br />
{{Template:BaseNav}}</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Mod_support&diff=2049Mod support2019-08-23T14:40:13Z<p>Miss: </p>
<hr />
<div>Welcome to the modding page! This page is dedicated to offering a list of important information in a ladder to get around modding Heroes of Hammerwatch!<br />
<br />
= Modding resouces =<br />
== Starting a mod ==<br />
* [[Mod base|How to start]]<br />
* [[Info.xml|info.xml specification]]<br />
* [[Unpack resources|Unpacking resources]]<br />
<br />
== Editor ==<br />
* [[Editor guide|Getting started with the editor]]<br />
<br />
== Mod examples ==<br />
* [[Custom items|How to make custom items]]<br />
* [[Custom Materials (Dyes)|How to make custom materials (player dyes)]]<br />
<br />
== Scripting ==<br />
<br />
=== Class models ===<br />
These are the class models that are defined in scripts that do not inherit from any base class directly. Their functions are automatically searched for by the engine and called if they exist.<br />
<br />
*[[WorldScript Class|WorldScript]]<br />
*[[GameMode Class|GameMode]]<br />
*[[Behavior Class|Behavior]]<br />
*[[Toolkit Class|Toolkit]]<br />
<br />
== Upload to workshop ==<br />
[[Uploading_to_the_workshop|How to upload to the workshop]] <br />
<br />
= List of common resources =<br />
*[[Custom_items|Custom Items]]<br />
*[[Script_Hooks|Script Hooks]]<br />
*[[List_of_modifiers|List of modifiers]]<br />
*[[SValue_Loaders|SValue loaders]]<br />
<br />
<br />
<!--<br />
===How to use:===<br />
*Assets<br />
*Tilemaps<br />
*Environment lighting<br />
====.unit,.effect & .inc====<br />
*Doodads<br />
*Actors<br />
*Items<br />
*Link child unit to inc. (Like the act walls!)<br />
====Worldscripts====<br />
*Linking worldscripts<br />
===How to put those into:===<br />
*Levels<br />
*Prefabs<br />
====How to put Prefabs into:====<br />
*Levels<br />
<br />
<br />
==Custom assets page==<br />
===How to add:===<br />
*Tilemaps<br />
*Doodads<br />
*Actors<br />
*Worldscripts<br />
<br />
===GUI===<br />
*GUI modification and creation<br />
*GUI scripts<br />
<br />
===Scripting===<br />
*Worldscript<br />
*Gamemode scripts<br />
--><br />
<br />
{{Template:BaseNav}}</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Script_Hooks&diff=2048Script Hooks2019-08-15T01:46:23Z<p>Miss: /* GameModeUpdateWidgets */</p>
<hr />
<div>Hooks are script functions that are called at specific moments. This way, you can insert code into the game.<br />
<br />
They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods.<br />
<br />
The following is an example of such a file:<br />
<br />
namespace MyTestMod<br />
{<br />
[Hook]<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
{<br />
print("Hello, world!");<br />
}<br />
}<br />
<br />
== GameModeConstructor ==<br />
void GameModeConstructor(Campaign@ campaign)<br />
Called when the Campaign gamemode is being constructed. Useful for initial setting up, for example to add new definitions for items, sets, shops, fountain effects, etc.<br />
<br />
== GameModeStart ==<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
Called in the Campaign gamemode's <code>Start()</code> function. This allows to initialize things and additionally loading any saved data saved in the <code>GameModeSave</code> hook using the <code>save</code> parameter. This paramater is null if there is no save.<br />
<br />
== GameModePostStart ==<br />
void GameModePostStart(Campaign@ campaign)<br />
Called in the Campaign gamemode's <code>PostStart()</code> function. This function is usually used to load things after all the unit behaviors have loaded in, and just before the player is ready to spawn.<br />
<br />
== GameModeUpdate ==<br />
void GameModeUpdate(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's update function. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
== GameModeRenderFrame ==<br />
void GameModeRenderFrame(Campaign@ campaign, int idt, SpriteBatch &sb)<br />
Called for each rendered frame before any UI is drawn. If you're looking for a hook called ''after'' the UI is drawn, use the <code>GameModeRenderWidgets</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is the current time in milliseconds since the last update tick, which means the value will be between 0 and 33. Divide this value by <code>33.0f</code> to get a normalized interpolation factor for animations.<br />
<br />
== GameModeUpdateWidgets ==<br />
void GameModeUpdateWidgets(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's widget updating function. Use this for widgets rather than <code>GameModeUpdate</code>, because this still gets called when the game is paused. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
(Added in b100 and onwards)<br />
<br />
== GameModeRenderWidgets ==<br />
void GameModeRenderWidgets(Campaign@ campaign, PlayerRecord@ player, int idt, SpriteBatch &sb)<br />
Called for each rendered frame after the UI is drawn. If you're looking for a hook called ''before'' the UI is drawn, use the <code>GameModeRenderFrame</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is described in the <code>GameModeRenderFrame</code> hook description. The <code>player</code> parameter specifies the player that the UI is currently being rendered for. This is typically the local player, but it can also be a different player for spectators.<br />
<br />
== GameModeSave ==<br />
void GameModeSave(Campaign@ campaign, SValueBuilder &builder)<br />
Save any gamemode info. Note that this is separate from town and player record saves. Gamemode saves contain only information necessary to switch from one level to another, or for drop-in multiplayer joining. Use <code>builder</code> to serialize data.<br />
<br />
== GameModeOnRunEnd ==<br />
void GameModeOnRunEnd(Campaign@ campaign, PlayerRecord@ record, bool died)<br />
Called when a player's run has ended. This can happen if the player dies, or if the player beats the game through the EndOfGame worldscript. The player whose run has ended is specified by the <code>record</code> parameter. The <code>died</code> parameter is true if the run has ended because of the player dying, or false if the game was beaten.<br />
<br />
== GameModeInitializePlayer ==<br />
void GameModeInitializePlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when the player record is initialized.<br />
<br />
== GameModeSpawnPlayer ==<br />
void GameModeSpawnPlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when a player has spawned. (B90+)<br />
<br />
== GameModePlayerDied ==<br />
void GameModePlayerDied(Campaign@ campaign, PlayerRecord@ player, PlayerRecord@ killer, DamageInfo &di)<br />
Called when a player dies. (B90+)<br />
<br />
== TownRecordSave ==<br />
void TownRecordSave(TownRecord@ record, SValueBuilder &builder)<br />
Called when the town record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== TownRecordLoad ==<br />
void TownRecordLoad(TownRecord@ record, SValue@ sval)<br />
Called when the town record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRecordSave ==<br />
void PlayerRecordSave(PlayerRecord@ record, SValueBuilder &builder)<br />
Called when a player record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== PlayerRecordLoad ==<br />
void PlayerRecordLoad(PlayerRecord@ record, SValue@ sval)<br />
Called when a player record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRefreshScene ==<br />
void PlayerRefreshScene(PlayerBase@ player)<br />
Called each tick to make sure the player's unit scene is up to date. Useful if you want to add or attach any graphical element on top of the player unit.<br />
<br />
== WidgetHosterLoad ==<br />
void WidgetHosterLoad(IWidgetHoster@ host, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget hoster loaded its gui file. <code>host</code> specifies the host object that loaded the gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== WidgetHosterResourceAdded ==<br />
void WidgetHosterResourceAdded(Widget@ parent, Widget@ w, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget adds a resource gui file via <code>AddResource</code>. <code>parent</code> is the widget that the resource was added to as a child. <code>w</code> is the root widget of the added gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== LoadWidgetProducers ==<br />
void LoadWidgetProducers(GUIBuilder@ builder)<br />
Called when widget producers should be loaded. This allows you to initialize custom widget producers that can produce custom widgets. <code>builder</code> is where you would call <code>AddWidgetProducer</code> on to initialize the widget producer.<br />
<br />
(Added in b100 and onwards)<br />
<br />
[[Category:Modding]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Script_Hooks&diff=2047Script Hooks2019-08-15T01:46:00Z<p>Miss: </p>
<hr />
<div>Hooks are script functions that are called at specific moments. This way, you can insert code into the game.<br />
<br />
They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods.<br />
<br />
The following is an example of such a file:<br />
<br />
namespace MyTestMod<br />
{<br />
[Hook]<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
{<br />
print("Hello, world!");<br />
}<br />
}<br />
<br />
== GameModeConstructor ==<br />
void GameModeConstructor(Campaign@ campaign)<br />
Called when the Campaign gamemode is being constructed. Useful for initial setting up, for example to add new definitions for items, sets, shops, fountain effects, etc.<br />
<br />
== GameModeStart ==<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
Called in the Campaign gamemode's <code>Start()</code> function. This allows to initialize things and additionally loading any saved data saved in the <code>GameModeSave</code> hook using the <code>save</code> parameter. This paramater is null if there is no save.<br />
<br />
== GameModePostStart ==<br />
void GameModePostStart(Campaign@ campaign)<br />
Called in the Campaign gamemode's <code>PostStart()</code> function. This function is usually used to load things after all the unit behaviors have loaded in, and just before the player is ready to spawn.<br />
<br />
== GameModeUpdate ==<br />
void GameModeUpdate(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's update function. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
== GameModeRenderFrame ==<br />
void GameModeRenderFrame(Campaign@ campaign, int idt, SpriteBatch &sb)<br />
Called for each rendered frame before any UI is drawn. If you're looking for a hook called ''after'' the UI is drawn, use the <code>GameModeRenderWidgets</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is the current time in milliseconds since the last update tick, which means the value will be between 0 and 33. Divide this value by <code>33.0f</code> to get a normalized interpolation factor for animations.<br />
<br />
== GameModeUpdateWidgets ==<br />
void GameModeUpdateWidgets(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's widget updating function. Use this for widgets rather than <code>GameModeUpdate</code>, because this still gets called when the game is paused. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
== GameModeRenderWidgets ==<br />
void GameModeRenderWidgets(Campaign@ campaign, PlayerRecord@ player, int idt, SpriteBatch &sb)<br />
Called for each rendered frame after the UI is drawn. If you're looking for a hook called ''before'' the UI is drawn, use the <code>GameModeRenderFrame</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is described in the <code>GameModeRenderFrame</code> hook description. The <code>player</code> parameter specifies the player that the UI is currently being rendered for. This is typically the local player, but it can also be a different player for spectators.<br />
<br />
== GameModeSave ==<br />
void GameModeSave(Campaign@ campaign, SValueBuilder &builder)<br />
Save any gamemode info. Note that this is separate from town and player record saves. Gamemode saves contain only information necessary to switch from one level to another, or for drop-in multiplayer joining. Use <code>builder</code> to serialize data.<br />
<br />
== GameModeOnRunEnd ==<br />
void GameModeOnRunEnd(Campaign@ campaign, PlayerRecord@ record, bool died)<br />
Called when a player's run has ended. This can happen if the player dies, or if the player beats the game through the EndOfGame worldscript. The player whose run has ended is specified by the <code>record</code> parameter. The <code>died</code> parameter is true if the run has ended because of the player dying, or false if the game was beaten.<br />
<br />
== GameModeInitializePlayer ==<br />
void GameModeInitializePlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when the player record is initialized.<br />
<br />
== GameModeSpawnPlayer ==<br />
void GameModeSpawnPlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when a player has spawned. (B90+)<br />
<br />
== GameModePlayerDied ==<br />
void GameModePlayerDied(Campaign@ campaign, PlayerRecord@ player, PlayerRecord@ killer, DamageInfo &di)<br />
Called when a player dies. (B90+)<br />
<br />
== TownRecordSave ==<br />
void TownRecordSave(TownRecord@ record, SValueBuilder &builder)<br />
Called when the town record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== TownRecordLoad ==<br />
void TownRecordLoad(TownRecord@ record, SValue@ sval)<br />
Called when the town record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRecordSave ==<br />
void PlayerRecordSave(PlayerRecord@ record, SValueBuilder &builder)<br />
Called when a player record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== PlayerRecordLoad ==<br />
void PlayerRecordLoad(PlayerRecord@ record, SValue@ sval)<br />
Called when a player record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRefreshScene ==<br />
void PlayerRefreshScene(PlayerBase@ player)<br />
Called each tick to make sure the player's unit scene is up to date. Useful if you want to add or attach any graphical element on top of the player unit.<br />
<br />
== WidgetHosterLoad ==<br />
void WidgetHosterLoad(IWidgetHoster@ host, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget hoster loaded its gui file. <code>host</code> specifies the host object that loaded the gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== WidgetHosterResourceAdded ==<br />
void WidgetHosterResourceAdded(Widget@ parent, Widget@ w, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget adds a resource gui file via <code>AddResource</code>. <code>parent</code> is the widget that the resource was added to as a child. <code>w</code> is the root widget of the added gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== LoadWidgetProducers ==<br />
void LoadWidgetProducers(GUIBuilder@ builder)<br />
Called when widget producers should be loaded. This allows you to initialize custom widget producers that can produce custom widgets. <code>builder</code> is where you would call <code>AddWidgetProducer</code> on to initialize the widget producer.<br />
<br />
(Added in b100 and onwards)<br />
<br />
[[Category:Modding]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Script_Hooks&diff=2046Script Hooks2019-08-12T14:42:18Z<p>Miss: /* LoadWidgetProducers */</p>
<hr />
<div>Hooks are script functions that are called at specific moments. This way, you can insert code into the game.<br />
<br />
They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods.<br />
<br />
The following is an example of such a file:<br />
<br />
namespace MyTestMod<br />
{<br />
[Hook]<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
{<br />
print("Hello, world!");<br />
}<br />
}<br />
<br />
== GameModeConstructor ==<br />
void GameModeConstructor(Campaign@ campaign)<br />
Called when the Campaign gamemode is being constructed. Useful for initial setting up, for example to add new definitions for items, sets, shops, fountain effects, etc.<br />
<br />
== GameModeStart ==<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
Called in the Campaign gamemode's <code>Start()</code> function. This allows to initialize things and additionally loading any saved data saved in the <code>GameModeSave</code> hook using the <code>save</code> parameter. This paramater is null if there is no save.<br />
<br />
== GameModePostStart ==<br />
void GameModePostStart(Campaign@ campaign)<br />
Called in the Campaign gamemode's <code>PostStart()</code> function. This function is usually used to load things after all the unit behaviors have loaded in, and just before the player is ready to spawn.<br />
<br />
== GameModeUpdate ==<br />
void GameModeUpdate(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's update function. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
== GameModeRenderFrame ==<br />
void GameModeRenderFrame(Campaign@ campaign, int idt, SpriteBatch &sb)<br />
Called for each rendered frame before any UI is drawn. If you're looking for a hook called ''after'' the UI is drawn, use the <code>GameModeRenderWidgets</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is the current time in milliseconds since the last update tick, which means the value will be between 0 and 33. Divide this value by <code>33.0f</code> to get a normalized interpolation factor for animations.<br />
<br />
== GameModeRenderWidgets ==<br />
void GameModeRenderWidgets(Campaign@ campaign, PlayerRecord@ player, int idt, SpriteBatch &sb)<br />
Called for each rendered frame after the UI is drawn. If you're looking for a hook called ''before'' the UI is drawn, use the <code>GameModeRenderFrame</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is described in the <code>GameModeRenderFrame</code> hook description. The <code>player</code> parameter specifies the player that the UI is currently being rendered for. This is typically the local player, but it can also be a different player for spectators.<br />
<br />
== GameModeSave ==<br />
void GameModeSave(Campaign@ campaign, SValueBuilder &builder)<br />
Save any gamemode info. Note that this is separate from town and player record saves. Gamemode saves contain only information necessary to switch from one level to another, or for drop-in multiplayer joining. Use <code>builder</code> to serialize data.<br />
<br />
== GameModeOnRunEnd ==<br />
void GameModeOnRunEnd(Campaign@ campaign, PlayerRecord@ record, bool died)<br />
Called when a player's run has ended. This can happen if the player dies, or if the player beats the game through the EndOfGame worldscript. The player whose run has ended is specified by the <code>record</code> parameter. The <code>died</code> parameter is true if the run has ended because of the player dying, or false if the game was beaten.<br />
<br />
== GameModeInitializePlayer ==<br />
void GameModeInitializePlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when the player record is initialized.<br />
<br />
== GameModeSpawnPlayer ==<br />
void GameModeSpawnPlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when a player has spawned. (B90+)<br />
<br />
== GameModePlayerDied ==<br />
void GameModePlayerDied(Campaign@ campaign, PlayerRecord@ player, PlayerRecord@ killer, DamageInfo &di)<br />
Called when a player dies. (B90+)<br />
<br />
== TownRecordSave ==<br />
void TownRecordSave(TownRecord@ record, SValueBuilder &builder)<br />
Called when the town record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== TownRecordLoad ==<br />
void TownRecordLoad(TownRecord@ record, SValue@ sval)<br />
Called when the town record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRecordSave ==<br />
void PlayerRecordSave(PlayerRecord@ record, SValueBuilder &builder)<br />
Called when a player record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== PlayerRecordLoad ==<br />
void PlayerRecordLoad(PlayerRecord@ record, SValue@ sval)<br />
Called when a player record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRefreshScene ==<br />
void PlayerRefreshScene(PlayerBase@ player)<br />
Called each tick to make sure the player's unit scene is up to date. Useful if you want to add or attach any graphical element on top of the player unit.<br />
<br />
== WidgetHosterLoad ==<br />
void WidgetHosterLoad(IWidgetHoster@ host, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget hoster loaded its gui file. <code>host</code> specifies the host object that loaded the gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== WidgetHosterResourceAdded ==<br />
void WidgetHosterResourceAdded(Widget@ parent, Widget@ w, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget adds a resource gui file via <code>AddResource</code>. <code>parent</code> is the widget that the resource was added to as a child. <code>w</code> is the root widget of the added gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== LoadWidgetProducers ==<br />
void LoadWidgetProducers(GUIBuilder@ builder)<br />
Called when widget producers should be loaded. This allows you to initialize custom widget producers that can produce custom widgets. <code>builder</code> is where you would call <code>AddWidgetProducer</code> on to initialize the widget producer.<br />
<br />
(Added in b100 and onwards)<br />
<br />
[[Category:Modding]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Script_Hooks&diff=2045Script Hooks2019-08-12T14:41:56Z<p>Miss: </p>
<hr />
<div>Hooks are script functions that are called at specific moments. This way, you can insert code into the game.<br />
<br />
They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods.<br />
<br />
The following is an example of such a file:<br />
<br />
namespace MyTestMod<br />
{<br />
[Hook]<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
{<br />
print("Hello, world!");<br />
}<br />
}<br />
<br />
== GameModeConstructor ==<br />
void GameModeConstructor(Campaign@ campaign)<br />
Called when the Campaign gamemode is being constructed. Useful for initial setting up, for example to add new definitions for items, sets, shops, fountain effects, etc.<br />
<br />
== GameModeStart ==<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
Called in the Campaign gamemode's <code>Start()</code> function. This allows to initialize things and additionally loading any saved data saved in the <code>GameModeSave</code> hook using the <code>save</code> parameter. This paramater is null if there is no save.<br />
<br />
== GameModePostStart ==<br />
void GameModePostStart(Campaign@ campaign)<br />
Called in the Campaign gamemode's <code>PostStart()</code> function. This function is usually used to load things after all the unit behaviors have loaded in, and just before the player is ready to spawn.<br />
<br />
== GameModeUpdate ==<br />
void GameModeUpdate(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's update function. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
== GameModeRenderFrame ==<br />
void GameModeRenderFrame(Campaign@ campaign, int idt, SpriteBatch &sb)<br />
Called for each rendered frame before any UI is drawn. If you're looking for a hook called ''after'' the UI is drawn, use the <code>GameModeRenderWidgets</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is the current time in milliseconds since the last update tick, which means the value will be between 0 and 33. Divide this value by <code>33.0f</code> to get a normalized interpolation factor for animations.<br />
<br />
== GameModeRenderWidgets ==<br />
void GameModeRenderWidgets(Campaign@ campaign, PlayerRecord@ player, int idt, SpriteBatch &sb)<br />
Called for each rendered frame after the UI is drawn. If you're looking for a hook called ''before'' the UI is drawn, use the <code>GameModeRenderFrame</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is described in the <code>GameModeRenderFrame</code> hook description. The <code>player</code> parameter specifies the player that the UI is currently being rendered for. This is typically the local player, but it can also be a different player for spectators.<br />
<br />
== GameModeSave ==<br />
void GameModeSave(Campaign@ campaign, SValueBuilder &builder)<br />
Save any gamemode info. Note that this is separate from town and player record saves. Gamemode saves contain only information necessary to switch from one level to another, or for drop-in multiplayer joining. Use <code>builder</code> to serialize data.<br />
<br />
== GameModeOnRunEnd ==<br />
void GameModeOnRunEnd(Campaign@ campaign, PlayerRecord@ record, bool died)<br />
Called when a player's run has ended. This can happen if the player dies, or if the player beats the game through the EndOfGame worldscript. The player whose run has ended is specified by the <code>record</code> parameter. The <code>died</code> parameter is true if the run has ended because of the player dying, or false if the game was beaten.<br />
<br />
== GameModeInitializePlayer ==<br />
void GameModeInitializePlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when the player record is initialized.<br />
<br />
== GameModeSpawnPlayer ==<br />
void GameModeSpawnPlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when a player has spawned. (B90+)<br />
<br />
== GameModePlayerDied ==<br />
void GameModePlayerDied(Campaign@ campaign, PlayerRecord@ player, PlayerRecord@ killer, DamageInfo &di)<br />
Called when a player dies. (B90+)<br />
<br />
== TownRecordSave ==<br />
void TownRecordSave(TownRecord@ record, SValueBuilder &builder)<br />
Called when the town record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== TownRecordLoad ==<br />
void TownRecordLoad(TownRecord@ record, SValue@ sval)<br />
Called when the town record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRecordSave ==<br />
void PlayerRecordSave(PlayerRecord@ record, SValueBuilder &builder)<br />
Called when a player record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== PlayerRecordLoad ==<br />
void PlayerRecordLoad(PlayerRecord@ record, SValue@ sval)<br />
Called when a player record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRefreshScene ==<br />
void PlayerRefreshScene(PlayerBase@ player)<br />
Called each tick to make sure the player's unit scene is up to date. Useful if you want to add or attach any graphical element on top of the player unit.<br />
<br />
== WidgetHosterLoad ==<br />
void WidgetHosterLoad(IWidgetHoster@ host, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget hoster loaded its gui file. <code>host</code> specifies the host object that loaded the gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== WidgetHosterResourceAdded ==<br />
void WidgetHosterResourceAdded(Widget@ parent, Widget@ w, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget adds a resource gui file via <code>AddResource</code>. <code>parent</code> is the widget that the resource was added to as a child. <code>w</code> is the root widget of the added gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== LoadWidgetProducers ==<br />
void LoadWidgetProducers(GUIBuilder@ builder)<br />
Called when widget producers should be loaded. This allows you to initialize custom widget producers that can produce custom widgets. <code>builder</code> is where you would call <code>AddWidgetProducer</code> on to initialize the widget producer.<br />
<br />
[[Category:Modding]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Incompatible_mod&diff=2043Incompatible mod2019-07-29T17:53:43Z<p>Miss: Created page with "If your mod was marked as incompatible on the Steam Workshop, there can be several reasons for this. Most likely, your mod hasn't been updated in a while and doesn't work prop..."</p>
<hr />
<div>If your mod was marked as incompatible on the Steam Workshop, there can be several reasons for this. Most likely, your mod hasn't been updated in a while and doesn't work properly anymore.<br />
<br />
In this case, we'd like to ask you to contact one of the devs on [https://discord.gg/hammerwatch Discord] (probably Miss) about getting your item made compatible again. Make sure you update your item so that it works again and we can test it!</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Script_Hooks&diff=2040Script Hooks2019-07-17T12:54:45Z<p>Miss: </p>
<hr />
<div>Hooks are script functions that are called at specific moments. This way, you can insert code into the game.<br />
<br />
They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods.<br />
<br />
The following is an example of such a file:<br />
<br />
namespace MyTestMod<br />
{<br />
[Hook]<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
{<br />
print("Hello, world!");<br />
}<br />
}<br />
<br />
== GameModeConstructor ==<br />
void GameModeConstructor(Campaign@ campaign)<br />
Called when the Campaign gamemode is being constructed. Useful for initial setting up, for example to add new definitions for items, sets, shops, fountain effects, etc.<br />
<br />
== GameModeStart ==<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
Called in the Campaign gamemode's <code>Start()</code> function. This allows to initialize things and additionally loading any saved data saved in the <code>GameModeSave</code> hook using the <code>save</code> parameter. This paramater is null if there is no save.<br />
<br />
== GameModePostStart ==<br />
void GameModePostStart(Campaign@ campaign)<br />
Called in the Campaign gamemode's <code>PostStart()</code> function. This function is usually used to load things after all the unit behaviors have loaded in, and just before the player is ready to spawn.<br />
<br />
== GameModeUpdate ==<br />
void GameModeUpdate(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's update function. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
== GameModeRenderFrame ==<br />
void GameModeRenderFrame(Campaign@ campaign, int idt, SpriteBatch &sb)<br />
Called for each rendered frame before any UI is drawn. If you're looking for a hook called ''after'' the UI is drawn, use the <code>GameModeRenderWidgets</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is the current time in milliseconds since the last update tick, which means the value will be between 0 and 33. Divide this value by <code>33.0f</code> to get a normalized interpolation factor for animations.<br />
<br />
== GameModeRenderWidgets ==<br />
void GameModeRenderWidgets(Campaign@ campaign, PlayerRecord@ player, int idt, SpriteBatch &sb)<br />
Called for each rendered frame after the UI is drawn. If you're looking for a hook called ''before'' the UI is drawn, use the <code>GameModeRenderFrame</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is described in the <code>GameModeRenderFrame</code> hook description. The <code>player</code> parameter specifies the player that the UI is currently being rendered for. This is typically the local player, but it can also be a different player for spectators.<br />
<br />
== GameModeSave ==<br />
void GameModeSave(Campaign@ campaign, SValueBuilder &builder)<br />
Save any gamemode info. Note that this is separate from town and player record saves. Gamemode saves contain only information necessary to switch from one level to another, or for drop-in multiplayer joining. Use <code>builder</code> to serialize data.<br />
<br />
== GameModeOnRunEnd ==<br />
void GameModeOnRunEnd(Campaign@ campaign, PlayerRecord@ record, bool died)<br />
Called when a player's run has ended. This can happen if the player dies, or if the player beats the game through the EndOfGame worldscript. The player whose run has ended is specified by the <code>record</code> parameter. The <code>died</code> parameter is true if the run has ended because of the player dying, or false if the game was beaten.<br />
<br />
== GameModeInitializePlayer ==<br />
void GameModeInitializePlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when the player record is initialized.<br />
<br />
== GameModeSpawnPlayer ==<br />
void GameModeSpawnPlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when a player has spawned. (B90+)<br />
<br />
== GameModePlayerDied ==<br />
void GameModePlayerDied(Campaign@ campaign, PlayerRecord@ player, PlayerRecord@ killer, DamageInfo &di)<br />
Called when a player dies. (B90+)<br />
<br />
== TownRecordSave ==<br />
void TownRecordSave(TownRecord@ record, SValueBuilder &builder)<br />
Called when the town record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== TownRecordLoad ==<br />
void TownRecordLoad(TownRecord@ record, SValue@ sval)<br />
Called when the town record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRecordSave ==<br />
void PlayerRecordSave(PlayerRecord@ record, SValueBuilder &builder)<br />
Called when a player record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== PlayerRecordLoad ==<br />
void PlayerRecordLoad(PlayerRecord@ record, SValue@ sval)<br />
Called when a player record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRefreshScene ==<br />
void PlayerRefreshScene(PlayerBase@ player)<br />
Called each tick to make sure the player's unit scene is up to date. Useful if you want to add or attach any graphical element on top of the player unit.<br />
<br />
== WidgetHosterLoad ==<br />
void WidgetHosterLoad(IWidgetHoster@ host, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget hoster loaded its gui file. <code>host</code> specifies the host object that loaded the gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
== WidgetHosterResourceAdded ==<br />
void WidgetHosterResourceAdded(Widget@ parent, Widget@ w, GUIBuilder@ b, GUIDef@ def)<br />
Calls when a widget adds a resource gui file via <code>AddResource</code>. <code>parent</code> is the widget that the resource was added to as a child. <code>w</code> is the root widget of the added gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
[[Category:Modding]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Main_Page&diff=2024Main Page2019-07-16T11:33:41Z<p>Miss: </p>
<hr />
<div><div style="text-align:center;"><br />
<div class="logo-img" style="margin:auto;max-width:900px;"><br />
[[File:Logo game large.png|link=]]<br />
</div><br />
<br />
<br />
Welcome to the Heroes of Hammerwatch wiki. Here you will find plenty of great information on this game.<br />
<br />
Registration is disabled to fight spam. If you wish to contribute to the wiki, [https://goo.gl/forms/Zr2AKriNJ1XghV8H3 please sign up here]!<br />
<br />
<center><br />
{| class="wikitable" style="text-align:center;padding-top: 6px;"<br />
!colspan="5"|Table of Contents<br />
|-<br />
|width="100"|<br />
{{#sprite:file=File:paladin.png|column=0|row=0|link=Classes}}<br />
[[Classes]]<br />
|width="100"|<br />
{{#sprite:file=File:Items2x.png|column=4|row=4|link=Items}}<br />
[[Items]]<br />
|width="100"|<br />
{{#sprite:file=File:Mayor.png|column=0|row=0|link=Town}}<br />
[[Town]]<br />
|width="100"|<br />
{{#sprite:file=File:Ore.png|column=0|row=0|link=Mechanics}}<br />
[[Mechanics]]<br />
|width="100"|<br />
{{#sprite:file=File:Skeletonr.png|column=0|row=0|link=Enemies}}<br />
[[Enemies]]<br />
|}<br />
</center><br />
<br />
{{Template:BaseNav}}<br />
<br />
</div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Info.xml&diff=2010Info.xml2019-07-05T14:23:07Z<p>Miss: </p>
<hr />
<div>The <code>info.xml</code> file is added to mods in order to specify the details of a mod.<br />
<br />
Here's a minimal example:<br />
<br />
<dict><br />
<string name="name">Test Mod</string><br />
<string name="author">Miss</string><br />
<string name="description">Just a test mod to test things.</string><br />
</dict><br />
<br />
Here's a more complete example, which includes custom levels, a custom class, and [[Classmaps]]:<br />
<br />
<dict><br />
<string name="name">Test Mod</string><br />
<string name="author">Miss</string><br />
<string name="description">Just a test mod to test things.</string><br />
<br />
<array name="levels"><br />
<dict><br />
<string name="name">My Cool Map</string><br />
<string name="description">It's my very cool map.</string><br />
<string name="file">levels/test_mod.lvl</string><br />
</dict><br />
</array><br />
<br />
<array name="custom-character-classes"><br />
<dict><br />
<string name="id">sam</string><br />
<string name="name">Serious Sam</string><br />
<string name="description">Let's get serious!</string><br />
</dict><br />
</array><br />
<br />
<dict name="classmaps"><br />
<array name="behaviors"><br />
<array><string>Player</string><string>MyPlayer</string></array><br />
<array><string>PlayerHusk</string><string>MyPlayerHusk</string></array><br />
</array><br />
</dict><br />
<br />
<array name="run-scripts"><br />
<dict><br />
<string name="class">MyScript</string><br />
<string name="name">My own script</string><br />
<string name="description">My script will do something!</string><br />
</dict><br />
</array><br />
</dict><br />
<br />
== Specification ==<br />
The file is an sval file with an xml extension. It's a dictionary containing keys. The keys are:<br />
<br />
* string <code>name</code> ''(required)'' The name of the mod.<br />
* string <code>author</code> ''(required)'' The author of the mod.<br />
* string <code>description</code> ''(required)'' A short description of what the mod does.<br />
* array <code>levels</code> An optional list of levels to add to the Mod NPC's list in town, as dictionaries or strings. You will be able to use the NPC to switch directly to these levels.<br />
** string <code>file</code> ''(required)'' The path of the level relative to the folder of the mod.<br />
** string <code>name</code> ''(required)'' The name of the level. This will be the text of the button.<br />
** string <code>description</code> The description of the level. This will be the tooltip of the button.<br />
* array <code>custom-character-classes</code> An optiona list of custom classes to add to the Mod NPC's list in town. This will allow you to "morph" your current character class into the custom class.<br />
** string <code>id</code> ''(required)'' The ID of the class. This should be the same as the unit name, for example <code>paladin</code> or <code>sorcerer</code>.<br />
** string <code>name</code> ''(required)'' The name of the class. This will be the text of the button.<br />
** string <code>description</code> The description of the class. This will be the tooltip of the button.<br />
* dict <code>classmaps</code> A list of [[Classmaps]] to use while the mod is active.<br />
** array <code>behaviors</code> Behaviors to map.<br />
** array <code>gamemodes</code> Gamemodes to map.<br />
** array <code>scripts</code> Classes to map that are instantiated in scripts via <code>InstantiateClass</code>.<br />
* array <code>run-scripts</code> A list of runnable scripts.<br />
** string <code>class</code> The class that will be instantiated. This class must implement the constructor as <code>MyScript(SValue&)</code>, and must implement <code>IModScript</code>, which contains the single function <code>void Run()</code>. This function will be called when the button is clicked.<br />
** string <code>name</code> The text that should be displayed on the button.<br />
** string <code>description</code> The text that should be displayed in the tooltip of the button.</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Toolkit_Class&diff=2009Toolkit Class2019-07-05T11:00:25Z<p>Miss: </p>
<hr />
<div>Toolkit classes are defined using the <code>[Toolkit]</code> metadata: <br />
<br />
[Toolkit]<br />
class UnitViewer : TestSceneTool<br />
<br />
Objects are constructed using this constructor:<br />
<br />
ClassName(ToolkitScript@ script)<br />
<br />
==Methods called from the engine==<br />
The engine calls the following functions, if they exist:<br />
<br />
* <code>void OnShow()</code><br />
* <code>void OnHide()</code><br />
* <code>void OnKeyPress(int scancode)</code><br />
* <code>void OnKeyDown(int scancode)</code><br />
* <code>void OnKeyUp(int scancode)</code><br />
* <code>void OnMouseDown(vec2 pos, int button)</code><br />
* <code>void OnMouseUp(vec2 pos, int button)</code><br />
* <code>void OnMouseMove(vec2 pos)</code><br />
* <code>void OnMouseWheel(vec2 delta)</code><br />
* <code>void Initialize()</code><br />
* <code>void Save(SValueBuilder@ builder)</code><br />
* <code>void Load(SValue@ data)</code><br />
* <code>void Update(int dt)</code><br />
* <code>void Render(SpriteBatch& sb, int idt)</code><br />
* <code>void RenderMenu()</code><br />
* <code>void ResourcesToReload(array<string>@ res)</code><br />
* <code>void OnResourcesReloaded()</code></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=GameMode_Class&diff=1944GameMode Class2019-06-19T12:38:41Z<p>Miss: </p>
<hr />
<div>Gamemode classes are defined using the <code>[GameMode]</code> metadata:<br />
<br />
[GameMode]<br />
class TestLevel : Campaign<br />
<br />
The only possible parameter for this is <code>default</code>, which, if specified, causes the gamemode to load as the default gamemode if a level does not set a gamemode. In Heroes of Hammerwatch, this is always <code>MainMenu</code>.<br />
<br />
Objects are constructed using this constructor:<br />
<br />
ClassName(Scene@ scene)<br />
<br />
==Methods called from the engine==<br />
The engine calls the following functions, if they exist: <br />
<br />
* <code>void Start(uint8, SValue@, StartMode)</code><br />
* <code>void LobbyCreated(bool loadingSave)</code><br />
* <code>void LobbyInviteAccepted(uint64 id)</code><br />
* <code>void LobbyEntered()</code><br />
* <code>void LobbyFailedJoin(bool host)</code><br />
* <code>void GetPlayerSave(uint8)</code><br />
* <code>void AddPlayer(uint8)</code><br />
* <code>void RemovePlayer(uint8, bool)</code><br />
* <code>void UpdateFrame(int, GameInput&, MenuInput&)</code><br />
* <code>void UpdatePausedFrame(int, GameInput&, MenuInput&)</code><br />
* <code>void PreRenderFrame(int)</code><br />
* <code>void RenderFrame(int, SpriteBatch&)</code><br />
* <code>void RenderFrameLoading(int, SpriteBatch&)</code><br />
* <code>void ResizeWindow(int, int, float)</code><br />
* <code>SValue@ Save()</code><br />
* <code>void OnBindingInput(ControllerType, int)</code><br />
* <code>void SystemMessage(string, SValue@)</code><br />
* <code>void ChatMessage(uint8, string)</code><br />
* <code>void LobbyDataUpdate()</code><br />
* <code>void LobbyMemberDataUpdate(uint8)</code><br />
* <code>void LobbyList(array<uint64>@)</code><br />
* <code>void SetMenuState(MenuState)</code><br />
* <code>bool MenuBack()</code><br />
* <code>void ShowMessage(MenuMessage)</code><br />
* <code>vec2 GetCameraPos(int)</code><br />
* <code>vec4 GetVignette(int)</code><br />
* <code>void Paused(bool)</code><br />
* <code>void Generate(SValue@)</code><br />
* <code>void OnExitGame()</code></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Behavior_Class&diff=1943Behavior Class2019-06-19T12:37:41Z<p>Miss: </p>
<hr />
<div>Behavior classes can be any class referenced from a unit's behavior tag.<br />
<br />
Objects are constructed using this constructor:<br />
<br />
ClassName(UnitPtr unit, SValue& params)<br />
<br />
==Methods called from the engine==<br />
The engine calls the following functions, if they exist:<br />
<br />
* <code>void Update(int dt)</code><br />
* <code>void QueuedPathfind(array<vec2>@ path)</code><br />
* <code>void QueuedFetchActors(array<UnitPtr>@ actors)</code><br />
* <code>void Collide(UnitPtr unit, vec2 pos, vec2 normal)</code><br />
* <code>void Collide(UnitPtr unit, vec2 pos, vec2 normal, Fixture@ fxSelf, Fixture@ fxOther)</code><br />
* <code>void EndCollision(UnitPtr unit)</code><br />
* <code>void EndCollision(UnitPtr unit, Fixture@ fxSelf, Fixture@ fxOther)</code><br />
* <code>void Destroyed()</code><br />
* <code>vec4 GetOverlayColor()</code><br />
* <code>SValue@ Save()</code><br />
* <code>void Load(SValue@ save)</code><br />
* <code>void PostLoad(SValue@ save)</code></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Toolkit_Class&diff=1942Toolkit Class2019-06-19T12:36:39Z<p>Miss: </p>
<hr />
<div>Toolkit classes are defined using the <code>[Toolkit]</code> metadata: <br />
<br />
[Toolkit]<br />
class UnitViewer : TestSceneTool<br />
<br />
Objects are constructed using this constructor:<br />
<br />
ClassName(ToolkitScript@ script)<br />
<br />
==Methods called from the engine==<br />
The engine calls the following functions, if they exist:<br />
<br />
* <code>void OnShow()</code><br />
* <code>void OnHide()</code><br />
* <code>void OnKeyPress(int scancode)</code><br />
* <code>void OnKeyDown(int scancode)</code><br />
* <code>void OnKeyUp(int scancode)</code><br />
* <code>void OnMouseDown(vec2 pos, int button)</code><br />
* <code>void OnMouseUp(vec2 pos, int button)</code><br />
* <code>void OnMouseMove(vec2 pos)</code><br />
* <code>void OnMouseWheel(vec2 delta)</code><br />
* <code>void Initialize()</code><br />
* <code>void Update(int dt)</code><br />
* <code>void Render(SpriteBatch& sb, int idt)</code><br />
* <code>void RenderMenu()</code><br />
* <code>void ResourcesToReload(array<string>@ res)</code><br />
* <code>void OnResourcesReloaded()</code></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Toolkit_Class&diff=1941Toolkit Class2019-06-19T12:35:49Z<p>Miss: Created page with "Toolkit classes are defined using the <code>[Toolkit]</code> metadata: [Toolkit] class UnitViewer : TestSceneTool ==Methods called from the engine== The engine calls the..."</p>
<hr />
<div>Toolkit classes are defined using the <code>[Toolkit]</code> metadata: <br />
<br />
[Toolkit]<br />
class UnitViewer : TestSceneTool<br />
<br />
==Methods called from the engine==<br />
The engine calls the following functions, if they exist:<br />
<br />
* <code>void OnShow()</code><br />
* <code>void OnHide()</code><br />
* <code>void OnKeyPress(int scancode)</code><br />
* <code>void OnKeyDown(int scancode)</code><br />
* <code>void OnKeyUp(int scancode)</code><br />
* <code>void OnMouseDown(vec2 pos, int button)</code><br />
* <code>void OnMouseUp(vec2 pos, int button)</code><br />
* <code>void OnMouseMove(vec2 pos)</code><br />
* <code>void OnMouseWheel(vec2 delta)</code><br />
* <code>void Initialize()</code><br />
* <code>void Update(int dt)</code><br />
* <code>void Render(SpriteBatch& sb, int idt)</code><br />
* <code>void RenderMenu()</code><br />
* <code>void ResourcesToReload(array<string>@ res)</code><br />
* <code>void OnResourcesReloaded()</code></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Behavior_Class&diff=1940Behavior Class2019-06-19T12:33:03Z<p>Miss: Created page with "Behavior classes can be any class referenced from a unit's behavior tag. ==Methods called from the engine== The engine calls the following functions, if they exist: * <code>..."</p>
<hr />
<div>Behavior classes can be any class referenced from a unit's behavior tag.<br />
<br />
==Methods called from the engine==<br />
The engine calls the following functions, if they exist:<br />
<br />
* <code>void Update(int dt)</code><br />
* <code>void QueuedPathfind(array<vec2>@ path)</code><br />
* <code>void QueuedFetchActors(array<UnitPtr>@ actors)</code><br />
* <code>void Collide(UnitPtr unit, vec2 pos, vec2 normal)</code><br />
* <code>void Collide(UnitPtr unit, vec2 pos, vec2 normal, Fixture@ fxSelf, Fixture@ fxOther)</code><br />
* <code>void EndCollision(UnitPtr unit)</code><br />
* <code>void EndCollision(UnitPtr unit, Fixture@ fxSelf, Fixture@ fxOther)</code><br />
* <code>void Destroyed()</code><br />
* <code>vec4 GetOverlayColor()</code><br />
* <code>SValue@ Save()</code><br />
* <code>void Load(SValue@ save)</code><br />
* <code>void PostLoad(SValue@ save)</code></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=GameMode_Class&diff=1939GameMode Class2019-06-19T12:28:40Z<p>Miss: Created page with "Gamemode classes are defined using the <code>[GameMode]</code> metadata: [GameMode] class TestLevel : Campaign The only possible parameter for this is <code>default</code>..."</p>
<hr />
<div>Gamemode classes are defined using the <code>[GameMode]</code> metadata:<br />
<br />
[GameMode]<br />
class TestLevel : Campaign<br />
<br />
The only possible parameter for this is <code>default</code>, which, if specified, causes the gamemode to load as the default gamemode if a level does not set a gamemode. In Heroes of Hammerwatch, this is always <code>MainMenu</code>.<br />
<br />
==Methods called from the engine==<br />
The engine calls the following functions, if they exist: <br />
<br />
* <code>void Start(uint8, SValue@, StartMode)</code><br />
* <code>void LobbyCreated(bool loadingSave)</code><br />
* <code>void LobbyInviteAccepted(uint64 id)</code><br />
* <code>void LobbyEntered()</code><br />
* <code>void LobbyFailedJoin(bool host)</code><br />
* <code>void GetPlayerSave(uint8)</code><br />
* <code>void AddPlayer(uint8)</code><br />
* <code>void RemovePlayer(uint8, bool)</code><br />
* <code>void UpdateFrame(int, GameInput&, MenuInput&)</code><br />
* <code>void UpdatePausedFrame(int, GameInput&, MenuInput&)</code><br />
* <code>void PreRenderFrame(int)</code><br />
* <code>void RenderFrame(int, SpriteBatch&)</code><br />
* <code>void RenderFrameLoading(int, SpriteBatch&)</code><br />
* <code>void ResizeWindow(int, int, float)</code><br />
* <code>SValue@ Save()</code><br />
* <code>void OnBindingInput(ControllerType, int)</code><br />
* <code>void SystemMessage(string, SValue@)</code><br />
* <code>void ChatMessage(uint8, string)</code><br />
* <code>void LobbyDataUpdate()</code><br />
* <code>void LobbyMemberDataUpdate(uint8)</code><br />
* <code>void LobbyList(array<uint64>@)</code><br />
* <code>void SetMenuState(MenuState)</code><br />
* <code>bool MenuBack()</code><br />
* <code>void ShowMessage(MenuMessage)</code><br />
* <code>vec2 GetCameraPos(int)</code><br />
* <code>vec4 GetVignette(int)</code><br />
* <code>void Paused(bool)</code><br />
* <code>void Generate(SValue@)</code><br />
* <code>void OnExitGame()</code></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=WorldScript_Class&diff=1938WorldScript Class2019-06-19T12:22:37Z<p>Miss: </p>
<hr />
<div>Worldscript classes are defined using the <code>[WorldScript]</code> metadata:<br />
<br />
[WorldScript color="176 196 222" icon="system/icons.png;416;128;32;32"]<br />
class ScriptLink<br />
<br />
Possible options for the metadata are:<br />
<br />
* <code>color</code> specifies the color that the editor will show this script as when placed in a level. This can be a hexadecimal color (if it starts with <code>#</code>) or an RGB pair.<br />
* <code>icon</code> contains the texture and coordinates of where the worldscript icon is that should be shown in editor, in the format <code>filename;x;y;width;height</code>.<br />
* <code>alias</code> is an optional string that can be used as an alternative name for the script. This is useful when a class name has changed, so that it can still be loaded by level files that reference the script by its old name. You can specify multiple names here, separated by commas.<br />
<br />
==Methods called from engine==<br />
The engine calls the following functions, if they exist:<br />
<br />
* <code>void Initialize()</code><br />
* <code>void Cleanup()</code><br />
* <code>void Update(int dt)</code><br />
* <code>void PostUpdate(int dt)</code><br />
* <code>SValue@ ServerExecute()</code><br />
* <code>void ClientExecute(SValue@)</code><br />
* <code>void OnEnabledChanged(bool enabled)</code><br />
* <code>void DebugDraw(vec2, SpriteBatch&)</code><br />
* <code>SValue@ Save()</code><br />
* <code>void Load(SValue@ save)</code><br />
<br />
==Remarks==<br />
Worldscripts are only executable if they have a <code>ClientExecute</code> or a <code>ServerExecute</code> method. If neither of these methods exist, you can not target the worldscript to execute.</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=WorldScript_Class&diff=1937WorldScript Class2019-06-19T12:20:44Z<p>Miss: Created page with "Worldscript classes are defined using the <code>[WorldScript]</code> metadata: [WorldScript color="176 196 222" icon="system/icons.png;416;128;32;32"] class ScriptLink Pos..."</p>
<hr />
<div>Worldscript classes are defined using the <code>[WorldScript]</code> metadata:<br />
<br />
[WorldScript color="176 196 222" icon="system/icons.png;416;128;32;32"]<br />
class ScriptLink<br />
<br />
Possible options for the metadata are:<br />
<br />
* <code>color</code> specifies the color that the editor will show this script as when placed in a level. This can be a hexadecimal color (if it starts with <code>#</code>) or an RGB pair.<br />
* <code>icon</code> contains the texture and coordinates of where the worldscript icon is that should be shown in editor, in the format <code>filename;x;y;width;height</code>.<br />
* <code>alias</code> is an optional string that can be used as an alternative name for the script. This is useful when a class name has changed, so that it can still be loaded by level files that reference the script by its old name. You can specify multiple names here, separated by commas.<br />
<br />
==Methods called from engine==<br />
The engine calls the following functions, if they exist:<br />
<br />
* <code>void Initialize()</code><br />
* <code>void Cleanup()</code><br />
* <code>void Update(int dt)</code><br />
* <code>void PostUpdate(int dt)</code><br />
* <code>SValue@ ServerExecute()</code><br />
* <code>void ClientExecute(SValue@)</code><br />
* <code>void OnEnabledChanged(bool enabled)</code><br />
* <code>void DebugDraw(vec2, SpriteBatch&)</code><br />
* <code>SValue@ Save()</code><br />
* <code>void Load(SValue@ save)</code></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Mod_support&diff=1936Mod support2019-06-19T12:11:56Z<p>Miss: /* Scripting/GUI page? */</p>
<hr />
<div>Welcome to the modding page! This page is dedicated to offering a list of important information in a ladder to get around modding Heroes of Hammerwatch!<br />
<br />
=Modding resouces=<br />
==Starting a mod==<br />
* [[mod_base|How to start]]<br />
* [[Info.xml|info.xml specification]]<br />
* [[Unpack resources]]<br />
<br />
==Editor==<br />
* [[Editor guide]]<br />
<br />
===How to use:===<br />
*Assets<br />
*Tilemaps<br />
*Environment lighting<br />
====.unit,.effect & .inc====<br />
*Doodads<br />
*Actors<br />
*Items<br />
*Link child unit to inc. (Like the act walls!)<br />
====Worldscripts====<br />
*Linking worldscripts<br />
===How to put those into:===<br />
*Levels<br />
*Prefabs<br />
====How to put Prefabs into:====<br />
*Levels! lol<br />
<br />
==Custom assets page==<br />
===How to add:===<br />
*Tilemaps<br />
*Doodads<br />
*Actors<br />
*[[Custom_items|Items]]<br />
*Worldscripts<br />
*[[Custom_Materials_(Dyes)|Materials]]<br />
<br />
==Scripting==<br />
<br />
===Class models===<br />
*[[WorldScript Class|WorldScript]]<br />
*[[GameMode Class|GameMode]]<br />
*[[Behavior Class|Behavior]]<br />
*[[Toolkit Class|Toolkit]]<br />
<br />
===GUI===<br />
*GUI modification and creation<br />
*GUI scripts<br />
<br />
===Scripting===<br />
*Worldscript<br />
*Gamemode scripts<br />
<br />
==Upload to workshop==<br />
[[Uploading_to_the_workshop|How to upload to the workshop]] <br />
<br />
=List of common resources=<br />
*[[Custom_items|Custom Items]]<br />
*[[Script_Hooks|Script Hooks]]<br />
*[[List_of_modifiers|List of modifiers]]<br />
*[[SValue_Loaders|SValue loaders]]<br />
<br />
{{Template:BaseNav}}</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Custom_shop&diff=1741Custom shop2019-03-28T16:50:24Z<p>Miss: </p>
<hr />
<div>You can make custom shops using the <code>ShopArea</code> worldscript. Using that worldscript, you can select the level of the shop. Depending on the situation however, it might be more appropriate to use an <code>OpenInterface</code> worldscript instead, in the case you need both a custom GUI and you have no desire to have a shop level associated with it.<br />
<br />
There are 2 types of custom shops you can make using the <code>ShopArea</code> worldscript:<br />
<br />
1. A regular upgrade shop. This is what most upgrade shops in the town are using, such as the blacksmith.<br />
2. A custom shop with a custom GUI frame.<br />
<br />
== Upgrade shop ==<br />
The basic upgrade shops use a <code>ShopArea</code> worldscript with the type set to <code>UpgradeShop</code>. These shops use sval files to load "upgrades", which in turn load "upgrade steps", which can be owned, or be a one-off purchase. For example, let's take a look at how the blacksmith works in <code>tweak/shops/blacksmith.sval</code>:<br />
<br />
<loader>Upgrades::LoadShop</loader><br />
<dict><br />
<string name="class">Upgrades::UpgradeShop</string><br />
<br />
<string name="id">blacksmith</string><br />
<string name="name">.shop.blacksmith</string><br />
<br />
<array name="upgrades"><br />
...<br />
</array><br />
</dict><br />
<br />
You can see that the sval file is using a loader function <code>Upgrades::LoadShop</code>. This will load the shop definition so that it can be used as a category in the <code>ShopArea</code> worldscript. The class is the basic <code>UpgradeShop</code> class, which simply provides a list of upgrades. The ID is set to <code>blacksmith</code>, which is what the "category" property must be set to in the <code>ShopArea</code> worldscript. The name is what is shown at the top of the UI.<br />
<br />
== Upgrades ==<br />
Then we have a list of upgrades. Upgrades, by definition, are upgrades you can buy that can be owned by a player. But this doesn't necessarily mean they have to be owned, as key or item purchases for example are not actually owned upgrades, they're one-off upgrades that perform some temporary action on the player, such as giving a key, or giving an item. Keys and items are not permanent, they disappear after you die in a dungeon, so they're not remembered as being "owned" in your character.<br />
<br />
Upgrades have upgrade "steps", which are basically the "levels" of the upgrades. If you buy an upgrade level 1, you own the first step in the upgrade, if you buy an upgrade level 2, you own the second step (but not the first), etc.<br />
<br />
There's a number of upgrade classes built-in to the game:<br />
<br />
* ModifierUpgrade<br />
** ChapelUpgrade<br />
* BuildingUpgrade<br />
* KeyUpgrade<br />
* OreTraderUpgrade<br />
* RecordUpgrade<br />
* SingleStepUpgrade<br />
** DesertMapUpgrade<br />
** ItemUpgrade<br />
<br />
For now, we're only going to take a look at <code>ModifierUpgrade</code> as its the most straight forward one.<br />
<br />
=== Defining the upgrade ===<br />
Let's take another look at the Blacksmith shop. You can see that the first upgrade in the list is the armor upgrade for tier 1:<br />
<br />
<dict><br />
<string name="class">Upgrades::ModifierUpgrade</string><br />
<string name="id">armor</string><br />
<array name="icon"><br />
<string>gui/icons_others.png</string><int>100</int><vec4>24 48 24 24</vec4><br />
</array><br />
<array name="steps"><br />
<!-- Tier I --><br />
<!-- Level 1 --><br />
<dict><br />
<int name="cost-gold">250</int><br />
<br />
<string name="name">.shop.blacksmith.armor-1.name</string><br />
<string name="desc">.shop.blacksmith.armor-1.desc</string><br />
<br />
<dict name="modifier"><br />
<string name="class">Modifiers::Armor</string><br />
<int name="armor">5</int><br />
</dict><br />
</dict><br />
...<br />
</array><br />
</dict><br />
<br />
Here, the class is defined as <code>Upgrades::ModifierUpgrade</code>, which lets you create an owned upgrade with a modifier that's applied on the player at all times. The tier is not shown in the example above, but for upgrade steps that requires a certain tier, you can add this line to the step dictionary:<br />
<br />
<int name="restrict-shop-level-min">2</int><br />
<br />
== Custom shop ==<br />
To make a completely custom shop, you have to use the "Custom" shop type in the <code>ShopArea</code> worldscript. With that shop type, the "Category" property acts as the name of a class to instantiate that will be the frame of the shop menu. This class needs to inherit from <code>ShopMenuContent</code>, and then override <code>string GetGuiFilename()</code> to specify the gui file to use as the shop frame.<br />
<br />
So, for example, to make a shop with a custom UI, you define your class like this:<br />
<br />
class MyShopMenu : ShopMenuContent<br />
{<br />
MyShopMenu(UnitPtr unit, SValue& params)<br />
{<br />
super();<br />
}<br />
<br />
string GetGuiFilename() override<br />
{<br />
return "gui/shop/myshop.gui";<br />
}<br />
}</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Custom_shop&diff=1740Custom shop2019-03-28T16:45:38Z<p>Miss: Created page with "Mods are able to create custom shops with custom upgrades. You can make a shop using the <code>ShopArea</code> worldscript. Using that worldscript, you can select the level of..."</p>
<hr />
<div>Mods are able to create custom shops with custom upgrades. You can make a shop using the <code>ShopArea</code> worldscript. Using that worldscript, you can select the level of the shop. Depending on the situation however, it might be more appropriate to use an <code>OpenInterface</code> worldscript instead, in the case you need both a custom GUI and you have no desire to have a shop level associated with it.<br />
<br />
There are 2 types of custom shops you can make using the <code>ShopArea</code> worldscript:<br />
<br />
1. A regular upgrade shop. This is what most upgrade shops in the town are using, such as the blacksmith.<br />
2. A custom shop with a custom GUI frame.<br />
<br />
== Upgrade shop ==<br />
The basic upgrade shops use a <code>ShopArea</code> worldscript with the type set to <code>UpgradeShop</code>. These shops use sval files to load "upgrades", which in turn load "upgrade steps", which can be owned, or be a one-off purchase. For example, let's take a look at how the blacksmith works in <code>tweak/shops/blacksmith.sval</code>:<br />
<br />
<loader>Upgrades::LoadShop</loader><br />
<dict><br />
<string name="class">Upgrades::UpgradeShop</string><br />
<br />
<string name="id">blacksmith</string><br />
<string name="name">.shop.blacksmith</string><br />
<br />
<array name="upgrades"><br />
...<br />
</array><br />
</dict><br />
<br />
You can see that the sval file is using a loader function <code>Upgrades::LoadShop</code>. This will load the shop definition so that it can be used as a category in the <code>ShopArea</code> worldscript. The class is the basic <code>UpgradeShop</code> class, which simply provides a list of upgrades. The ID is set to <code>blacksmith</code>, which is what the "category" property must be set to in the <code>ShopArea</code> worldscript. The name is what is shown at the top of the UI.<br />
<br />
== Upgrades ==<br />
Then we have a list of upgrades. Upgrades, by definition, are upgrades you can buy that can be owned by a player. But this doesn't necessarily mean they have to be owned, as key or item purchases for example are not actually owned upgrades, they're one-off upgrades that perform some temporary action on the player, such as giving a key, or giving an item. Keys and items are not permanent, they disappear after you die in a dungeon, so they're not remembered as being "owned" in your character.<br />
<br />
Upgrades have upgrade "steps", which are basically the "levels" of the upgrades. If you buy an upgrade level 1, you own the first step in the upgrade, if you buy an upgrade level 2, you own the second step (but not the first), etc.<br />
<br />
There's a number of upgrade classes built-in to the game:<br />
<br />
* ModifierUpgrade<br />
** ChapelUpgrade<br />
* BuildingUpgrade<br />
* KeyUpgrade<br />
* OreTraderUpgrade<br />
* RecordUpgrade<br />
* SingleStepUpgrade<br />
** DesertMapUpgrade<br />
** ItemUpgrade<br />
<br />
For now, we're only going to take a look at <code>ModifierUpgrade</code> as its the most straight forward one.<br />
<br />
=== Defining the upgrade ===<br />
Let's take another look at the Blacksmith shop. You can see that the first upgrade in the list is the armor upgrade for tier 1:<br />
<br />
<dict><br />
<string name="class">Upgrades::ModifierUpgrade</string><br />
<string name="id">armor</string><br />
<array name="icon"><br />
<string>gui/icons_others.png</string><int>100</int><vec4>24 48 24 24</vec4><br />
</array><br />
<array name="steps"><br />
<!-- Tier I --><br />
<!-- Level 1 --><br />
<dict><br />
<int name="cost-gold">250</int><br />
<br />
<string name="name">.shop.blacksmith.armor-1.name</string><br />
<string name="desc">.shop.blacksmith.armor-1.desc</string><br />
<br />
<dict name="modifier"><br />
<string name="class">Modifiers::Armor</string><br />
<int name="armor">5</int><br />
</dict><br />
</dict><br />
...<br />
</array><br />
</dict><br />
<br />
Here, the class is defined as <code>Upgrades::ModifierUpgrade</code>, which lets you create an owned upgrade with a modifier that's applied on the player at all times. The tier is not shown in the example above, but for upgrade steps that requires a certain tier, you can add this line to the step dictionary:<br />
<br />
<int name="restrict-shop-level-min">2</int><br />
<br />
== Custom shop ==<br />
To make a completely custom shop, you have to use the "Custom" shop type in the <code>ShopArea</code> worldscript. With that shop type, the "Category" property acts as the name of a class to instantiate that will be the frame of the shop menu. This class needs to inherit from <code>ShopMenuContent</code>, and then override <code>string GetGuiFilename()</code> to specify the gui file to use as the shop frame.<br />
<br />
So, for example, to make a shop with a custom UI, you define your class like this:<br />
<br />
class MyShopMenu : ShopMenuContent<br />
{<br />
MyShopMenu(UnitPtr unit, SValue& params)<br />
{<br />
super();<br />
}<br />
<br />
string GetGuiFilename() override<br />
{<br />
return "gui/shop/myshop.gui";<br />
}<br />
}</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Classmaps&diff=1688Classmaps2019-03-15T12:41:15Z<p>Miss: </p>
<hr />
<div>Classmaps can be used by mods to hook into class instantiation from scripts and engine by dynamically changing the type of the class that is being instantiated. This means that certain classes can be inherited from with your own code, potentially having to avoid overwriting a file.<br />
<br />
Definitions for classmaps exist within [[info.xml]], and range from 3 different types of mappings:<br />
<br />
* Behaviors: Classes that are used as behaviors on units, such as <code>Player</code>, <code>CompositeActorBehavior</code>, <code>Pickup</code>, etc.<br />
* Gamemodes: Classes that are gamemodes, such as <code>RandomLevel</code>, <code>Town</code>, <code>BossLevel</code>, etc.<br />
* Scripts: Classes instantiated in scripts via <code>InstantiateClass</code>, such as modifiers, actions, effects, movements, skills, upgrades, shops, interfaces, etc.<br />
<br />
You define a mapping by providing 2 class names, a "from" name and a "to" name. For example, to map the <code>Player</code> class to your own <code>MyPlayer</code> class, you would put this in your info.xml file:<br />
<br />
<dict name="classmaps"><br />
<array name="behaviors"><br />
<array><string>Player</string><string>MyPlayer</string></array><br />
</array><br />
</dict><br />
<br />
We use the <code>behaviors</code> mapping here because <code>Player</code> is a unit behavior. Typically, when you make class mappings, you'll want to inherit from the original class in order to change or add code. For example, in the above example of the custom player class, we can make the player never take any damage by overriding the Damage function:<br />
<br />
class MyPlayer : Player<br />
{<br />
MyPlayer(UnitPtr unit, SValue& params)<br />
{<br />
super(unit, params);<br />
}<br />
<br />
int Damage(DamageInfo dmg, vec2 pos, vec2 dir) override<br />
{<br />
// Just return 0! If we did want to do damage and just<br />
// wanted to use this as a hook, we could call the base<br />
// function here:<br />
//<br />
// return Player::Damage(dmg, pos, dir);<br />
<br />
return 0;<br />
}<br />
}<br />
<br />
Note that the constructor there is required (as well as the super call inside of it) in order for the class to properly be instantiated.</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Classmaps&diff=1687Classmaps2019-03-15T12:35:01Z<p>Miss: Created page with "Classmaps can be used by mods to hook into class instantiation from scripts and engine by dynamically changing the type of the class that is being instantiated. This means tha..."</p>
<hr />
<div>Classmaps can be used by mods to hook into class instantiation from scripts and engine by dynamically changing the type of the class that is being instantiated. This means that certain classes can be inherited from with your own code, potentially having to avoid overwriting a file.<br />
<br />
Definitions for classmaps exist within [[info.xml]], and range from 3 different types of mappings:<br />
<br />
* Behaviors: Classes that are used as behaviors on units, such as <code>Player</code>, <code>CompositeActorBehavior</code>, <code>Pickup</code>, etc.<br />
* Gamemodes: Classes that are gamemodes, such as <code>RandomLevel</code>, <code>Town</code>, <code>BossLevel</code>, etc.<br />
* Scripts: Classes instantiated in scripts via <code>InstantiateClass</code>, such as modifiers, actions, effects, movements, skills, upgrades, shops, interfaces, etc.<br />
<br />
You define a mapping by providing 2 class names, a "from" name and a "to" name. For example, to map the <code>Player</code> class to your own <code>MyPlayer</code> class, you would put this in your info.xml file:<br />
<br />
<dict name="classmaps"><br />
<array name="behaviors"><br />
<array><string>Player</string><string>MyPlayer</string></array><br />
</array><br />
</dict><br />
<br />
We use the <code>behaviors</code> mapping here because <code>Player</code> is a unit behavior. Typically, when you make class mappings, you'll want to inherit from the original class in order to change or add code. For example, in the above example of the custom player class, we can make the player never take any damage by overriding the Damage function:<br />
<br />
class MyPlayer : Player<br />
{<br />
MyPlayer(UnitPtr unit, SValue& params)<br />
{<br />
super(unit, params);<br />
}<br />
<br />
int Damage(DamageInfo dmg, vec2 pos, vec2 dir) override<br />
{<br />
// Just return 0! If we did want to do damage and just<br />
// wanted to use this as a hook, we could call the base<br />
// function here:<br />
//<br />
// Player::Damage(dmg, pos, dir);<br />
<br />
return 0;<br />
}<br />
}<br />
<br />
Note that the constructor there is required (as well as the super call inside of it) in order for the class to properly be instantiated.</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Info.xml&diff=1686Info.xml2019-03-15T12:23:47Z<p>Miss: </p>
<hr />
<div>The <code>info.xml</code> file is added to mods in order to specify the details of a mod.<br />
<br />
Here's a minimal example:<br />
<br />
<dict><br />
<string name="name">Test Mod</string><br />
<string name="author">Miss</string><br />
<string name="description">Just a test mod to test things.</string><br />
</dict><br />
<br />
Here's a more complete example, which includes custom levels, a custom class, and [[Classmaps]]:<br />
<br />
<dict><br />
<string name="name">Test Mod</string><br />
<string name="author">Miss</string><br />
<string name="description">Just a test mod to test things.</string><br />
<br />
<array name="levels"><br />
<dict><br />
<string name="name">My Cool Map</string><br />
<string name="description">It's my very cool map.</string><br />
<string name="file">levels/test_mod.lvl</string><br />
</dict><br />
</array><br />
<br />
<array name="custom-character-classes"><br />
<dict><br />
<string name="id">sam</string><br />
<string name="name">Serious Sam</string><br />
<string name="description">Let's get serious!</string><br />
</dict><br />
</array><br />
<br />
<dict name="classmaps"><br />
<array name="behaviors"><br />
<array><string>Player</string><string>MyPlayer</string></array><br />
<array><string>PlayerHusk</string><string>MyPlayerHusk</string></array><br />
</array><br />
</dict><br />
</dict><br />
<br />
== Specification ==<br />
The file is an sval file with an xml extension. It's a dictionary containing keys. The keys are:<br />
<br />
* string <code>name</code> ''(required)'' The name of the mod.<br />
* string <code>author</code> ''(required)'' The author of the mod.<br />
* string <code>description</code> ''(required)'' A short description of what the mod does.<br />
* array <code>levels</code> An optional list of levels to add to the Mod NPC's list in town, as dictionaries or strings. You will be able to use the NPC to switch directly to these levels.<br />
** string <code>file</code> ''(required)'' The path of the level relative to the folder of the mod.<br />
** string <code>name</code> ''(required)'' The name of the level. This will be the text of the button.<br />
** string <code>description</code> The description of the level. This will be the tooltip of the button.<br />
* array <code>custom-character-classes</code> An optiona list of custom classes to add to the Mod NPC's list in town. This will allow you to "morph" your current character class into the custom class.<br />
** string <code>id</code> ''(required)'' The ID of the class. This should be the same as the unit name, for example <code>paladin</code> or <code>sorcerer</code>.<br />
** string <code>name</code> ''(required)'' The name of the class. This will be the text of the button.<br />
** string <code>description</code> The description of the class. This will be the tooltip of the button.<br />
* dict <code>classmaps</code> A list of [[Classmaps]] to use while the mod is active.<br />
** array <code>behaviors</code> Behaviors to map.<br />
** array <code>gamemodes</code> Gamemodes to map.<br />
** array <code>scripts</code> Classes to map that are instantiated in scripts via <code>InstantiateClass</code>.</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Commands&diff=1683Commands2019-03-14T11:29:29Z<p>Miss: /* UI commands */</p>
<hr />
<div>The commands below are available by opening the console using the tilde (~) key. This key is usually located below the escape key. These commands don't save to your configuration file so they will not stick once you close the game.<br>To save a command to your hwr.exe.cfg file you can either add the command manually by editing the file or type <code>save ''your command & argument''</code> or <code>save_curr ''your command''</code>.<br>Example:<br><code>save ui_scale 0.75</code><br><code>save_curr ui_scale</code><br />
<br />
==Game config commands==<br />
<br />
{| class="wikitable"<br />
! colspan="2" style="text-align: center; font-weight: bold;" | Game config commands<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_gore<br />
| Affects whether slain enemies will leave gore effects or not. True or False.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_hdr<br />
| Enables or disables the use of HDR rendering.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_language<br />
| Changes the game's language. Currently no other languages. Will require a restart to take effect.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_laser_sight<br />
| Changes the Aim Guide option. 1 for on, 0 of off, -1 for Auto.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_local_player_marker<br />
| Adds a colored circle below your character's sprite. True or False.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_mousemove_speed<br />
| Multiplier for the speed of the mouse cursor movement on gamepads.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_movedir_snap<br />
| Snap angle for the movement direction on gamepads.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_potion_delay<br />
| Add a delay before you can reuse your potion. This can prevent rogue keyboards.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_richpresence<br />
| Enable or disable rich presence for discord and steam.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_shadows<br />
| Shadow quality. 0 = off, 1 = sun only, 2 = all.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_smooth_scrolling<br />
| Enables or disables smooth camera scrolling.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | rg_brightness<br />
| Brightness of the game.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | rg_contrast<br />
| Contrast of the colors.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | rg_gamma<br />
| Gamma value of the colors.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | rg_crt_curve<br />
| Multiplier for the CRT curve effect.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | rg_pixel_perfect<br />
| Whether the scene needs to render in pixel perfect mode or not. Pixel perfect in this sense means that the game will be rendered in 1x sprite scale and then upscaled (faster). If it's disabled, the game is rendered in its full size and sprites are scaled instead (slower). Disabling pixel perfect allows for a few smoother effects like shadows.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_time_hour<br />
| Set the in game time, useful if you're not a fan of the night in town!<br />
|-<br />
|}<br />
<br />
==Console config commands==<br />
<br />
{| class="wikitable"<br />
! colspan="2" style="text-align: center; font-weight: bold;" | Console config commands<br />
|-<br />
| style="text-align: center; font-weight: bold;" | cs_bgcolor<br />
| Background color of the console. Set as a vec4: *cs_bgcolor 1 0 0 0.5* for a red transparent console background.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | cs_fgcolor<br />
| Text color of the console. Set as a vec4.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | cs_enabled<br />
| Enable or disable the use of the console entirely. Useful if you need the console toggle button for something else.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | cs_height<br />
| The height of the console window, in a multiplier of the screen height: 0.5 means 50% of the screen height.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | cs_show_build<br />
| Whether to show the game's build ID in the bottom left of the screen.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | cs_speed<br />
| The speed for the console toggle animation. The higher the faster.<br />
|}<br />
<br />
==Cheat commands==<br />
<br />
{| class="wikitable"<br />
! colspan="2" style="text-align: center; font-weight: bold;" | Cheat commands<br />
|-<br />
| style="text-align: center; font-weight: bold;" | e_cheats<br />
| e_cheats is required for any of these commands to work. Once toggled on, a red text will appear top right. '''Cheats are only available on modded profiles.'''<br />
|-<br />
| style="text-align: center; font-weight: bold;" | change_level<br />
| change/load level to the chosen relative path argument. ex: levels/testDoodad.lvl<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_scale<br />
| Changes the scaling of the game. The default for a 16:9 resolution would have a game scale of 4.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_timescale<br />
| Affects the game speed.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_armor<br />
| =================================================================<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_blueprint<br />
| Give a specific Blueprint. The argument is the Items ID Name. <br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_combo<br />
| Triggers the combo status<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_drink<br />
| Give a specific drink. The argument must be the drink's ID name.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_drinks<br />
| Gives drinks at the set rarity, "give_drinks 32 32 32" would give 32 each to the common, uncommon and rare drinks. <br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_experience<br />
| Give a selected amount of experience from argument.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_gold<br />
| Give a selected amount of gold from argument.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_health<br />
| Give a selected amount of health from argument.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_item<br />
| Give a specific item. The argument must be the item's ID name.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_items<br />
| Give a selected amount of item with the 4 arguments. The 4 arguments represent the rarities. 1st arg = common, eg "give_items 50 0 0 0 0" will give 50 random common items.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_key<br />
| Give a key. Bronze key = 0, Silver = 1, Gold = 2, Ace = 3.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_mana<br />
| Give a selected amount of mana from argument.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_ore<br />
| Give a selected amount of ore from argument.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | give_statue<br />
| Gives Statues by their ID. Possibly redundant?<br />
|-<br />
| style="text-align: center; font-weight: bold;" | god<br />
| Set infinite health<br />
|-<br />
| style="text-align: center; font-weight: bold;" | levelup<br />
| Specifies an amount of Levels to Level up by. <br />
|-<br />
| style="text-align: center; font-weight: bold;" | noclip<br />
| Remove player collision.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_*<br />
| =================================================================<br />
|-<br />
| style="text-align: center; font-weight: bold;" | revive<br />
| =================================================================<br />
|}<br />
<br />
==Debug commands==<br />
<br />
{| class="wikitable"<br />
! colspan="2" style="text-align: center; font-weight: bold;" | Debug commands (* denotes e_cheats is required)<br />
|-<br />
| style="text-align: center; font-weight: bold;" | cs_show_menu*<br />
| Displays a menu at the top of the screen with many debug options and useful information about the current save<br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_flags 0<br />
| Displays any currently set flags on screen, "ui_flags 2" can be used to display on the right<br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_scripts* <br />
| Displays scripts on screen.<br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_scripts_compact* <br />
| When scripts are being drawn, this will toggle whether they are compact or not. <br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_scripts_lines* <br />
| When scripts are being drawn, this will toggle whether connecting lines are drawn. <br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_collision* <br />
| ======================<br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_physics* <br />
| ======================<br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_raycasts* <br />
| ======================<br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_nav_data* <br />
| ======================<br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_pathfinds* <br />
| ======================<br />
|-<br />
|-<br />
| style="text-align: center; font-weight: bold;" | debug_widgets<br />
| ======================<br />
|-<br />
|}<br />
<br />
==Editor config commands==<br />
<br />
{| class="wikitable"<br />
! colspan="2" style="text-align: center; font-weight: bold;" | Editor config commands<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_script_line_alpha<br />
| Configure the alpha of the script lines.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_script_line_scroll<br />
| Whether script links should be animated and scroll. The higher the faster.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | r_draw_scripts_lines_head<br />
| The size of the arrow head for script links<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ed_grid_color<br />
| Changes the RGBA of the grid. Ex: 0.5,0.1,0.1,0.8 will make it red.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ed_grid_width<br />
| Changes the pixel width of the grid. default 1.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ed_history_limit<br />
| The limit of changes that the editor will remember.<br />
|-<br />
|}<br />
<br />
==Multiplayer/Lobby commands==<br />
<br />
{| class="wikitable"<br />
! colspan="2" style="text-align: center; font-weight: bold;" | Multiplayer/Lobby commands<br />
|-<br />
| style="text-align: center; font-weight: bold;" | lobby_members<br />
| Write a list of all lobby members to the console.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | lobby_kick<br />
| Kick a player from the lobby. Only works if you're the host. Takes 1 parameter, the lobby member ID. Get the ID using *lobby_members*.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | lobby_say<br />
| Send a chat message via the console.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_multiplayer_limit<br />
| Set this value to some higher value than 4 before opening the "create lobby" menu to allow hosting lobbies with more than 4 players.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | g_multiplayer_ping_limit<br />
| When clients get disconnected, they have this many seconds for their connection to be restored before they are automatically kicked.<br />
|}<br />
<br />
==Sound commands==<br />
<br />
{| class="wikitable"<br />
! colspan="2" style="text-align: center; font-weight: bold;" | Sound commands<br />
|-<br />
| style="text-align: center; font-weight: bold;" | snd_volume<br />
| Master sound volume scale.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | snd_volume_env<br />
| Environment sounds volume scale.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | snd_volume_music<br />
| Music volume scale.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | snd_volume_sfx<br />
| Sound effects volume scale.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | snd_volume_ui<br />
| UI sounds volume scale.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | snd_volume_voice<br />
| Voice sounds volume scale.<br />
|}<br />
<br />
==UI commands==<br />
<br />
{| class="wikitable"<br />
! colspan="2" style="text-align: center; font-weight: bold;" | UI commands<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_bars_visibility<br />
| Whether to show the health/mana bars in the middle of the screen. -1 = never, 0 = only when health or mana is not full, 1 = always.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_chat_fade_time<br />
| The amount of time in milliseconds needs to be elapsed for a chat message to fade out.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_chat_scale<br />
| Scale multiplier of the chat window.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_chat_width<br />
| Width scale of the chat window, scaled by the screen width.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_cursor_alpha<br />
| Transparency scale of the mouse cursor and crosshair.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_cursor_health<br />
| Whether to show your health and mana next to the crosshair.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_cursor_health_alpha<br />
| If *ui_cursor_health* is enabled, this is the transparancy scale for the texts.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_draw_plr_names<br />
| Whether to show player names above player heads. -1 = never, 0 = only in town, 1 = always.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_draw_plr_names_real<br />
| Whether to show player's Steam/GOG names instead of their character names above their heads.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_draw_plr_stats<br />
| Whether to show health bars above other player's heads.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_draw_vignette<br />
| Whether to enable the vignetter effect when badly hurt.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_format_letters<br />
| Whether to show numbers globally as "100k" instead of "100 000", and "1m" instead of "1 000 000".<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_key_count<br />
| Whether to show the key count in the top bar.<br />
|-<br />
| style="text-align: center; font-weight: bold;" | ui_scale<br />
| The scale multiplier of the entire UI.<br />
|}<br />
<br />
{{Template:BaseNav}}</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Main_Page&diff=1510Main Page2019-01-02T12:38:19Z<p>Miss: </p>
<hr />
<div><div style="text-align:center;"><br />
<div class="logo-img" style=""><br />
[[File:Logo game large.png|link=]]<br />
</div><br />
<br />
<br />
Welcome to the Heroes of Hammerwatch wiki. Here you will find plenty of great information on this game.<br />
<br />
Registration is disabled. If you wish to contribute to the wiki, [https://goo.gl/forms/Zr2AKriNJ1XghV8H3 please sign up here]!<br />
<br />
<center><br />
{| class="wikitable" style="text-align:center;padding-top: 6px;"<br />
!colspan="5"|Table of Contents<br />
|-<br />
|width="100"|<br />
{{#sprite:file=File:paladin.png|column=0|row=0|link=Classes}}<br />
[[Classes]]<br />
|width="100"|<br />
{{#sprite:file=File:Items2x.png|column=4|row=4|link=Items}}<br />
[[Items]]<br />
|width="100"|<br />
{{#sprite:file=File:Mayor.png|column=0|row=0|link=Town}}<br />
[[Town]]<br />
|width="100"|<br />
{{#sprite:file=File:Ore.png|column=0|row=0|link=Mechanics}}<br />
[[Mechanics]]<br />
|width="100"|<br />
{{#sprite:file=File:Skeletonr.png|column=0|row=0|link=Enemies}}<br />
[[Enemies]]<br />
|}<br />
</center><br />
<br />
{{Template:BaseNav}}<br />
<br />
</div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Main_Page&diff=1468Main Page2018-10-27T10:29:28Z<p>Miss: </p>
<hr />
<div><div style="text-align:center;"><br />
<div class="logo-img" style=""><br />
[[File:Logo game large.png|link=]]<br />
</div><br />
<br />
<br />
Welcome to the Heroes of Hammerwatch wiki. Here you will find plenty of great information on this game.<br />
<br />
Registration is disabled. If you wish to contribute to the wiki, please send a message to the staff on [https://discord.gg/hammerwatch our Discord].<br />
<br />
<center><br />
{| class="wikitable" style="text-align:center;padding-top: 6px;"<br />
!colspan="5"|Table of Contents<br />
|-<br />
|width="100"|<br />
{{#sprite:file=File:paladin.png|column=0|row=0|link=Classes}}<br />
[[Classes]]<br />
|width="100"|<br />
{{#sprite:file=File:Items2x.png|column=4|row=4|link=Items}}<br />
[[Items]]<br />
|width="100"|<br />
{{#sprite:file=File:Mayor.png|column=0|row=0|link=Town}}<br />
[[Town]]<br />
|width="100"|<br />
{{#sprite:file=File:Ore.png|column=0|row=0|link=Mechanics}}<br />
[[Mechanics]]<br />
|width="100"|<br />
{{#sprite:file=File:Skeletonr.png|column=0|row=0|link=Enemies}}<br />
[[Enemies]]<br />
|}<br />
</center><br />
<br />
{{Template:BaseNav}}<br />
<br />
</div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Main_Page&diff=1467Main Page2018-10-27T10:28:58Z<p>Miss: </p>
<hr />
<div><div style="text-align:center;"><br />
<div class="logo-img" style=""><br />
[[File:Logo game large.png|link=]]<br />
</div><br />
<br />
<br />
Welcome to the Heroes of Hammerwatch wiki. Here you will find plenty of great information on this game.<br />
<br />
Registration is disabled. If you wish to contribute to the wiki, please send a message to Miss#8888 on [https://discord.gg/hammerwatch our Discord].<br />
<br />
<center><br />
{| class="wikitable" style="text-align:center;padding-top: 6px;"<br />
!colspan="5"|Table of Contents<br />
|-<br />
|width="100"|<br />
{{#sprite:file=File:paladin.png|column=0|row=0|link=Classes}}<br />
[[Classes]]<br />
|width="100"|<br />
{{#sprite:file=File:Items2x.png|column=4|row=4|link=Items}}<br />
[[Items]]<br />
|width="100"|<br />
{{#sprite:file=File:Mayor.png|column=0|row=0|link=Town}}<br />
[[Town]]<br />
|width="100"|<br />
{{#sprite:file=File:Ore.png|column=0|row=0|link=Mechanics}}<br />
[[Mechanics]]<br />
|width="100"|<br />
{{#sprite:file=File:Skeletonr.png|column=0|row=0|link=Enemies}}<br />
[[Enemies]]<br />
|}<br />
</center><br />
<br />
{{Template:BaseNav}}<br />
<br />
</div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Script_Hooks&diff=1437Script Hooks2018-10-09T09:31:31Z<p>Miss: </p>
<hr />
<div>Hooks are script functions that are called at specific moments. This way, you can insert code into the game.<br />
<br />
They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods.<br />
<br />
The following is an example of such a file:<br />
<br />
namespace MyTestMod<br />
{<br />
[Hook]<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
{<br />
print("Hello, world!");<br />
}<br />
}<br />
<br />
== GameModeConstructor ==<br />
void GameModeConstructor(Campaign@ campaign)<br />
Called when the Campaign gamemode is being constructed. Useful for initial setting up, for example to add new definitions for items, sets, shops, fountain effects, etc.<br />
<br />
== GameModeStart ==<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
Called in the Campaign gamemode's <code>Start()</code> function. This allows to initialize things and additionally loading any saved data saved in the <code>GameModeSave</code> hook using the <code>save</code> parameter. This paramater is null if there is no save.<br />
<br />
== GameModePostStart ==<br />
void GameModePostStart(Campaign@ campaign)<br />
Called in the Campaign gamemode's <code>PostStart()</code> function. This function is usually used to load things after all the unit behaviors have loaded in, and just before the player is ready to spawn.<br />
<br />
== GameModeUpdate ==<br />
void GameModeUpdate(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's update function. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
== GameModeRenderFrame ==<br />
void GameModeRenderFrame(Campaign@ campaign, int idt, SpriteBatch &sb)<br />
Called for each rendered frame before any UI is drawn. If you're looking for a hook called ''after'' the UI is drawn, use the <code>GameModeRenderWidgets</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is the current time in milliseconds since the last update tick, which means the value will be between 0 and 33. Divide this value by <code>33.0f</code> to get a normalized interpolation factor for animations.<br />
<br />
== GameModeRenderWidgets ==<br />
void GameModeRenderWidgets(Campaign@ campaign, PlayerRecord@ player, int idt, SpriteBatch &sb)<br />
Called for each rendered frame after the UI is drawn. If you're looking for a hook called ''before'' the UI is drawn, use the <code>GameModeRenderFrame</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is described in the <code>GameModeRenderFrame</code> hook description. The <code>player</code> parameter specifies the player that the UI is currently being rendered for. This is typically the local player, but it can also be a different player for spectators.<br />
<br />
== GameModeSave ==<br />
void GameModeSave(Campaign@ campaign, SValueBuilder &builder)<br />
Save any gamemode info. Note that this is separate from town and player record saves. Gamemode saves contain only information necessary to switch from one level to another, or for drop-in multiplayer joining. Use <code>builder</code> to serialize data.<br />
<br />
== GameModeOnRunEnd ==<br />
void GameModeOnRunEnd(Campaign@ campaign, PlayerRecord@ record, bool died)<br />
Called when a player's run has ended. This can happen if the player dies, or if the player beats the game through the EndOfGame worldscript. The player whose run has ended is specified by the <code>record</code> parameter. The <code>died</code> parameter is true if the run has ended because of the player dying, or false if the game was beaten.<br />
<br />
== GameModeInitializePlayer ==<br />
void GameModeInitializePlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when the player record is initialized.<br />
<br />
== GameModeSpawnPlayer ==<br />
void GameModeSpawnPlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when a player has spawned. (B90+)<br />
<br />
== GameModePlayerDied ==<br />
void GameModePlayerDied(Campaign@ campaign, PlayerRecord@ player, PlayerRecord@ killer, DamageInfo &di)<br />
Called when a player dies. (B90+)<br />
<br />
== TownRecordSave ==<br />
void TownRecordSave(TownRecord@ record, SValueBuilder &builder)<br />
Called when the town record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== TownRecordLoad ==<br />
void TownRecordLoad(TownRecord@ record, SValue@ sval)<br />
Called when the town record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRecordSave ==<br />
void PlayerRecordSave(PlayerRecord@ record, SValueBuilder &builder)<br />
Called when a player record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== PlayerRecordLoad ==<br />
void PlayerRecordLoad(PlayerRecord@ record, SValue@ sval)<br />
Called when a player record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRefreshScene ==<br />
void PlayerRefreshScene(PlayerBase@ player)<br />
Called each tick to make sure the player's unit scene is up to date. Useful if you want to add or attach any graphical element on top of the player unit.<br />
<br />
== WidgetHosterLoad ==<br />
void WidgetHosterLoad(IWidgetHoster@ host, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget hoster loaded its gui file. <code>host</code> specifies the host object that loaded the gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
[[Category:Modding]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Script_Hooks&diff=1436Script Hooks2018-10-09T09:31:13Z<p>Miss: </p>
<hr />
<div>Hooks are script functions that are called at specific moments. This way, you can insert code into the game.<br />
<br />
They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods.<br />
<br />
The following is an example of such a file:<br />
<br />
namespace MyTestMod<br />
{<br />
[Hook]<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
{<br />
print("Hello, world!");<br />
}<br />
}<br />
<br />
== GameModeConstructor ==<br />
void GameModeConstructor(Campaign@ campaign)<br />
Called when the Campaign gamemode is being constructed. Useful for initial setting up, for example to add new definitions for items, sets, shops, fountain effects, etc.<br />
<br />
== GameModeStart ==<br />
void GameModeStart(Campaign@ campaign, SValue@ save)<br />
Called in the Campaign gamemode's <code>Start()</code> function. This allows to initialize things and additionally loading any saved data saved in the <code>GameModeSave</code> hook using the <code>save</code> parameter. This paramater is null if there is no save.<br />
<br />
== GameModePostStart ==<br />
void GameModePostStart(Campaign@ campaign)<br />
Called in the Campaign gamemode's <code>PostStart()</code> function. This function is usually used to load things after all the unit behaviors have loaded in, and just before the player is ready to spawn.<br />
<br />
== GameModeUpdate ==<br />
void GameModeUpdate(Campaign@ campaign, int dt, GameInput& gameInput, MenuInput& menuInput)<br />
Called every tick from the Campaign gamemode's update function. Use <code>dt</code> to determine how many milliseconds have passed since the last tick. Note that ticks are different from rendered frames. Ticks typically run at a fixed rate of 30 FPS. You can use <code>gameInput</code> and <code>menuInput</code> here to get information about current controls.<br />
<br />
== GameModeRenderFrame ==<br />
void GameModeRenderFrame(Campaign@ campaign, int idt, SpriteBatch &sb)<br />
Called for each rendered frame before any UI is drawn. If you're looking for a hook called ''after'' the UI is drawn, use the <code>GameModeRenderWidgets</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is the current time in milliseconds since the last update tick, which means the value will be between 0 and 33. Divide this value by <code>33.0f</code> to get a normalized interpolation factor for animations.<br />
<br />
== GameModeRenderWidgets ==<br />
void GameModeRenderWidgets(Campaign@ campaign, PlayerRecord@ player, int idt, SpriteBatch &sb)<br />
Called for each rendered frame after the UI is drawn. If you're looking for a hook called ''before'' the UI is drawn, use the <code>GameModeRenderFrame</code> hook instead. You can use <code>sb</code> to render things to the screen. The <code>idt</code> parameter is described in the <code>GameModeRenderFrame</code> hook description. The <code>player</code> parameter specifies the player that the UI is currently being rendered for. This is typically the local player, but it can also be a different player for spectators.<br />
<br />
== GameModeSave ==<br />
void GameModeSave(Campaign@ campaign, SValueBuilder &builder)<br />
Save any gamemode info. Note that this is separate from town and player record saves. Gamemode saves contain only information necessary to switch from one level to another, or for drop-in multiplayer joining. Use <code>builder</code> to serialize data.<br />
<br />
== GameModeOnRunEnd ==<br />
void GameModeOnRunEnd(Campaign@ campaign, PlayerRecord@ record, bool died)<br />
Called when a player's run has ended. This can happen if the player dies, or if the player beats the game through the EndOfGame worldscript. The player whose run has ended is specified by the <code>record</code> parameter. The <code>died</code> parameter is true if the run has ended because of the player dying, or false if the game was beaten.<br />
<br />
== GameModeInitializePlayer ==<br />
void GameModeInitializePlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when the player record is initialized.<br />
<br />
== GameModeSpawnPlayer ==<br />
void GameModeSpawnPlayer(Campaign@ campaign, PlayerRecord@ record)<br />
Called when a player has spawned.<br />
<br />
== GameModePlayerDied ==<br />
void GameModePlayerDied(Campaign@ campaign, PlayerRecord@ player, PlayerRecord@ killer, DamageInfo &di)<br />
Called when a player dies.<br />
<br />
== TownRecordSave ==<br />
void TownRecordSave(TownRecord@ record, SValueBuilder &builder)<br />
Called when the town record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== TownRecordLoad ==<br />
void TownRecordLoad(TownRecord@ record, SValue@ sval)<br />
Called when the town record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRecordSave ==<br />
void PlayerRecordSave(PlayerRecord@ record, SValueBuilder &builder)<br />
Called when a player record is being saved. Use <code>builder</code> to serialize data.<br />
<br />
== PlayerRecordLoad ==<br />
void PlayerRecordLoad(PlayerRecord@ record, SValue@ sval)<br />
Called when a player record is being loaded. Use <code>sval</code> to deserialize data.<br />
<br />
== PlayerRefreshScene ==<br />
void PlayerRefreshScene(PlayerBase@ player)<br />
Called each tick to make sure the player's unit scene is up to date. Useful if you want to add or attach any graphical element on top of the player unit.<br />
<br />
== WidgetHosterLoad ==<br />
void WidgetHosterLoad(IWidgetHoster@ host, GUIBuilder@ b, GUIDef@ def)<br />
Called when a widget hoster loaded its gui file. <code>host</code> specifies the host object that loaded the gui file. <code>b</code> is the builder object that was used to build the widget tree. <code>def</code> is the definition of the gui file, which can be used to get any defined sprites.<br />
<br />
[[Category:Modding]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=SValue_Loaders&diff=1435SValue Loaders2018-10-05T12:33:13Z<p>Miss: </p>
<hr />
<div>SValue loaders are script functions that deserialize sval files before the gamemode initialization step. (Before the gamemode object even exists!)<br />
<br />
They are defined in sval files like this:<br />
<br />
<loader>SomeFunction</loader><br />
<dict><br />
<string name="example">example</string><br />
</dict><br />
<br />
And loaded by scripts like this:<br />
<br />
void SomeFunction(SValue@ sval)<br />
{<br />
string example = GetParamString(UnitPtr(), sval, "example");<br />
print("SomeFunction example: \"" + example + "\"");<br />
}<br />
<br />
Optionally, you can add a string parameter to the loader function in order to get the filename of the sval file which was loaded. For example:<br />
<br />
void SomeFunction(SValue@ sval, string filename)<br />
{<br />
string example = GetParamString(UnitPtr(), sval, "example");<br />
print("SomeFunction example: \"" + example + "\" (from \"" + filename + "\")");<br />
}<br />
<br />
Note that you may only have 1 of these variations per loader function. It doesn't make much sense to have both. If you do have both, only the function without the filename parameter is called.<br />
<br />
You can also specify an <code>order</code> attribute to specify the order in which they are loaded. This is required with sets for example, as they depend on items to exist.<br />
<br />
Only one loader tag may exist per file.<br />
<br />
== Built-in loaders ==<br />
The following loaders are built-in to Heroes of Hammerwatch:<br />
<br />
* <code>AddItemFile</code> Used for loading item definitions. See also [[Custom items]].<br />
* <code>AddSetFile</code> Used for loading item set definitions.<br />
* <code>AddDrinkFile</code> Used for loading tavern drink definitions.<br />
* <code>Materials::LoadDyes</code> Used for loading player dye definitions. (B90+)<br />
* <code>Titles::LoadTitles</code> Used for loading class title definitions. (B90+)<br />
* <code>Upgrades::LoadShop</code> Used for loading upgrade shop definitions. (B90+)<br />
* <code>Fountain::AddWishFile</code> Used for loading fountain wish definitions. (B90+)</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Editor_guide&diff=1434Editor guide2018-10-04T13:05:45Z<p>Miss: </p>
<hr />
<div>This article describes the most basic parts of the editor, from first setup to launching a smaller test level ingame.<br />
<br />
=Preparation=<br />
Before you start using the editor, you need to setup a working directory for your mod. You will also need an <code>[[info.xml]]</code> file. Take a look at [[Mod base|this page]] how to set this up.<br />
<br />
==Starting the editor==<br />
The editor can be found inside the Heroes of Hammerwatch install directory, called <code>Editor.exe</code>.<br />
<br />
==Workspace==<br />
The editor workspace consists of several parts: ''History'', ''Layers'', ''Properties'', ''Toolbar'', ''Menus'', and the ''Status Bar'', the picture below outlines these parts.<br />
<br />
[[File:Editor_guide_launch.png|thumb|left|175px|Workspace]]<br />
<br />
# '''Menu:''' In the menus you can find most basic functions, like testing the level from the editor and showing and changing the grid.<br />
# '''Tool Bar:''' Quick shortcuts to functions like turn on the grid and simulate physics (it's recommended to turn simulate physics off).<br />
# '''History:''' Saves your current work progrss so you can undo in steps, sometimes this function undoes twice, so be careful, it's better to not use it at all.<br />
# '''Layers:''' Where you choose your work layer. If you have ''Global Selection'' on, you can work in multiple layers at the same time.<br />
# '''Properties:''' Used to change properties of a selected unit or script, like what unit to spawn with a [[SpawnUnit WorldScript]].<br />
# '''Status Bar:''' Shows the number of units selected, zoom grade, on what co-ordinates the mouse cursor is at, and the current level testing options.<br />
<br />
==Game mode==<br />
[[File:Basics_gamemode.png|thumb|175px|GameMode settings]]<br />
Before you start constructing a level, you need to decide what game mode it should have. You should always do this, since it contains important settings and information about the level.<br />
<br />
For this tutorial, we will choose '''StaticLevel''' under the tab '''GameMode''' in the '''Layers''' panel.<br />
<br />
=Constructing=<br />
Now we will start and produce a small playable level. We will place some tilesets, and then move on to building parts and finally some basic scripts to end and start the gameplay with.<br />
<br />
==Environment and tilesets==<br />
[[File:Editor basics tiles.png|thumb|175px|Painting a tileset]]<br />
The absolute first thing you want to do is set a default environmental light of the level, so you can actually see what you are doing (else everything will be black).<br />
<br />
Switch to the '''Lighting''' tab and look down a bit until you see '''Env:''', open that list and look close to the bottom, find the environment called '''system/default.env'''.<br />
<br />
Now enter the '''Tilemap''' tab and scroll down the list until you find a tileset called <code>archives_tiles_red.tileset</code>. Start painting these ''(Add: Left Mouse Button. Remove: Right Mouse Button)'' tiles until you have a good and sturdy ground. There are a few settings in the '''Properties''' panel that you can change, like increase or decrease the size of the paintbrush, this can also be done with the shortcut '''CTRL+MWHEEL'''.<br />
<br />
==Walls==<br />
[[File:Editor basics walls1.png|thumb|175px|Almost a room]]<br />
[[File:Editor basics walls2.png|thumb|175px|Two rooms!]]<br />
Before you start placing walls make sure you set the '''grid''' to '''16''' (either from the menu or by pressing '''"5"''' on the numpad), standard walls are 16 units thick and this will make sure they always follow that grid.<br />
<br />
Now, open the '''Doodads tab''' and in the '''search field,''' type '''archives'''. This will list all units associated with this theme. We are going to use a few different building blocks here, the following is a list of the units we will be using right now:<br />
<br />
* <code>h.unit</code><br />
* <code>v.unit</code><br />
* <code>crn_ne.unit</code><br />
* <code>crn_nw.unit</code><br />
* <code>crn_se.unit</code><br />
* <code>crn_sw.unit</code><br />
<br />
Start by selecting <code>h.unit</code> and place it down using the '''right mouse button'''. Place a couple of these to form a long wall. Then move on to the other units and shape a room with a gap, just like the image to the right.<br />
<br />
When that is done, continue and expand the level so you get two rooms and place a door in between them. Also, trim the tileset so it won't show outside the walls. Now, let's add some decoration and lamps!<br />
<br />
==Artpass and lighting==<br />
The blue area around the walls are called the void, this is outside the level. You can walk there, but enemies and other things might start to act strange and it doesn't look too good either. Think of this as an area you should never see.<br />
<br />
The two basic ways to handle this is either to paint over tilesets there, like grass or something else, or as you can see when you play through the game, you notice that there's roofing on top of the walls making it feel like you are actually inside, which also covers the void. This is the method we will be using here. To achieve this, search the '''Doodads''' tab for '''color''' and you will find units called '''color_archives_*.unit''', where '''*''' are different sizes. Pick the one called '''_512.unit''' and place them around, so they cover all the void around the walls.<br />
<br />
When that's done, let's place some decorative props around the two rooms, this is a list of units that I will be placing around (they are all found inside the Doodads tab):<br />
<br />
* <code>lamp_torch</code><br />
* <code>container_vase.unit</code><br />
* <code>_deco_pillar1</code><br />
* <code>_deco_pillar2</code><br />
* <code>_deco_pillar_square_*</code><br />
<br />
In the end, it might look something like this:<br />
<br />
[[File:Editor basics result.png|link=]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=SValue_Loaders&diff=1432SValue Loaders2018-10-04T11:07:01Z<p>Miss: </p>
<hr />
<div>SValue loaders are script functions that deserialize sval files at the gamemode initialization step. (After the constructor but before <code>Start()</code>).<br />
<br />
They are defined in sval files like this:<br />
<br />
<loader>SomeFunction</loader><br />
<dict><br />
<string name="example">example</string><br />
</dict><br />
<br />
And loaded by scripts like this:<br />
<br />
void SomeFunction(SValue@ sval)<br />
{<br />
string example = GetParamString(UnitPtr(), sval, "example");<br />
print("SomeFunction example: \"" + example + "\"");<br />
}<br />
<br />
Optionally, you can add a string parameter to the loader function in order to get the filename of the sval file which was loaded. For example:<br />
<br />
void SomeFunction(SValue@ sval, string filename)<br />
{<br />
string example = GetParamString(UnitPtr(), sval, "example");<br />
print("SomeFunction example: \"" + example + "\" (from \"" + filename + "\")");<br />
}<br />
<br />
Note that you may only have 1 of these variations per loader function. It doesn't make much sense to have both. If you do have both, only the function without the filename parameter is called.<br />
<br />
You can also specify an <code>order</code> attribute to specify the order in which they are loaded. This is required with sets for example, as they depend on items to exist.<br />
<br />
Only one loader tag may exist per file.<br />
<br />
== Built-in loaders ==<br />
The following loaders are built-in to Heroes of Hammerwatch:<br />
<br />
* <code>AddItemFile</code> Used for loading item definitions. See also [[Custom items]].<br />
* <code>AddSetFile</code> Used for loading item set definitions.<br />
* <code>AddDrinkFile</code> Used for loading tavern drink definitions.<br />
* <code>Materials::LoadDyes</code> Used for loading player dye definitions. (B90+)<br />
* <code>Titles::LoadTitles</code> Used for loading class title definitions. (B90+)<br />
* <code>Upgrades::LoadShop</code> Used for loading upgrade shop definitions. (B90+)<br />
* <code>Fountain::AddWishFile</code> Used for loading fountain wish definitions. (B90+)</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Editor_guide&diff=1431Editor guide2018-10-04T10:32:49Z<p>Miss: Created page with "This article describes the most basic parts of the editor, from first setup to launching a smaller test level ingame. =Preparation= Before you start using the editor, you nee..."</p>
<hr />
<div>This article describes the most basic parts of the editor, from first setup to launching a smaller test level ingame.<br />
<br />
=Preparation=<br />
Before you start using the editor, you need to setup a working directory for your mod. You will also need an <code>[[info.xml]]</code> file. Take a look at [[Mod base|this page]] how to set this up.<br />
<br />
==Starting the editor==<br />
The editor can be found inside the Heroes of Hammerwatch install directory, called <code>Editor.exe</code>.<br />
<br />
==Workspace==<br />
The editor workspace consists of several parts: ''History'', ''Layers'', ''Properties'', ''Toolbar'', ''Menus'', and the ''Status Bar'', the picture below outlines these parts.<br />
<br />
[[File:Editor_guide_launch.png|thumb|left|175px|Workspace]]<br />
<br />
# '''Menu:''' In the menus you can find most basic functions, like testing the level from the editor and showing and changing the grid.<br />
# '''Tool Bar:''' Quick shortcuts to functions like turn on the grid and simulate physics (it's recommended to turn simulate physics off).<br />
# '''History:''' Saves your current work progrss so you can undo in steps, sometimes this function undoes twice, so be careful, it's better to not use it at all.<br />
# '''Layers:''' Where you choose your work layer. If you have ''Global Selection'' on, you can work in multiple layers at the same time.<br />
# '''Properties:''' Used to change properties of a selected unit or script, like what unit to spawn with a [[SpawnUnit WorldScript]].<br />
# '''Status Bar:''' Shows the number of units selected, zoom grade, on what co-ordinates the mouse cursor is at, and the current level testing options.<br />
<br />
==Game mode==<br />
[[File:Basics_gamemode.png|thumb|100px|GameMode settings]]<br />
Before you start constructing a level, you need to decide what game mode it should have. You should always do this, since it contains important settings and information about the level.<br />
<br />
For this tutorial, we will choose '''StaticLevel''' under the tab '''GameMode''' in the '''Layers''' panel.<br />
<br />
=Constructing=<br />
Now we will start and produce a small playable level. We will place some tilesets, and then move on to building parts and finally some basic scripts to end and start the gameplay with.<br />
<br />
==Environment and tilesets==<br />
[[File:Editor basics tiles.png|thumb|100px|Painting a tileset]]<br />
The absolute first thing you want to do is set a default environmental light of the level, so you can actually see what you are doing (else everything will be black).<br />
<br />
Switch to the '''Lighting''' tab and look down a bit until you see '''Env:''', open that list and look close to the bottom, find the environment called '''system/default.env'''.<br />
<br />
Now enter the '''Tilemap''' tab and scroll down the list until you find a tileset called <code>archives_tiles_red.tileset</code>. Start painting these ''(Add: Left Mouse Button. Remove: Right Mouse Button)'' tiles until you have a good and sturdy ground. There are a few settings in the '''Properties''' panel that you can change, like increase or decrease the size of the paintbrush, this can also be done with the shortcut '''CTRL+MWHEEL'''.<br />
<br />
==Walls==<br />
[[File:Editor basics walls1.png|thumb|100px|Almost a room]]<br />
[[File:Editor basics walls2.png|thumb|100px|Two rooms!]]<br />
Before you start placing walls make sure you set the '''grid''' to '''16''' (either from the menu or by pressing '''"5"''' on the numpad), standard walls are 16 units thick and this will make sure they always follow that grid.<br />
<br />
Now, open the '''Doodads tab''' and in the '''search field,''' type '''archives'''. This will list all units associated with this theme. We are going to use a few different building blocks here, the following is a list of the units we will be using right now:<br />
<br />
* <code>h.unit</code><br />
* <code>v.unit</code><br />
* <code>crn_ne.unit</code><br />
* <code>crn_nw.unit</code><br />
* <code>crn_se.unit</code><br />
* <code>crn_sw.unit</code><br />
<br />
Start by selecting <code>h.unit</code> and place it down using the '''right mouse button'''. Place a couple of these to form a long wall. Then move on to the other units and shape a room with a gap, just like the image to the right.<br />
<br />
When that is done, continue and expand the level so you get two rooms and place a door in between them. Also, trim the tileset so it won't show outside the walls. Now, let's add some decoration and lamps!<br />
<br />
==Artpass and lighting==<br />
The blue area around the walls are called the void, this is outside the level. You can walk there, but enemies and other things might start to act strange and it doesn't look too good either. Think of this as an area you should never see.<br />
<br />
The two basic ways to handle this is either to paint over tilesets there, like grass or something else, or as you can see when you play through the game, you notice that there's roofing on top of the walls making it feel like you are actually inside, which also covers the void. This is the method we will be using here. To achieve this, search the '''Doodads''' tab for '''color''' and you will find units called '''color_archives_*.unit''', where '''*''' are different sizes. Pick the one called '''_512.unit''' and place them around, so they cover all the void around the walls.<br />
<br />
When that's done, let's place some decorative props around the two rooms, this is a list of units that I will be placing around (they are all found inside the Doodads tab):<br />
<br />
* <code>lamp_torch</code><br />
* <code>container_vase.unit</code><br />
* <code>_deco_pillar1</code><br />
* <code>_deco_pillar2</code><br />
* <code>_deco_pillar_square_*</code><br />
<br />
In the end, it might look something like this:<br />
<br />
[[File:Editor basics result.png|link=]]</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=File:Editor_basics_result.png&diff=1430File:Editor basics result.png2018-10-04T10:32:35Z<p>Miss: </p>
<hr />
<div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=File:Editor_basics_walls1.png&diff=1429File:Editor basics walls1.png2018-10-04T10:23:35Z<p>Miss: </p>
<hr />
<div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=File:Editor_basics_walls2.png&diff=1428File:Editor basics walls2.png2018-10-04T10:23:12Z<p>Miss: </p>
<hr />
<div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=File:Editor_basics_tiles.png&diff=1427File:Editor basics tiles.png2018-10-04T10:10:22Z<p>Miss: </p>
<hr />
<div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=File:Basics_gamemode.png&diff=1426File:Basics gamemode.png2018-10-04T10:10:11Z<p>Miss: </p>
<hr />
<div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=File:Editor_guide_launch.png&diff=1425File:Editor guide launch.png2018-10-04T10:04:23Z<p>Miss: Miss uploaded a new version of File:Editor guide launch.png</p>
<hr />
<div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=File:Editor_guide_launch.png&diff=1424File:Editor guide launch.png2018-10-04T10:01:19Z<p>Miss: </p>
<hr />
<div></div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=Mod_support&diff=1423Mod support2018-10-04T09:56:52Z<p>Miss: /* Editor */</p>
<hr />
<div>Welcome to the modding page! This page is dedicated to offering a list of important information in a ladder to get around modding Heroes of Hammerwatch!<br />
<br />
=Modding resouces=<br />
==Starting a mod==<br />
* [[mod_base|How to start]]<br />
* [[Info.xml|info.xml specification]]<br />
* [[Unpack resources]]<br />
<br />
==Editor==<br />
* [[Editor guide]]<br />
<br />
===How to use:===<br />
*Assets<br />
*Tilemaps<br />
*Environment lighting<br />
====.unit,.effect & .inc====<br />
*Doodads<br />
*Actors<br />
*Items<br />
*Link child unit to inc. (Like the act walls!)<br />
====Worldscripts====<br />
*Linking worldscripts<br />
===How to put those into:===<br />
*Levels<br />
*Prefabs<br />
====How to put Prefabs into:====<br />
*Levels! lol<br />
<br />
==Custom assets page==<br />
===How to add:===<br />
*Tilemaps<br />
*Doodads<br />
*Actors<br />
*Items<br />
*Worldscripts<br />
<br />
==Scripting/GUI page?==<br />
*GUI modification and creation<br />
===Scripting modification and creation===<br />
*GUI scripts<br />
*Worldscript<br />
*Gamemode scripts<br />
<br />
==Upload to workshop==<br />
[[Uploading_to_the_workshop|How to upload to the workshop]] <br />
<br />
=List of common resources=<br />
*[[Custom_items|Custom Items]]<br />
*[[Script_Hooks|Script Hooks]]<br />
*[[List_of_modifiers|List of modifiers]]<br />
*[[SValue_Loaders|SValue loaders]]<br />
<br />
{{Template:BaseNav}}</div>Misshttp://wiki.heroesofhammerwatch.com/index.php?title=SValue_Loaders&diff=1421SValue Loaders2018-10-03T16:08:00Z<p>Miss: /* Built-in loaders */</p>
<hr />
<div>SValue loaders are script functions that deserialize sval files at the gamemode initialization step. (After the constructor but before <code>Start()</code>).<br />
<br />
They are defined in sval files like this:<br />
<br />
<loader>SomeFunction</loader><br />
<dict><br />
<string name="example">example</string><br />
</dict><br />
<br />
And loaded by scripts like this:<br />
<br />
void SomeFunction(SValue@ sval)<br />
{<br />
string example = GetParamString(UnitPtr(), sval, "example");<br />
print("SomeFunction example: \"" + example + "\"");<br />
}<br />
<br />
Optionally, you can add a string parameter to the loader function in order to get the filename of the sval file which was loaded. For example:<br />
<br />
void SomeFunction(SValue@ sval, string filename)<br />
{<br />
string example = GetParamString(UnitPtr(), sval, "example");<br />
print("SomeFunction example: \"" + example + "\" (from \"" + filename + "\")");<br />
}<br />
<br />
Note that you may only have 1 of these variations per loader function. It doesn't make much sense to have both. If you do have both, only the function without the filename parameter is called.<br />
<br />
You can also specify an <code>order</code> attribute to specify the order in which they are loaded. This is required with sets for example, as they depend on items to exist.<br />
<br />
Only one loader tag may exist per file.<br />
<br />
== Built-in loaders ==<br />
The following loaders are built-in to Heroes of Hammerwatch:<br />
<br />
* <code>AddItemFile</code> Used for loading item definitions. See also [[Custom items]].<br />
* <code>AddSetFile</code> Used for loading item set definitions.<br />
* <code>AddDrinkFile</code> Used for loading tavern drink definitions.<br />
* <code>Materials::LoadDyes</code> Used for loading player dye definitions.<br />
* <code>Titles::LoadTitles</code> Used for loading class title definitions.<br />
* <code>Upgrades::LoadShop</code> Used for loading upgrade shop definitions.<br />
* <code>Fountain::AddWishFile</code> Used for loading fountain wish definitions.</div>Miss