[English] Ability modding

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [English] Ability modding

      This is a guide about editing and making abilities to Guild 2. It lists most important files concerning ability modding and what to do with them.

      This file lists all abilities in the game. Original ones can be removed and edited, or new ones can be added. Do not touch the ability “none” on the first line.

      id: Unique index for the ability (positive integer).

      name: Unique “name” for the ability (no spaces). This name is not shown in the game, but it is connected to Text.dbt file, where the ability gets its name and description, and to ability’s icon file.

      minlevel: The minimum level this ability can be chosen and the level of ability in abilitypoint.dbt file. This could technically have any level between 1 and 10 but, for visual reasons by UI limitations, only levels 2, 4, 7 and 10 should be used (unless editing of UI becomes possible).

      skill and skilllevel: These two define the talent (skill) and its level (skillevel) required for choosing this ability. Values for different talents are listed in Skills.dbt file. Works perfectly even though not utilized by the unmodded game.

      maxcount: How many times a character can choose this ability at level ups.

      class1, class2, class3: Define which character classes can choose this ability. Works perfectly even though not utilized by the unmodded game.
      0: none
      1: Patron
      2: Craftsman
      3: Scholar
      4: Rogue
      19: All

      target: Defines the target of this ability, usually the recipient of various bonuses given by the ability. Abilities that affect employees are buggy and should thus be handled with scripts instead. More about that later in this guide.
      0: nothing
      1: character itself
      2: employees
      3: buildings
      4: children
      5: combination of 1 and 2.

      target_building_class: Used with target values 2, 3 and 5. Defines what type of buildings the ability affects. Building type values can be found at BuildingTypes.dbt file. Value 0 affects all buildings but there is a minor bug with non-workshop buildings if used with target value 3. In case of target values 2 and 5 the ability affects employees in this type of building instead of the building itself.

      list: This is the actual effect of the ability in the form of a list. Each effect is a pair of values. The second value is the impact from Impacts.dbt table and the first one defines how much the value of the impact is changed. Different impacts use different types of values so it is good idea to check these value types from the existing abilities.

      Ability point gains are defined in this table. The original values can be edited, and new lines added. Do not touch the zero line.

      id: Unique index for the ability point.

      level: Character level when this ability point is gained (1-10). Same level can be used several times, but id value must be different.

      abilitylevel: The level of abilities that can be gained with this ability point. Should be 2, 4, 7 or 10 for reason described above.

      Defines effects in the game. You should not need to edit the existing impacts for adding new abilities, but you might want to add new ones that do not have any effect by themselves to be used as variables in scripts.

      id: Unique index for the impact.

      modtype: Should be 1 for new ability impacts.

      timetype: Calculation type how impact’s value is applied in the game. Should usually be 2 for new ability impacts (linear addition/subtraction).

      defaultvalue: Impact’s value by default. Should usually be 0 for new ability impacts.

      name: Unique “name” for the impact (no spaces). This name is not shown in the game, but it is connected to Text.dbt, where the impact gets its name, tooltip, and description.

      effecttype: Should be 0 for new ability impacts.

      icon: file path for the impact’s icon (tga).

      This table contains all the strings in the game in your language. If you want to edit existing abilities, find their names and descriptions here and edit to your liking. In case of new abilities, you must add new lines with unique id value for them. Same for new impacts. Format for the new ability and impact string labels are:
      In strings above “abilityname” and “impactname” are the “names” defined in abilities.dbt and Impact.dbt files.

      Ability icons
      Icon files for new abilities are in tga format and must have correct dimensions (256x179 px) and the same name as the ability in the abilities.dbt file. The path for the new ability icons is: Textures\Hud\Abilities\ . There is usually at least one icon file already in the folder so you should use it as a base to get correct dimensions for your new icons. If an ability does not have a defined icon, a default one will be used instead.
      Default icons are stored as sets in Textures\Hud\SetAbilities10.dds and Textures\Hud\SetAbilities11.dds files. These icons can be overwritten by new icons in Abilities folder, but you should not edit these two files. However, you can use them to create new icons. For that you must open them in program such as GIMP and copy parts of them to your new icon file. Also, if you simply want to use an existing icon for your new ability, it is still necessary to create a new tga file if you want to keep the original ability.

      Most abilities do not need editing to scripts but there also some that work completely or partially via scripts. Some ways to make script-based abilities are to use SimHasAbility function to check if the character has some specific ability or to check impact values affected by your abilities with GetImpactValue function. You may need some coding skills, but it is possible affect many things in the game with abilities if you use scripts.

      Employee bonus abilities:
      The abilities that affect employees need editing (e.g. to chr.lua script). Function CalculateBuildingBonus provides new employees with bonuses from building upgrades and removes them when they are fired. The abilities need similar script to give new employees bonuses from owner’s abilities because the original implementation is buggy. It is easiest to use the edited files of Megamod Reforged as a base, as they already have my workaround for this bug. In this case, for abilities with target value 2 leave the “list” empty (so they do nothing) and for abilities with target value 5 change “target” to 1 (so they only affect the character itself) in abilities.dbt file, add new impact for each new employee bonus ability to Impacts.dbt file and expand CalculateAbilityBonus function in chr.lua with your own abilities. Also, “maxcount” in abilities.dbt must be 1.