Search

Online Users

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests

Most users ever online was 160 on Mon Nov 19, 2018 5:32 pm

Registered users: No registered users based on users active over the past 5 minutes

Videos

Basic Unit Modding

AI Creation, Map & Mod Making
Fri Jul 11, 2014 10:17 am

  • by Chimaeros

    Until someone figures a way to extract the files from the .rwd, get your hands on a hex editor like UltraEdit and take a look inside the data.rwd file. Just about everything other than graphics, sounds, etc. are in text files (.tgi) which can be modded.

    Edit: Note that you can now use several programs to extract files from the .rwd. See the Downloads->Utilities section of this site.

    What you will need to do is replicate the directory structure that is inside the .rwd. In your Kings of War directory, create a Data folder. I believe everything will then go inside that...for example:

    You want to create a new Drauga unit.

    1. Create the following directories /Data/Units/Drauga
    2. Using a hex editor, copy one of the existing units as a template:

    Here is the Drauga Huntmaster:

    [Thing template = K2DraugaUnit]
    {
    IDS = huntmaster
    name = "#huntmaster_name"

    [View]
    {
    resource_prefix = Huntmaster/Huntmaster

    [WhenCreated Template=FXC_Equipment]
    action = HIDE
    location = RHAND
    equipment_type_ids = horn
    }

    [BodyComponent]
    {
    health = 500
    defense = 1

    [WhenHealth Template=FXC_PlayHitEffect]
    {
    health_trigger_type = RELATIVE_DECREASE
    health = 0.035

    pivot = head
    axis = 0,0,1
    max_impulse = 500
    max_damage = 0.20
    max_angle = 30
    vel_decay = 1.05
    stiffness = 15
    }
    }

    [CharacterComponent]
    {
    [Animation Template=MoveAnimation]
    IDS = walk
    walk_distance = 1.5

    [Animation Template=MoveAnimation]
    IDS = jog
    walk_distance = 2.5

    [Animation Template=IdleAnimation]
    IDS = idle

    [Animation Template=MeleeIdleAnimation]
    IDS = idlemelee

    [Animation Template=FidgetAnimation]
    IDS = fidget1

    [Animation Template=FidgetAnimation]
    IDS = fidget2

    [Animation Template=DieAnimation]
    {
    IDS = die1

    [WhenStart template=FXC_PlaySFX]
    audio_ids = huntmaster_death
    }

    [Animation Template=MeleeAttackAnimation]
    IDS = melee1
    key_ratio = 0.6

    [Animation Template=MeleeAttackAnimation]
    IDS = melee2
    key_ratio = 0.6

    [Animation Template=CastAnimation]
    {
    IDS = cast
    key_ratio = 0.48

    [WhenStart Template=FXC_Equipment]
    action = UNHIDE
    location = RHAND
    equipment_type_ids = horn

    [WhenStart Template=FXC_Equipment]
    action = HIDE
    location = RHAND
    equipment_type_ids = sword

    [WhenEnd Template=FXC_Equipment]
    action = HIDE
    location = RHAND
    equipment_type_ids = horn

    [WhenEnd Template=FXC_Equipment]
    action = UNHIDE
    location = RHAND
    equipment_type_ids = sword
    }

    [Animation Template=CastIdleAnimation]
    IDS = idlecast
    }

    [EconomyComponent]
    {
    [Cost]
    gold = 20

    [Upkeep]
    wood = 1
    mana = 1
    }

    [ElementComponent]
    {
    morale_value = 6
    required_structures = drauga_quarry
    denizen_type = denizen_type_melee

    [SupportProperty]
    property_IDS = trailblazing
    }

    [MoverComponent]
    {
    speed_max = 4.5

    [TrackInfo Template=K2TracksBipedRight]

    [TrackInfo Template=K2TracksBipedLeft]
    }

    [PerformerComponent]
    {
    cv_bias = 2
    wait_bonus = 1

    [Ability Template=K2MeleeLocal]
    {
    animation1 = melee1
    animation2 = melee2

    [AbilityDefinition Template=K2MeleeAttack]
    {

    name = "#huntmaster_AbilityDefinition_name"

    [Effect Template=MainDamageEffect]
    damage_type_IDS = melee
    amount = 20

    [WhenDo template=FXC_PlaySFX]
    audio_ids = metal_swing3
    }
    }

    [Ability template=K2SpellSummonLocal]
    ability_IDS = summon_mauler
    required_experience_min = 0
    required_experience_max = 2

    [Ability template=K2SpellSummonLocal]
    ability_IDS = summon_mauler2
    required_experience_min = 3
    required_experience_max = 3
    }

    [PropertiesComponent]
    {
    [Property]
    property_IDS = race_drauga

    [Property]
    property_IDS = support

    [Property]
    property_IDS = melee

    [Property]
    property_IDS = swift

    [Property]
    property_IDS = role_summoner
    }
    }

    3. Mod the heck out of it, save it as a .tgi file (just change the .txt to .tgi) and then place it in the Data/Units/Drauga folder. Be sure to change both

    IDS = huntmaster
    name = "#huntmaster_name"

    if you want a completely new unit, otherwise you will just override the existing unit (and if you mess up, the game will let you know by crashing ). So if I wanted to make a unit called Huntmistress...

    IDS = huntmistress
    name = "Huntmistress"

    Some other directories in the /Data folder:

    Factions
    Nations
    Spells
    Units/Drauga (and the other races)
    Units/Ceyah (and the other factions)
    Units/Ambient
    Units/Monster
    Units/Tech
    Heroes/Ceyah (and the other factions)

    KoW will look in those folders and add what is in there, overriding anything that duplicates what is in the .rwd.
    If you make a new unit, also make sure to use a different file name. Above example would be huntmistress.tgi
    Note: If you and the people you want to play with do not have the same modded files then you will get checksum errors and be unable to play together.
    For those interested in skinning, those files are in .dds format (Microsoft DirectDraw Surface).
    The Nvidia site has plug-ins for use with various programs such as 3D Studio, Photoshop and Paint Shop Pro :

    https://developer.nvidia.com/gameworks
    User avatar
    Chimaeros
    Site Admin
    Site Admin
     
    Posts: 470
    Joined: Wed Apr 16, 2014 8:18 am
    Location: United States


Return to Editing






Information
  • Who is online
  • Registered users: No registered users
cron