Unit ID #?

正在查看此主题的用户

Since some people have requested this, I decided to start a new topic to explain how to do it.

What it does
In Warband it is possible to create your own Kingdom. You may want to create custom troops and being able to recruit them from the villages that are part of your Kingdom. This has been tested on version 1.113.
To maintain a common behaviour with the villages of other factions, this tweaks will give you recruits based on the faction that owns the village in that moment (even this feature has been asked by many members in this forum) and not based on the original culture of the village.


The fast method
If you added your custom recruit manually in the module system or with a txt editor, chances are that it has been added at the end the other troops already present in Native. If that is the case, then it is sufficient to do the following.

Open scripts.txt, look for "update_volunteer_troops_in_village" and substitute the next line with this one:

43 23 2 1224979098644774912 1 521 3 1224979098644774913 1224979098644774912 26 521 3 1224979098644774914 1224979098644774912 19 522 3 1224979098644774915 1224979098644774914 41 2204 2 1224979098644774916 1224979098644774912 4 0 33 3 1224979098644774916 432345564227567631 432345564227567637 522 3 1224979098644774915 1224979098644774916 41 5 0 31 2 1224979098644774916 432345564227567630 2133 2 1224979098644774915 360287970189640610 3 0 2133 2 1224979098644774917 1 2123 3 1224979098644774918 1224979098644774913 10 6 3 1224979098644774919 0 1224979098644774918 2136 3 1224979098644774920 0 100 2147483678 2 1224979098644774920 10 2136 3 1224979098644774920 0 2 1561 3 1224979098644774921 1224979098644774915 1224979098644774920 4 0 2147483680 2 1224979098644774921 0 1561 3 1224979098644774921 1224979098644774915 0 3 0 32 2 1224979098644774921 0 2105 2 1224979098644774917 1 2133 2 1224979098644774915 1224979098644774921 3 0 2133 2 1224979098644774922 7 4 0 30 2 1224979098644774913 5 2133 2 1224979098644774922 1224979098644774913 2108 2 1224979098644774922 2 2105 2 1224979098644774922 10 5 0 2147483678 2 1224979098644774913 0 2133 2 1224979098644774922 0 3 0 2107 2 1224979098644774922 3 2120 3 1224979098644774923 2 1224979098644774917 2108 2 1224979098644774922 1224979098644774923 2136 3 1224979098644774924 0 1224979098644774922 501 3 1224979098644774912 92 1224979098644774915 501 3 1224979098644774912 93 1224979098644774924

Let 72 hours pass and you can enjoy your troops in your villages.
Remember, this only works if your unit is added at the bottom of all other units.


Further details
360287970189640610 is the ID of the unit: it is one more of the last unit in native. Every unit is assigned a unique ID by the game, which is sequential, starting from the first one. The last unit present in Native has ID 360287970189640609. If you added two troops and you want to recruit the second one, use this ID: 360287970189640611. I hope it makes sense.

I am trying to follow the above guide but the mod i am playing (Brytenwalda) I can not find the ID # for trp_dplmc_recruiter which is the last soldier in that troop.txt file.
so i tried to add the difference between the native troop.txt (930) and Brytenwalda (1444+7for my custom troops=1451) so 1451-930=521 I added this number to 360287970189640609 and got 360287970189641130 but when i changed it nothing happens so this cant be the correct unit id. I am editing this with notepad because i do not know how to use the module system. can anyone help me?

 
I downloaded python and the modular system open the troops file and could not find  360287970189640610 which is the ID of the last unit in native.
 
You can use the first troop as reference. "360287970189639680" is the first troop in troops.txt which is always "trp_player" with ID = 0 in the game. For any mod, use the original troops.txt of that mod to get the total number of troops defined for that mod. It is the number on the second line of the text file.
troopsfile version 2
930
The above is number of troops in Native (v1.127). The game engine count the IDs from "0", so the actual ID is from 0 to 929.

360287970189639680 + 0 = 360287970189639680 is the first troop.

360287970189639680 + 929 = 360287970189640609 is the last Native troop.

360287970189639680 + 930 = 360287970189640610 is the last Native troop + 1

So, if the mod you are playing has 1012 troops total (original prior to adding your new troops), then:

360287970189639680 + 1012 = 360287970189640692 is the last troop + 1
 
后退
顶部 底部