Tutorial: How to Create a Special Unit WC4
Jul 15, 2018 23:37:32 GMT
Mountbatten, Mao Ze Dong, and 9 more like this
Post by Mao Ze Dong on Jul 15, 2018 23:37:32 GMT
This is the first guide I've made on this forum, so I hope people may find this useful in mod creation. This is about how to add a special unit to a specific army arsenal, such as Red Guards or Volksturm. This will also replace the vanilla unit. For this tutorial, I will create the Last Stand Troop for the Japanese, replacing regular light infantry.
Step 1:
Edit ArmySettings.json.
First, copy the code from a unit that you desire and paste it.
Then, Change the id to something that hasn't been used.
Next, change the name into something that hasn't been used.
Next, edit the values of this troop. The army is the type of unit, so 1 is light infantry, 2 is assault, 3 is motorized... etc. you can find the number values in the stringtable. The type is the classification of the troop. 1 would be infantry, 2 would be vehicles, 3 would be artillery... etc. The feature is the special skill granted to the unit. For example, 7 would be militia, (Supply +50% in city). In the back, the country is the option where you can have a specific country have the unit. 10 would be Japan in my example. If you leave it blank, it will be universal. The rest should be easy.
Step 2:
Edit Stringtable.
Open it up and go to the part where the units. Duplicate the corresponding unit you want to add. Change the id to what you put in ArmySettings. Name it whatever you want.
Step 3:
Edit def_motion.
Copy a texture you want from an exiting texture or add your texture by editing the pictures and recreating that code. Some other files may be involved for the animation. I will only show the method where I copy the sequence for the KMT Chinese Commando. Paste the code somewhere, and be sure to have the stanza correct. Next, rename the unit name to whatever you renamed it in ArmySettings. Strike should be copied from an existing strike of a similar unit.
Step 4:
Compile.
Compile the apk to view your results. If you crash, you did something wrong. Try to follow my instructions better next time.
Here is my result:
Step 1:
Edit ArmySettings.json.
First, copy the code from a unit that you desire and paste it.
Then, Change the id to something that hasn't been used.
Next, change the name into something that hasn't been used.
Next, edit the values of this troop. The army is the type of unit, so 1 is light infantry, 2 is assault, 3 is motorized... etc. you can find the number values in the stringtable. The type is the classification of the troop. 1 would be infantry, 2 would be vehicles, 3 would be artillery... etc. The feature is the special skill granted to the unit. For example, 7 would be militia, (Supply +50% in city). In the back, the country is the option where you can have a specific country have the unit. 10 would be Japan in my example. If you leave it blank, it will be universal. The rest should be easy.
Step 2:
Edit Stringtable.
Open it up and go to the part where the units. Duplicate the corresponding unit you want to add. Change the id to what you put in ArmySettings. Name it whatever you want.
Step 3:
Edit def_motion.
Copy a texture you want from an exiting texture or add your texture by editing the pictures and recreating that code. Some other files may be involved for the animation. I will only show the method where I copy the sequence for the KMT Chinese Commando. Paste the code somewhere, and be sure to have the stanza correct. Next, rename the unit name to whatever you renamed it in ArmySettings. Strike should be copied from an existing strike of a similar unit.
Step 4:
Compile.
Compile the apk to view your results. If you crash, you did something wrong. Try to follow my instructions better next time.
Here is my result: