Skip to content

Adding Emulator Support

NotCoffee418 edited this page Nov 4, 2021 · 17 revisions

Importing a profile

You found an unofficial emulator profile online or and would like to add use it with TrinityCreator.

Simply copy the file to My Documents\TrinityCreator\Profiles.

Then select the profile in the top menu under Config > Choose Emulator Profile and get creating!

Creating a profile

tl;dr

Most emulators are forks from each other and have a similar database structure. So it's recommended to modify an existing profile rather than creating a fresh one.

  1. Go to the top menu and click on Advanced Tools > Profile Creator.
  2. Either Load profile from file to modify an existing profile or create one from scratch.
  3. Save it and share it by creating an issue and attaching the profile in a zip.

Notes:

  • You don't need all fields. Some are intended to support different database structures and contradict eachother. (See below)
  • Make sure to change the profile info to accurately describe which profile it supports.
  • Revisions should only be used when adding new functionality or fixing a bug. If your emulator has changed it's database structure in an update, you should create a new profile for this version.

Video Tutorial

Video Tutorial

Long version

Introduction

Since v1.1 you're able to (relatively) easily add support for emulators which are not supported by default, rather than having to rely on me adding support for your specific version of an emulator.

There are few restrictions, however some tools may not work for newer versions of the game (Cataclysm and newer) since these often require additional non-default data that the application cannot provide at this time.

In the Profile Creator tool you can view all the fields that Trinity Creator can export. Aside from those you can also export blank fields and duplicate fields for databases that don't provide default values for unsupported columns.

Before you get started

  • Use Google. Maybe someone else has already shared a profile for your emulator & WoW/DB version.
  • If you create a working profile, please feel free to add it with a pull request or by opening an issue with the profile file attached.

Getting started

  1. Open Profile Creator tool. You can find it inside Trinity Creator at the top menu under Advanced Tools > Profile Creator.
  2. a) Skip the next steps if you're creating a profile from scratch b) Find a profile that's similar to your emulator. eg. If you want to support a repack forked from TrinityCore 3.3.5a then pick the TrinityCore 3.3.5a profile.
  3. Download the profile to My Documents\TrinityCore\Profiles. You can do this by clicking the profile, Right-clicking the "Raw" button at the top right > "Save link as".
  4. In the Profile Creator click on Load profile from file and select the downloaded profile.

Understanding how profiles work

Profile Info

Profile Info is mostly explanatory. It's the identifying information for the profile that shows up in the Profile Selection menu.

GameVersion is the one exception. It MUST conform to these requirements or the application will start throwing errors.

Requirements:

  • Must contain .
  • Everything before the first . must be numeric (int parsable).
Acceptable Not acceptable:
1.12 WoW 1.12
1.12.2 335
3.3.5a a5.3.3

Creator Tabs

These are Item, Creature, Quest, Loot andVendor. Possibly a few more in the future. You will find that these have 4 columns. 3 with a textbox and one with a checkbox. TrinityCreator Row

Each row represents a property in the application that should be exported to a specific column in your database.

  • First column - AppKey: It's what the application calls the property. It's entered into the profile creator by the application itself and can be referenced by custom fields (see below). It's used to know which value to grab from the creator tools and place into the database.
  • Second column - SqlKey: This is the column name in your emulator's database. You will need to find the correct column where you want the value to be placed. This is often the same a the AppKey but not always, hence the need for these profiles.
  • Third column - Table Name: This is where the name of the table where the SqlKey is found. Pretty straightforward with one peculiarity:
    • Wildcard: %t can be used as a wildcard when applicable. Currently this only applies to Loot. Loot has multiple tables with the same structure. Disenchanting, fishing, skinning and other loot. Using %t will replace %t with the correct word depending on what the user selects. In most cases the loot table name should simply be: %t_loot_template.
  • Fourth column - Disable Unchecking this box will prevent the application from exporting the value related to it's AppKey. You will need to do this in some special cases (see below) or when functionality simply isn't supported. For example AppKeys related to gems would need to be disabled for a 1.12 profile.

Custom Fields

You will need to use this on most emulators that have columns required by the application scattered across different tables. These are similar to the creator tab's columns with the exception that the AppKey can be manually defined. They can be used to duplicate data in another column. This is primarily used to set the creation id in addon tables since Trinity Creator has no way of knowing what the id of addon and other tables is and can't do it automatically.

enter image description here

Example: Not using custom fields on creature_equipment_template would result in a query like this: INSERT INTO creature_equip_template (Weapon1, Weapon2, Weapon3) ... While we need a query like this for the emulator to understand which creature this data is for: INSERT INTO creature_equip_template (CreatureID, Weapon1, Weapon2, Weapon3) ...

We can easily resolve that by referencing an AppKey in the AppKey field like so: enter image description here

The SqlKey, TableName and Disable keys are fair game to do with what you want, but the AppKey field in Custom Fields must be one of the following formats:

  • Tool.AppKey Tool: This can only be Item, Quest or Creature. Other tools don't currently support this. AppKey: This is the AppKey found in the creator tabs above. Examples: Creature.Entry, Quest.EntryId, Item.Entry NOTE: Item and Creature's AppKey is Entry while Quest's is EntryId. You can scroll up in the profile creator for reference. NOTE: These are case-sensitive. Mistype their case and your custom ID simply won't export.

  • Empty.Type This can be used when an emulator database doesn't provide a default value but requires one to export it. The application will instead export an empty value. There are only three valid options for Empty

    • Empty.String (Exports: '')
    • Empty.Int (Exports: 0)
    • Empty.Float (Exports: 0)

This will also support custom default values at some point in the future. Please open a ticket if you have need for this feature.

Custom Display Fields

Using the concept of Custom Fields (see above), you can add custom columns to your export with data input in the UI

Definitions

The appkey contains a lot of information to nake the Custon Display Field do what you need it to.
It's split in three parts seperated by a dot.

  • Creator Type
    • Creature
    • Item
    • Quest
  • Datatype
    • CustomInt (number)
    • CustomFloat (comma number)
    • CustomText (Text)
  • Display name
    • This what the custom display field is described as in the UI

Example

Let's say for example, you have modified your emulator to allow for pickpocketing NPCs and want to define the amount you can pickpocket from an NPC using Trinity Creator.

In this example we'll assume this is defined by the column PickpocketAmount in the table creature_template. You can define it in the profile creator like so: AppKey: Creature.CustomInt.Pickpocket SqlKey: PickpocketAnount Table: creature_template

Profile Structure

All profile files will look something like this when saved.

Structure Meaning Unlike the Profile Creator UI, data is structured like so:

"ToolName": {    
    "TableName1": {
      "AppKey1": "SqlKey1",
      "AppKey2": "SqlKey2",
    },
    "TableName2": {
      "AppKey3": "SqlKey3",
      "AppKey4": "SqlKey4",
    },
  }

This makes editing the file after creation easier if you prefer not to load up the UI to fix a typo or to better understand which values are placed in which table.

Creating an emulator profile

  1. Open your preferred database editor. I'll use HeidiSQL or whichever one you prefer. Just don't use Navicat because it likes to break wow emulator databases.

  2. Connect to your world database. You can find the login info in your emulator's World config file.

  3. Time for data entry! Start going through the list of AppKeys and find the corresponding SqlKeys (columns) and table names. These are not case sensitive.

Notes:

  • Columns might have slightly different names, try to find them and rename them in the PROFILE (never edit the database structure!)creature_template_addon or creature_queststarter -- generaly anything with creature_xxxx
  • Any values that you can't find can be removed or commented out. This will of course remove functionality unless you're dealing with the exceptions listed above. Usually they're simply renamed or moved, unless you're on a lower version of WoW.
  • If you're not sure if a column is what you're looking for, check this page for reference.
  • Columns might be placed in different tables. if you're doing creatures you might look for tables named

Exceptional columns

There's a few rows you need to skip depending on which emulator you use. If you have to use the row on the left, uncheck the ones on the right and vice versa.

Creature Resistance The seperate table equivalent will never need a customfield to be added. This is already done by ResistanceCreatureId.

In Primary Table In Seperate Table
HolyResistance ResistanceCreatureId
FireResistance ResistanceSchool
NatureResistance ResistanceAmount
FrostResistance
ShadowResistance
ArcaneResistance

Creature Spells The seperate table equivalent will never need a customfield to be added. This is already done by SpellCreatureID.

In Primary Table In Seperate Table
Spell1 SpellCreatureID
Spell2 SpellSpell
Spell3 SpellIndex
Spell4
Spell5
Spell6
Spell7
Spell8

Creature InhabitType The seperate table equivalent will never need a customfield to be added. This is already done by SpellCreatureID. InhabitType (in primary table) exports as a bitmask. While the alternative version uses seperate columns exporting values as 0 or 1. In Seperate Table usually places them in creature_template_movement.

In Primary Table In Seperate Table
InhabitType InhabitCreatureID
InhabitGround
InhabitWater
InhabitFlight

Creature Modifiers Older emulators tend to use hardcoded damage (MinDmg-MaxDmg), health (MinLevelHealth-MaxLevelHealth, etc.) Newer ones will usually rely on Modifiers (DamageModifier, HealthModifier, etc.) You will have to disable whichever ones you don't use.

Testing

You can test each creation tool after all of it's values (and custom fields) have been entered. Simply save the profile to My Documents\TrinityCreator\Profiles and activate the profile in the top menu under Config > Choose Emulator Profile.

Best practice is to test exporting to the database in case of typos. Use a database you don't care about. You can also export the structure of your active database (without all the data) and import it into a new testing database.