Fandom

HammerWiki

API Changes Patch 1.3.1

6,449pages on
this wiki
Add New Page
Comments0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

GameData.ItemSlots has changed to GameData.EquipSlots. For mods which deal with equipment, the former will need to be replaced with the latter.

The scenario API has undergone some changes in order to support the addition of a "wrap up" period at the end of scenarios before players are forced to leave the scenario instance.

The following events have been added: SCENARIO_POST_MODE - broadcast by the game to inform the UI that the 2-minute wrap up period has begun. SCENARIO_FINAL_SCOREBOARD_CLOSED - this event is broadcast by the UI to inform the game that the player is done viewing the scoreboard and should be zoned back into the game world. The GetScenarioData() function has been removed. It was effectively redundant with GameData.GetScenarioPlayers() which should be used instead. The variables GameData.ScenarioData.running and GameData.ScenarioData.hasEnded have been removed. The removed variables have been replaced with a single status variable, GameData.ScenarioData.mode - the value of which can be one of the following:

       GameData.ScenarioMode.PRE_MODE - Scenario has not yet started (start timer counting down).
       GameData.ScenarioMode.RUNNING - Scenario is currently in progress (game timer counting down).
       GameData.ScenarioMode.POST_MODE - Scenario has finished but is in the new "wrap up" time (2 minute timer).
       GameData.ScenarioMode.ENDED - The player is not in a scenario.


The functions MapGetCoordinatesForPoint() and MapGetPointForCoordinates have been altered as part of fixing them to return the proper values in certain zones (e.g. cities). MapGetCoordinatesForPoint() now expects its input values to have already been scaled relative to the UI scale. This means that if before you were passing x,y to it, you should now divide both x and y by the value returned from InterfaceCore.GetResolutionScale() first. MapGetPointForCoordinates() now returns its output values already scaled to match the current resolution. Thus if you were previously dividing the x,y output values by the resolution scaling factor, you no longer need to.

A new function ActionButtonGroupSetShowing(buttonGroup, buttonIndex, show) has been added. It allows individual buttons within an ActionButtonGroup to be shown/hidden at will.

Two new functions, TextEditBoxGetCursorPosition(name) and TextEditBoxSetCursorPosition(name, pos), have been added to allow the UI to determine and control the position of the cursor within an EditBox. The position is an integer value specifying how many characters come before the cursor (thus if the cursor as at the beginning of the box, the position is 0).

The GameData.Realms table of constants has been removed. It was redundant with the GameData.Realm table which should be used instead. Note that the keys to each table are slightly different - the removed table used GameData.Realms.REALM_ORDER while the remaining table uses GameData.Realm.ORDER, et cetera.

The savesettings parameter for windows which are anchored to Root now defaults to "false" - if you wish to have a window's position saved automatically by the game, you will need to explicitly set this option to "true".

Some new options have been added to the .mod format to provide expanded capabilities and to allow for increased the increased functionality of the overhauled Addons window in 1.3.1:

A new tag, <Replaces name="DefaultUIModuleName">, has been added. This tag allows you to specify that your mod is designed to replace an existing default UI module. If such a tag is encountered by the WAR addon loader, it will not load the default UI module specified, but instead trust that your addon implements all of the necessary functionality previously provided by the default module. When using this tag, the default UI module you specific is not loaded at all - you need to implement ALL of the functionality of the default module, or else you might cause other default/addon modules to break! For this reason, you probably shouldn't replace default modules that load things like fonts, since you won't be able to load those resources yourself!

A new container tag, <WARInfo> has been added. It contains two other types of tags to specify what categories and careers a mod is recommended for. An example WarInfo with all of the possible options is included below; you can copy-paste it into your .mod file and then simply remove the lines which do not apply. There is no limit on how many categories or careers you may specify for your mod, nor does it affect how your mod operates - these are merely for display purposes and easier management of addons by the player.

 <WARInfo>
   <Categories>
       <Category name="ACTION_BARS" />
       <Category name="ITEMS_INVENTORY" />
       <Category name="BUFFS_DEBUFFS" />
       <Category name="RVR" />
       <Category name="GROUPING" />
       <Category name="CAREER_SPECIFIC" />
       <Category name="MAIL" />
       <Category name="COMBAT" />
       <Category name="AUCTION" />
       <Category name="CHAT" />
       <Category name="QUESTS" />
       <Category name="MAP" />
       <Category name="CRAFTING" />
       <Category name="SYSTEM" />
       <Category name="DEVELOPMENT" />
       <Category name="OTHER" />
   </Categories>
   <Careers>
       <Career name="BLACKGUARD" />
       <Career name="WITCH_ELF" />
       <Career name="DISCIPLE" />
       <Career name="SORCERER" />
       <Career name="IRON_BREAKER" />
       <Career name="SLAYER" />
       <Career name="RUNE_PRIEST" />
       <Career name="ENGINEER" />
       <Career name="BLACK_ORC" />
       <Career name="CHOPPA" />
       <Career name="SHAMAN" />
       <Career name="SQUIG_HERDER" />
       <Career name="WITCH_HUNTER" />
       <Career name="KNIGHT" />
       <Career name="BRIGHT_WIZARD" />
       <Career name="WARRIOR_PRIEST" />
       <Career name="CHOSEN" />
       <Career name= "MARAUDER" />
       <Career name="ZEALOT" />
       <Career name="MAGUS" />
       <Career name="SWORDMASTER" />
       <Career name="SHADOW_WARRIOR" />
       <Career name="WHITE_LION" />
       <Career name="ARCHMAGE" />
   </Careers>
 </WARInfo>

Also on Fandom

Random Wiki