PDA

View Full Version : [HOW TO] Create new wargear for the SP campaign



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.

captfinlay
26th Mar 09, 9:36 AM
Fantastic tutorial, however your links are dead.

Gorb
26th Mar 09, 10:17 AM
Edited my links, they now work. Thanks for that :)

Mordecai
26th Mar 09, 1:52 PM
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.

So instead of needing to put "Blade of Ulysses" or what ever we call our item in to a ucs file we could put:



| | name: "Blade of Ulysses";


Am I reading that correct?

Gorb
26th Mar 09, 2:18 PM
Yeah, that's correct. Strings have to be enclosed in a pair of quotation marks for them to be read by the game engine, it seems.

Shaggydog
26th Mar 09, 5:49 PM
i found a funny and annoying bug a while ago when editing the wargear files in that if you just remove the terminator_armour tag but leave the requirement entry there with the tag as ""; some wargear that is "untagged" will not work with that equipment. i have no idea how long it took me staring at the files for it to even register. so just for anyone else out there that is as retarded as me :P

liniv
27th Mar 09, 3:39 PM
if i want to change the in game name on the power armour isadors folly witch line do i need to change

{
| wargear: {
| | animation_template: "";
| | apply_grant_action_to_all_squads: true;
| | apply_grant_action_to_all_teammates: false;
| | basic_statistics_strings: {
| | | statistic: 9087900;
| | };
| | bonus_statistics_strings: {
| | | statistic: 9109971;
| | };
| | can_destroy: true;
| | defence: 650;
| | description_strings: {
| | | description: 9105489;
| | };
| | dropped_by: {
| | | dropped_by: "boss";
| | | dropped_by: "mission_reward";
| | };
| | exclusive: false;
| | force_stance: "dont_care";
| | fx_actions: {
| | };
| | ignore_level_requirement_when_dropping: false;
| | leader_equip_type: "leader_only";
| | level: 1;
| | name: 9057566;
| | negative_statistics_strings: {
| | };
| | on_equip_buffs: {
| | | courage_damage_resist: {
| | | | $REF: "buffs\equip\courage_damage_resist";
| | | | amount: 100f;
| | | | range: 0f;
| | | };
| | | knockback_chance: {
| | | | $REF: "buffs\equip\knockback_chance";
| | | | chance: 0f;
| | | };
| | | max_health: {
| | | | $REF: "buffs\equip\max_health";
| | | | amount: 10000f;
| | | | prefer_squads: false;
| | | | range: 0f;
| | | };
| | };
| | on_equip_entity_actions: {
| | };
| | on_equip_squad_actions: {
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 1;
| | | | attrib_points_category: "health";
| | | };
| | };
| | on_grant_entity_actions: {
| | };
| | on_grant_player_actions: {
| | };
| | on_remove_entity_actions: {
| | };
| | on_remove_squad_actions: {
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: -1;
| | | | attrib_points_category: "health";
| | | };
| | };
| | 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\armour\power_armour_commander\power_armour_commander";
| | | render_model: "art\race_marine\troops_wargear\armour_items\for_isadors_folly\for_isadors_folly";
| | };
| | requirements: {
| | | required_leveling: {
| | | | $REF: "requirements\required_leveling";
| | | | attrib_points_category: "";
| | | | attrib_points_threshold: 0;
| | | | consider_only_discretionary_points: false;
| | | | level_threshold: 20;
| | | | reason: "usage";
| | | };
| | | required_squad_type: {
| | | | $REF: "requirements\required_squad_type";
| | | | reason: "usage";
| | | | type_list: {
| | | | | squad_type: "force_commander";
| | | | };
| | | };
| | };
| | slot: 1;
| | 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: {
| | | | };
| | | };
| | };
| | squad_wargear_count: 1;
| | team_colour_override: {
| | | $REF: "team_colour_override";
| | | extra: {
| | | | $REF: "";
| | | };
| | | primary: {
| | | | $REF: "";
| | | };
| | | secondary: {
| | | | $REF: "";
| | | };
| | | tint: {
| | | | $REF: "";
| | | };
| | };
| | terminator_armor: false;
| | type: "armour";
| | type_consumable: "none";
| | ui: {
| | | decorator_name: "";
| | | icon_name: "sm_arm_power_armour_commander_epic";
| | };
| | unique: true;
| | wargear_tag: "power_armour";
| | weapons: {
| | };
| };
};


