Gorb
26th Mar 09, 7:28 AM
After being asked by a couple of people about wargear, I've decided to put it in a tutorial to help everyone who doesn't understand how it works yet.
All Campaign wargear goes in the following folder within your Dawn of War 2 directory:
"your_mod\Data\simulation\attrib\wargear\wargear\ca mpaign\playable\race_marine"
Where "your_mod" is the name of your mod in your module file, and the name of your mod folder. If you have trouble setting up your mod in the first place, this thread (http://forums.relicnews.com/showthread.php?t=216142) covers the basics and this thread (http://forums.relicnews.com/showthread.php?t=218301) stops you setting up your mod incorrectly.
Here is an example piece of wargear; a weapon. I'll walk you through all the bits of the file I can understand. This is an existing wargear piece (Blade of Ulyus, if I recall correctly), modified by myself after converting it to .txt format with Corsix's RBF converter:
-- Made by Corsix's Crude RBF Convertor
{
| wargear:
{
| | animation_template: "melee_blade";
| | apply_grant_action_to_all_squads: true;
| | apply_grant_action_to_all_teammates: false;
| | basic_statistics_strings: {
| | | statistic: 9110782;
| | };
| | bonus_statistics_strings: {
| | | statistic: 9110783;
| | };
| | can_destroy: true;
| | defence: 0;
| | description_strings: {
| | | description: 9110911;
| | };
| | dropped_by: {
| | };
| | exclusive: false;
| | force_stance: "melee";
| | fx_actions: {
| | | fx_action: "prefix\electricity";
| | };
| | ignore_level_requirement_when_dropping: false;
| | leader_equip_type: "leader_only";
| | level: 1;
| | name: 9110781;
| | negative_statistics_strings: {
| | };
| | on_equip_buffs: {
| | | damage_ranged: {
| | | | $REF: "buffs\equip\damage_ranged";
| | | | amount: 0.00f;
| | | | range: 0f;
| | | };
| | | damage_resist: {
| | | | $REF: "buffs\equip\damage_resist";
| | | | amount: 0.50f;
| | | | damage_type: "weapons\weapon_damage\explosive";
| | | | range: 0f;
| | | };
| | | energy_regen: {
| | | | $REF: "buffs\equip\energy_regen";
| | | | amount: 10f;
| | | | range: 0f;
| | | };
| | | max_energy: {
| | | | $REF: "buffs\equip\max_energy";
| | | | amount: 100f;
| | | | range: 0f;
| | | };
| | | damage_resist: {
| | | | $REF: "buffs\equip\damage_resist";
| | | | amount: 0.50f;
| | | | damage_type: "weapons\weapon_damage\melee";
| | | | range: 0f;
| | | };
| | | knockback_chance: {
| | | | $REF: "buffs\equip\knockback_chance";
| | | | chance: 0.2f;
| | | };
| | };
| | on_equip_entity_actions: {
| | };
| | on_equip_squad_actions: {
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "energy";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "melee";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "ranged";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "health";
| | | };
| | };
| | on_grant_entity_actions: {
| | };
| | on_grant_player_actions: {
| | };
| | on_remove_entity_actions: {
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "energy";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "melee";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "ranged";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "health";
| | | };
| | };
| | on_remove_squad_actions: {
| | };
| | on_take_hit_melee: {
| | };
| | on_take_hit_melee_buffs: {
| | };
| | on_take_hit_range: {
| | };
| | on_take_hit_range_buffs: {
| | };
| | online_level_render_models: {
| | };
| | override_drop_entity_model: "";
| | owner_modifiers: {
| | };
| | quality: "epic";
| | race: "racebps\space_marines";
| | render_models: {
| | | render_model: "art\race_marine\troops_wargear\weapons_melee\chainsword_rare_blade_of_ulyus\chainsword_rare_blade_of_ulyus";
| | };
| | requirements: {
| | | required_binary_expr: {
| | | | $REF: "requirements\required_binary_expr";
| | | | operation: "and";
| | | | reason: "usage";
| | | | requirements_lhs: {
| | | | | required_squad_type: {
| | | | | | $REF: "requirements\required_squad_type";
| | | | | | reason: "usage";
| | | | | | type_list: {
| | | | | | | squad_type: "assault_marine";
| | | | | | | squad_type: "force_commander";
| | | | | | | squad_type: "tactical_marine";
| | | | | | };
| | | | | };
| | | | };
| | | | requirements_rhs: {
| | | | };
| | | };
| | | required_leveling: {
| | | | $REF: "requirements\required_leveling";
| | | | attrib_points_category: "";
| | | | attrib_points_threshold: 0;
| | | | consider_only_discretionary_points: false;
| | | | level_threshold: 1;
| | | | reason: "usage";
| | | };
| | | required_unary_expr: {
| | | | $REF: "requirements\required_unary_expr";
| | | | operation: "not";
| | | | reason: "usage";
| | | | requirements: {
| | | | | required_wargear_tag: {
| | | | | | $REF: "requirements\required_wargear_tag";
| | | | | | wargear_tag: "terminator_armour";
| | | | | };
| | | | };
| | | };
| | };
| | slot: 2;
| | slot_item_on_equip_squad_actions: {
| | };
| | slot_item_on_remove_squad_actions: {
| | };
| | speech: {
| | | $REF: "speech\speech";
| | | speech_code_3: {
| | | | $REF: "types\speech\speech_codes";
| | | | codes: {
| | | | | code: "csw";
| | | | | code: "swo";
| | | | | code: "mel";
| | | | };
| | | };
| | };
| | squad_wargear_count: 1;
| | team_colour_override: {
| | | $REF: "team_colour_override";
| | | extra: {
| | | | $REF: "";
| | | };
| | | primary: {
| | | | $REF: "";
| | | };
| | | secondary: {
| | | | $REF: "";
| | | };
| | | tint: {
| | | | $REF: "";
| | | };
| | };
| | terminator_armor: false;
| | type: "weapon";
| | type_consumable: "none";
| | ui: {
| | | decorator_name: "";
| | | icon_name: "sm_wp2_chainsword_rare";
| | };
| | unique: true;
| | wargear_tag: "untagged";
| | weapons: {
| | | weapon: "weapons\weapon\campaign\playable\race_marine\sm_lol_test_sword";
| | };
| };
};
This is a weapon, and thus it's a more complex piece of wargear than all the other accessories/pieces of armour, because it references a weapon file ("weapons\weapon\campaign\playable\race_marine\sm_lol_test_sword"). You can make any old weapon file from the existing ones, it isn't that hard. The fun part is what you can do in this wargear file. Firstly, the important points.
| | level: 1;
| | name: 9110781;That is the level of the weapon (shown when you hover over it and read it's description) and the name. The name is a UCS value, that can be changed by adding a string value instead of that numeric value. The string will have to be in quotation marks though, make sure you do that.
| | | required_leveling: {
| | | | $REF: "requirements\required_leveling";
| | | | attrib_points_category: "";
| | | | attrib_points_threshold: 0;
| | | | consider_only_discretionary_points: false;
| | | | level_threshold: 1;
| | | | reason: "usage";This bit of code outlines what your character/squad needs to have in order to wield the weapon. It should be pretty self-explanatory. "level_threshold" is the level your squad needs to be, and the "attrib_points_category/threshhold" fields are the type of Trait point ("melee", "health", "ranged" and "energy") and the amount required to use this piece of wargear respectively. What squads can use this piece of wargear are outlined in the following section of code, you can add to this pretty easily:
| | | | requirements_lhs: {
| | | | | required_squad_type: {
| | | | | | $REF: "requirements\required_squad_type";
| | | | | | reason: "usage";
| | | | | | type_list: {
| | | | | | | squad_type: "assault_marine";
| | | | | | | squad_type: "force_commander";
| | | | | | | squad_type: "tactical_marine";
| | | | | | };
| | | | | };
| | | | };Another neat piece of code is the other half of the requirement code:
| | | required_unary_expr: {
| | | | $REF: "requirements\required_unary_expr";
| | | | operation: "not";
| | | | reason: "usage";
| | | | requirements: {
| | | | | required_wargear_tag: {
| | | | | | $REF: "requirements\required_wargear_tag";
| | | | | | wargear_tag: "terminator_armour";These few lines tell the game you can't use this piece of wargear if you have a piece of wargear already with the wargear tab "terminator_armour". There are quite a few wargear tabs, however "untagged" and "terminator_armour" are the ones you'll like see in the code. If you remove this code entirely from this weapon, you should be able to use it as a Terminator. I haven't tested it, so doing this could result in unforeseen bugs or graphical glitches.
Everything else is just icing on the cake. You can change the icon, the weapon model (if it is a weapon), and this example wargear I have created possesses most of the on_equip buffs so you can use it as a reference.
A further note: The character "f" is just denotes that the number in question (e.g. "0.2f" or "1f") is a floating point number, nothing else.
Any further questions, just ask me. I'll be updating this thread with different types of wargear (next on the list is how Terminator armour works) when I have time.
All Campaign wargear goes in the following folder within your Dawn of War 2 directory:
"your_mod\Data\simulation\attrib\wargear\wargear\ca mpaign\playable\race_marine"
Where "your_mod" is the name of your mod in your module file, and the name of your mod folder. If you have trouble setting up your mod in the first place, this thread (http://forums.relicnews.com/showthread.php?t=216142) covers the basics and this thread (http://forums.relicnews.com/showthread.php?t=218301) stops you setting up your mod incorrectly.
Here is an example piece of wargear; a weapon. I'll walk you through all the bits of the file I can understand. This is an existing wargear piece (Blade of Ulyus, if I recall correctly), modified by myself after converting it to .txt format with Corsix's RBF converter:
-- Made by Corsix's Crude RBF Convertor
{
| wargear:
{
| | animation_template: "melee_blade";
| | apply_grant_action_to_all_squads: true;
| | apply_grant_action_to_all_teammates: false;
| | basic_statistics_strings: {
| | | statistic: 9110782;
| | };
| | bonus_statistics_strings: {
| | | statistic: 9110783;
| | };
| | can_destroy: true;
| | defence: 0;
| | description_strings: {
| | | description: 9110911;
| | };
| | dropped_by: {
| | };
| | exclusive: false;
| | force_stance: "melee";
| | fx_actions: {
| | | fx_action: "prefix\electricity";
| | };
| | ignore_level_requirement_when_dropping: false;
| | leader_equip_type: "leader_only";
| | level: 1;
| | name: 9110781;
| | negative_statistics_strings: {
| | };
| | on_equip_buffs: {
| | | damage_ranged: {
| | | | $REF: "buffs\equip\damage_ranged";
| | | | amount: 0.00f;
| | | | range: 0f;
| | | };
| | | damage_resist: {
| | | | $REF: "buffs\equip\damage_resist";
| | | | amount: 0.50f;
| | | | damage_type: "weapons\weapon_damage\explosive";
| | | | range: 0f;
| | | };
| | | energy_regen: {
| | | | $REF: "buffs\equip\energy_regen";
| | | | amount: 10f;
| | | | range: 0f;
| | | };
| | | max_energy: {
| | | | $REF: "buffs\equip\max_energy";
| | | | amount: 100f;
| | | | range: 0f;
| | | };
| | | damage_resist: {
| | | | $REF: "buffs\equip\damage_resist";
| | | | amount: 0.50f;
| | | | damage_type: "weapons\weapon_damage\melee";
| | | | range: 0f;
| | | };
| | | knockback_chance: {
| | | | $REF: "buffs\equip\knockback_chance";
| | | | chance: 0.2f;
| | | };
| | };
| | on_equip_entity_actions: {
| | };
| | on_equip_squad_actions: {
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "energy";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "melee";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "ranged";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "health";
| | | };
| | };
| | on_grant_entity_actions: {
| | };
| | on_grant_player_actions: {
| | };
| | on_remove_entity_actions: {
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "energy";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "melee";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "ranged";
| | | };
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 3;
| | | | attrib_points_category: "health";
| | | };
| | };
| | on_remove_squad_actions: {
| | };
| | on_take_hit_melee: {
| | };
| | on_take_hit_melee_buffs: {
| | };
| | on_take_hit_range: {
| | };
| | on_take_hit_range_buffs: {
| | };
| | online_level_render_models: {
| | };
| | override_drop_entity_model: "";
| | owner_modifiers: {
| | };
| | quality: "epic";
| | race: "racebps\space_marines";
| | render_models: {
| | | render_model: "art\race_marine\troops_wargear\weapons_melee\chainsword_rare_blade_of_ulyus\chainsword_rare_blade_of_ulyus";
| | };
| | requirements: {
| | | required_binary_expr: {
| | | | $REF: "requirements\required_binary_expr";
| | | | operation: "and";
| | | | reason: "usage";
| | | | requirements_lhs: {
| | | | | required_squad_type: {
| | | | | | $REF: "requirements\required_squad_type";
| | | | | | reason: "usage";
| | | | | | type_list: {
| | | | | | | squad_type: "assault_marine";
| | | | | | | squad_type: "force_commander";
| | | | | | | squad_type: "tactical_marine";
| | | | | | };
| | | | | };
| | | | };
| | | | requirements_rhs: {
| | | | };
| | | };
| | | required_leveling: {
| | | | $REF: "requirements\required_leveling";
| | | | attrib_points_category: "";
| | | | attrib_points_threshold: 0;
| | | | consider_only_discretionary_points: false;
| | | | level_threshold: 1;
| | | | reason: "usage";
| | | };
| | | required_unary_expr: {
| | | | $REF: "requirements\required_unary_expr";
| | | | operation: "not";
| | | | reason: "usage";
| | | | requirements: {
| | | | | required_wargear_tag: {
| | | | | | $REF: "requirements\required_wargear_tag";
| | | | | | wargear_tag: "terminator_armour";
| | | | | };
| | | | };
| | | };
| | };
| | slot: 2;
| | slot_item_on_equip_squad_actions: {
| | };
| | slot_item_on_remove_squad_actions: {
| | };
| | speech: {
| | | $REF: "speech\speech";
| | | speech_code_3: {
| | | | $REF: "types\speech\speech_codes";
| | | | codes: {
| | | | | code: "csw";
| | | | | code: "swo";
| | | | | code: "mel";
| | | | };
| | | };
| | };
| | squad_wargear_count: 1;
| | team_colour_override: {
| | | $REF: "team_colour_override";
| | | extra: {
| | | | $REF: "";
| | | };
| | | primary: {
| | | | $REF: "";
| | | };
| | | secondary: {
| | | | $REF: "";
| | | };
| | | tint: {
| | | | $REF: "";
| | | };
| | };
| | terminator_armor: false;
| | type: "weapon";
| | type_consumable: "none";
| | ui: {
| | | decorator_name: "";
| | | icon_name: "sm_wp2_chainsword_rare";
| | };
| | unique: true;
| | wargear_tag: "untagged";
| | weapons: {
| | | weapon: "weapons\weapon\campaign\playable\race_marine\sm_lol_test_sword";
| | };
| };
};
This is a weapon, and thus it's a more complex piece of wargear than all the other accessories/pieces of armour, because it references a weapon file ("weapons\weapon\campaign\playable\race_marine\sm_lol_test_sword"). You can make any old weapon file from the existing ones, it isn't that hard. The fun part is what you can do in this wargear file. Firstly, the important points.
| | level: 1;
| | name: 9110781;That is the level of the weapon (shown when you hover over it and read it's description) and the name. The name is a UCS value, that can be changed by adding a string value instead of that numeric value. The string will have to be in quotation marks though, make sure you do that.
| | | required_leveling: {
| | | | $REF: "requirements\required_leveling";
| | | | attrib_points_category: "";
| | | | attrib_points_threshold: 0;
| | | | consider_only_discretionary_points: false;
| | | | level_threshold: 1;
| | | | reason: "usage";This bit of code outlines what your character/squad needs to have in order to wield the weapon. It should be pretty self-explanatory. "level_threshold" is the level your squad needs to be, and the "attrib_points_category/threshhold" fields are the type of Trait point ("melee", "health", "ranged" and "energy") and the amount required to use this piece of wargear respectively. What squads can use this piece of wargear are outlined in the following section of code, you can add to this pretty easily:
| | | | requirements_lhs: {
| | | | | required_squad_type: {
| | | | | | $REF: "requirements\required_squad_type";
| | | | | | reason: "usage";
| | | | | | type_list: {
| | | | | | | squad_type: "assault_marine";
| | | | | | | squad_type: "force_commander";
| | | | | | | squad_type: "tactical_marine";
| | | | | | };
| | | | | };
| | | | };Another neat piece of code is the other half of the requirement code:
| | | required_unary_expr: {
| | | | $REF: "requirements\required_unary_expr";
| | | | operation: "not";
| | | | reason: "usage";
| | | | requirements: {
| | | | | required_wargear_tag: {
| | | | | | $REF: "requirements\required_wargear_tag";
| | | | | | wargear_tag: "terminator_armour";These few lines tell the game you can't use this piece of wargear if you have a piece of wargear already with the wargear tab "terminator_armour". There are quite a few wargear tabs, however "untagged" and "terminator_armour" are the ones you'll like see in the code. If you remove this code entirely from this weapon, you should be able to use it as a Terminator. I haven't tested it, so doing this could result in unforeseen bugs or graphical glitches.
Everything else is just icing on the cake. You can change the icon, the weapon model (if it is a weapon), and this example wargear I have created possesses most of the on_equip buffs so you can use it as a reference.
A further note: The character "f" is just denotes that the number in question (e.g. "0.2f" or "1f") is a floating point number, nothing else.
Any further questions, just ask me. I'll be updating this thread with different types of wargear (next on the list is how Terminator armour works) when I have time.