pleas help!!

Shaggydog
27th Mar 09, 4:38 PM
| | ignore_level_requirement_when_dropping: false;
| | leader_equip_type: "leader_only";
| | level: 1;
| | name: 9057566;
| | negative_statistics_strings: {
| | };


you need to edit the name section here. just create a ew entry in DOW2.ucs at the end of the file, just type in the next number and the new name. Viola. new wargear name. you can do the same thing with descriptions if you want to create a new one of those too :D

xamon
30th Mar 09, 12:37 PM
okay hopefully no one has answered this elsewhere but, how do you change weapon damage? I mean armour defense etc is easy, its all right there but I cannot seem to find the damage rate anywhere....

liniv
30th Mar 09, 1:36 PM
xamon it is in damage_hp

i want to change all space marines to wear the isadors folly how do i do this
pleas help!!

Gorb
30th Mar 09, 2:51 PM
Weapon damage is controlled in the weapon file, not the wargear file xamon.

liniv, if you're looking to give all Space Marine units Isador's Folly, in the Single Player, then you to edit the wargear (Isador's Folly) so that it's useable by all squads, not just the Force Commander.

EDIT: Any chance this could be moved to Tutorials?

liniv
31st Mar 09, 4:50 AM
i have dun that but i gets equipt on the leader only and i faund this

| | leader_equip_type: "leader_only";

what do i need to change it to if i want it on the whole sqoud

Gorb
31st Mar 09, 5:27 AM
| | leader_equip_type: "no_leader";Should do it.

liniv
31st Mar 09, 7:16 AM
if i want it on the leader too

Gorb
31st Mar 09, 8:06 AM
I'd suggest making your own thread detailing what you want to do, and how much of your code it working at this moment in time. Your request wasn't that relevant to this thread in the first place, and making a new thread will get you more attention :)

xamon
31st Mar 09, 12:14 PM
Thanks for the assist. Gots it all going now... complex figuring the actual damage out mind you, seems its based off damage and reload, burst, etc.... still bigger number = more damage.

kanaka71
4th Apr 09, 4:39 AM
quick problem; here is what was done -

1) extracted with SGAextractor

2) converted to txt with RBFconverter

3) changed important fields as above - -- Made by Corsix's Crude RBF Convertor
{
| wargear: {
| | animation_template: "";
| | apply_grant_action_to_all_squads: true;
| | apply_grant_action_to_all_teammates: false;
| | basic_statistics_strings: {
| | | statistic: 9087886;
| | };
| | bonus_statistics_strings: {
| | | statistic: 9098336;
| | };
| | can_destroy: true;
| | defence: 80;
| | description_strings: {
| | | description: "Given as a gift of strength and protection";
| | };
| | dropped_by: {
| | | dropped_by: "boss";
| | | dropped_by: "chaff";
| | | dropped_by: "mission_reward";
| | };
| | exclusive: false;
| | force_stance: "dont_care";
| | fx_actions: {
| | };
| | ignore_level_requirement_when_dropping: false;
| | leader_equip_type: "leader_only";
| | level: 2;
| | name: "Barding of Opukahaia";
| | negative_statistics_strings: {
| | };
| | on_equip_buffs: {
| | | courage_damage_resist: {
| | | | $REF: "buffs\equip\courage_damage_resist";
| | | | amount: 75f;
| | | | range: 0f;
| | | };
| | | max_health: {
| | | | $REF: "buffs\equip\max_health";
| | | | amount: 99f;
| | | | prefer_squads: false;
| | | | range: 0f;
| | | };
| | };
| | on_equip_entity_actions: {
| | };
| | on_equip_squad_actions: {
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: 2;
| | | | attrib_points_category: "health";
| | | };
| | | health_regen: {
| | | | $REF: "buffs\equip\health_regen";
| | | | amount: 5.5f;
| | | | exclude_self: false;
| | | | range: 0f;
| | | };
| | };
| | on_grant_entity_actions: {
| | };
| | on_grant_player_actions: {
| | };
| | on_remove_entity_actions: {
| | };
| | on_remove_squad_actions: {
| | | grant_bonus_attribute_points_action: {
| | | | $REF: "actions\ability\grant_bonus_attribute_points_action";
| | | | add_attribute_points: -2;
| | | | attrib_points_category: "health";
| | | };
| | };
| | 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: "rare";
| | race: "racebps\space_marines";
| | render_models: {
| | | render_model: "art\race_marine\troops_wargear\armour\power_armour_epic\power_armour_epic";
| | | render_model: "art\race_marine\troops_wargear\armour_items\pow_barding_of_ultramar\pow_barding_of_ultramar";
| | };
| | requirements: {
| | | required_leveling: {
| | | | $REF: "requirements\required_leveling";
| | | | attrib_points_category: "";
| | | | attrib_points_threshold: 0;
| | | | consider_only_discretionary_points: false;
| | | | level_threshold: 2;
| | | | reason: "usage";
| | | };
| | | required_squad_type: {
| | | | $REF: "requirements\required_squad_type";
| | | | reason: "usage";
| | | | type_list: {
| | | | | squad_type: "tactical_marine";
| | | | | squad_type: "assault_marine";
| | | | | squad_type: "force_commander";
| | | | | squad_type: "devastator_marine";
| | | | };
| | | };
| | };
| | slot: 1;
| | 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: {
| | | | };
| | | };
| | };
| | squad_wargear_count: 1;
| | team_colour_override: {
| | | $REF: "team_colour_override";
| | | extra: {
| | | | $REF: "";
| | | };
| | | primary: {
| | | | $REF: "";
| | | };
| | | secondary: {
| | | | $REF: "";
| | | };
| | | tint: {
| | | | $REF: "";
| | | };
| | };
| | terminator_armor: false;
| | type: "armour";
| | type_consumable: "none";
| | ui: {
| | | decorator_name: "";
| | | icon_name: "sm_arm_power_armour_e2_rare";
| | };
| | unique: true;
| | wargear_tag: "power_armour";
| | weapons: {
| | };
| };
};


4) reconvert with RBFconverter -

5) changed name of file to name of item "sm_aaa_bolt_pistol_xxxxx"

6) placed in <my_mod>\data\attrib\simulation\attrib\wargear\wargear\campaign\playable\race_marine

7) loaded game

8) tried code as listed - World_DropWargearAtPosition(Game_GetLocalPlayer(), "wargear\\wargear\\campaign\\playable\\race_marine\\sm_aaa_bolt_pistol_xxxxx",Misc_GetCameraPos())

9) got reply in console as "xxxxx not found Ln 1 ((null))"

ideas? thoughts? concerns? corrections???

kanaka71
4th Apr 09, 10:47 PM
can anyone tell me what I am doing wrong? any one have any ideas? I have multiple items that are placed in the right folder (per other threads and posts) but I still cant get my items in-game

xamon
5th Apr 09, 5:15 AM
Did you make both a wargear file and a weapon file for them? Did you set them to be dropped by anything?
And just to re-itterate path is:
your_mod_folder/DATA/simulation/attrib/etc...
I have made a few things that work including a non terminator storm bolter :)

kanaka71
5th Apr 09, 8:09 PM
thanks - ill try making a new weapon file as well and reset my base folders - that may be the problem

kanaka71
9th Apr 09, 7:00 AM
modding the base folders worked. I still have a problem with some of the weapon files - causing a crash of the game and the splatterbug to come up. I have isolated it to two files, redoing a set of thunderhammer and shield, and a termie ass cannon. Interesting thing is the rest work just fine....

thingy123
19th Dec 09, 4:52 AM
Damn.. I'm confused, after I was using Doddy's Wargear Creator, creating a new power armor, then modified the tuning_info.rbf, in the mod studio. I then packed the mod, then I tried to load the game with -modname "Type1", the game then crashes instantly, the moment i click "Launch". I don't know why.. What'd I do wrong?