Alright, time I come forward with my stupid coding problems...
Anyways, what I am looking to do is make the mercenary troops recruitable from my villages (starting with watchmen). I have tried many of the changes both here and elsewhere on the forum, and I still can't get it to work properly. I'm thinking I might be overcomplicating it, so my question is just that - am I? IS there a simpler way to set the merc tech tree as my factions recruitable units?
i got it all in and hit the options held a village for 2 weeks its nord, tried switching to swadian.. do i have to wait longer? i'm still only able to recruit nords
how do you find out what the unique id is for a troop, in my editor its number 933 if that helps?
also what code do I paste in if I DON'T want to use my custom troop but I DO want all factions to recruit their faction troop in all villages they own.
if anyone has any idea of what i may of done wrong please let me know.. i edited the .py, and posted the menu options and actual menu in the right place so it appears in game. also i cut out the stuff in red.. my faction is still not changing.
if anyone has any idea of what i may of done wrong please let me know.. i edited the .py, and posted the menu options and actual menu in the right place so it appears in game. also i cut out the stuff in red.. my faction is still not changing.
I didn't touch the py. I just realized, found out myself, the game doesnt even look at py files they just make the text files the game reads and since the text files are hard to read unless you know what your looking for alot of ppl prefer py. Point is I just edited my text files and it worked beautifully.
1. Create a new troop in troops.txt or editor. (here is my faction recruit)
In native there are about 929 troops.
The unique ID for the last troop is 360287970189640609 so if you add yours to the end its troop 930 or 360287970189640610 the next would be 36xxx11 then 36xxx12 and so on.
MAKE SURE THEY ARE "player_supporters_faction" and "not player_faction"
2. Navigate to scripts.txt in your module folder whether its native or anther mod.
Inside scripts.txt look for (ctrl+f) "update_volunteer_troops_in_village"
Paste the following code OVER the existing code making sure that the blue number below is the unique ID for your faction recruit troop that will come out of your villages.
NEXT under update_npc_volunteer_troops_in_village
Paste the following, making sure to substitute the blue code with your unquie ID if its not troop 930 as above
4. Save all the edits you made load your saved game. Wait or play for 72 in game hours or there abouts. Then try to do two of the following things.
- Recruit a troop from a village owned by a faction that took it over in war.
- If you can recruit that factions troops instead of the original culture troop you know its working.
- If you have your own kingdom try recruiting from any village you have and you should be able to recruit your custom faction troop just like any other.
I have done exactly what I wrote above and I can recruit any faction troop including my own in any village they or I own regardless of culture. Hope this helps.
EDIT: There is a way to get your lords to recruit your troops too through party_templates but I'm working on it. My skill limits me since this is all new to me.
Attempt at having your lords recruit your troops
So inside party templates I added this to the bottom
In there you see Kingdom_1 etc those are what the npc factions are called. The player faction is called "player_supporters_faction"
So I substituted the kingdom_1 with player_supports_faction.
Next the numbers 934 2 6 0 933 4 7 0 -1 -1 -1 -1 (934 = troop number, 2 = min to recruit, 6 = max to recruit, 933 = next troop to recruit 4 is min 7 is max.
Basically its saying in one recruitment period for the NPC recruit anywhere between 2 to 6 Trained recruits (my custom troop) and 4 to 7 fresh recruits.
this goes on for three lines and you can then tell it to recruit more advanced troops etc. This when looking at it explains to me why the damn NPC always has so many archers lol.
Always add a 0 at the end like the code above and the -1 are place holders. so say in line one you only add one troop to be recruited you would add an extra -1 as a place holder. It would look like this.
Well who knows if this will work but at least it was informative =)
YOU CAN however edit the kingdom ones to change the way the npc recruits in your game. I actually gave them more foot troops to compensate with archers and more high end troops like Knights because this game is so damn easy even on the hardest setting.
EDIT: FYI I made my own Custom faction troops called Imperial Levy with a whole tree. I can already recruit these from any town I own and it works fine. I can also recruit any other factions troop from any village they own as well so its already working. I'm unsure what your code does and I already have a menu to choose my culture type but my "PLAYER FACTION of Imperial" is not a choice" I'am unaware of what choosing what your culture actually does in game. I have made mine Vaiger but my ai lords still recruit their culture troops and I have not made a companion lord yet. SO IN your code for update_volunteer I don't see where it calls on my custom troops as I have in my code posted above see unique ID 360287970189640613 this is my custom troop being called into my code. It can only be recruited when I'am king and when I own territory.
Cool I'll play around with it. One question though because I have been using diplomacy before I even became king in native so I don't know what feature it is but.
I can choose what culture I want my kingdom to be from my chancellor in my home town or castle I own. Is this native? and does this mean my companions if made lord recruit this?
Also AI lords don't actually recruit from towns do they? I figured it was automatically added since they always recruit thier culture troops no matter what faction they belong to no matter what town they go to, to recruit.
Also on your code for menus this will make my culture my own faction? Will this change the guards in my city scenes and castle scenes to my own troops? this will make all my lords recruit my troops?
Last question for some reason all my troops have the same str of 7 and agility of 4 int of 4 and cha of 4 I changed it in the txt file and I can see it in the text file but it will not update in game no matter how long I wait any idea?
2nd EDIT: I like your menu code but how can I add anther option to recruit my custom faction troops? It appears they have unique ids pointing to their troop numbers so maybe if I add anther option and replace those numbers with mine it should work hmm? Maybe you have to create your own player faction in faction.txt? I would like to make a custom player faction and culture so all my lords recruit my custom troops and they appear in my city castle scenes.
3rd Edit: If Im reading it right it looks like you swadian code is pulling in arena fighters and your vaegir code pulling in mercenaries and your Khergit code pulling in swadians. Like its all shifted up wrong.
If I created my own faction troops, and forced lords to recruit their own faction troops, would they by default recruit mine if they were my vassals or is there more required for that.
one thing I see though is its asking for pt_kingdom at the bottom thats a party_template telling the npc how many of each troops to recruit. So now I guess I have to make one for these guys.
as you can see my diplomacy mod interjects I hope I don't get red lines for commenting it out. This feature let you choose what faction culture you wanted. I'm just changing it to the one you used then overriding what they recruit.
Hey I've been using Diplomacy mod and he already has a menu to change your culture and your npc lords will recruit that faction. I'm going to try to edit his code to add anther faction (my custom one) so the lords then recruit my troops.
EDIT: moving my question http://forums.taleworlds.com/index.php/topic,117487.msg2833603.html#msg2833603
So what I did was cut out everything in green which then forces the AI lords to recruit only what faction they belong too. Well this works great until you create your own kingdom correct? Thats because the player faction has no set troops (so creating troops for the player faction would do this.
This is the menu code I added to select the player faction troops
Hey I found a script somewhere(sorry i can't give credits)
But it essentially makes it so when you take ove a villiage you recruit your faction base unit there....
I'm still new to the mod system but taake a look at it. So even if I created custom factions, taking over villiages would result in recruiting that faction's unit, right?
Like a lot of people, I've been following this thread with great interest.
But, all the discussion has muddled my brain, I don't feel confident that I know which bits of code to put where. I'm going to suggest something that many people would balk at.
Because there are so many people who would love to have this, each with their own different game files, perhaps one of you who does understand this could take a native 1.125 scripts.py and scripts.txt (If you can make the python one then making both should be easy) with the finished working code changes and post them for download? I know what a douche I look like for asking such a thing, but I just know a ton of people would be eternally grateful.
if anyone has any idea of what i may of done wrong please let me know.. i edited the .py, and posted the menu options and actual menu in the right place so it appears in game. also i cut out the stuff in red.. my faction is still not changing.
I didn't touch the py. I just realized, found out myself, the game doesnt even look at py files they just make the text files the game reads and since the text files are hard to read unless you know what your looking for alot of ppl prefer py. Point is I just edited my text files and it worked beautifully.
1. Create a new troop in troops.txt or editor. (here is my faction recruit)
In native there are about 929 troops.
The unique ID for the last troop is 360287970189640609 so if you add yours to the end its troop 930 or 360287970189640610 the next would be 36xxx11 then 36xxx12 and so on.
MAKE SURE THEY ARE "player_supporters_faction" and "not player_faction"
2. Navigate to scripts.txt in your module folder whether its native or anther mod.
Inside scripts.txt look for (ctrl+f) "update_volunteer_troops_in_village"
Paste the following code OVER the existing code making sure that the blue number below is the unique ID for your faction recruit troop that will come out of your villages.
NEXT under update_npc_volunteer_troops_in_village
Paste the following, making sure to substitute the blue code with your unquie ID if its not troop 930 as above
4. Save all the edits you made load your saved game. Wait or play for 72 in game hours or there abouts. Then try to do two of the following things.
- Recruit a troop from a village owned by a faction that took it over in war.
- If you can recruit that factions troops instead of the original culture troop you know its working.
- If you have your own kingdom try recruiting from any village you have and you should be able to recruit your custom faction troop just like any other.
I have done exactly what I wrote above and I can recruit any faction troop including my own in any village they or I own regardless of culture. Hope this helps.
EDIT: There is a way to get your lords to recruit your troops too through party_templates but I'm working on it. My skill limits me since this is all new to me.
Attempt at having your lords recruit your troops
So inside party templates I added this to the bottom
In there you see Kingdom_1 etc those are what the npc factions are called. The player faction is called "player_supporters_faction"
So I substituted the kingdom_1 with player_supports_faction.
Next the numbers 934 2 6 0 933 4 7 0 -1 -1 -1 -1 (934 = troop number, 2 = min to recruit, 6 = max to recruit, 933 = next troop to recruit 4 is min 7 is max.
Basically its saying in one recruitment period for the NPC recruit anywhere between 2 to 6 Trained recruits (my custom troop) and 4 to 7 fresh recruits.
this goes on for three lines and you can then tell it to recruit more advanced troops etc. This when looking at it explains to me why the damn NPC always has so many archers lol.
Always add a 0 at the end like the code above and the -1 are place holders. so say in line one you only add one troop to be recruited you would add an extra -1 as a place holder. It would look like this.
Well who knows if this will work but at least it was informative =)
YOU CAN however edit the kingdom ones to change the way the npc recruits in your game. I actually gave them more foot troops to compensate with archers and more high end troops like Knights because this game is so damn easy even on the hardest setting.
Can anyone confirm that this is incompatible with v.26?Cause every time I try it I only get something like "23 something are fiercely devoted to you" or "23 Temp something".The 1st option doesn't give me any unit but it does take my money.The later one give me a naked character like a Companion sort of type thats named Temp volunteer or something even tho I got 23 on the option it only gives me 1 unit.Also I have Diplomacy tho I also tried it on Native but still the same result.
P.S this method work prior to v.26 in Diplomacy and Native.
P.S.S sorry for my bad english lol
one thing I see though is its asking for pt_kingdom at the bottom thats a party_template telling the npc how many of each troops to recruit. So now I guess I have to make one for these guys.
as you can see my diplomacy mod interjects I hope I don't get red lines for commenting it out. This feature let you choose what faction culture you wanted. I'm just changing it to the one you used then overriding what they recruit.
Well the reason you don't see it is because you have to create a menu that goes to that (sorry I didn't post that little bit!) Now since your using the Module system this shall be easier. I added this
Which I acually added with the rest of the camp actions but you could add it anywhere.
Now assuming you have an unmodded version of the module system (which I'm sure you don't) you have to add these to module_scripts and I'm sure you can mess around with them a bit to get them to work with your modded stuff.
So under module_scripts go to the update_volunteer_troops_in_village and the update_npc_volunteer_troops_in_village scripts and replace: (party_get_slot, ":center_culture", ":center_no", slot_center_culture),
with (store_faction_of_party, ":center_culture", ":center_no"),
Just cut out that stuff in the red and your done! yay
Now for everyone just tuning in,
What this does is forces factions to recruit their own troops, it also changes the culture of troops you recruit based on what faction owns it. (Example: Swadians capture a Nordic town, you then recruit Swadians from the once Nordic villages.)
Also the big menu part comes ONLY into play when you make your become a King for your own country. What it does is add a menu to the camp actions which allows for you to set the "culture" you AND your vassals recruit, whether you want Nord troops or Sarranids, or perhaps Rhodoks one day and Vaegirs the next.
For you creating your own troop trees and what not, I'm sure there is a way to make one of these,
For the troops you created and then have both you and your vassals recruit these men from the villages YOU own.
Note: These menus DO NOT appear if YOU are currently not a King of your own country.
So follow those steps and thats what they do, sorry the steps I've posted was never quite clear in the past. I hope this sums it up and it really is a great little tweak imo.
New: These codes are the same thing as the stuff above but only how they appear in the .txt files with the numbers. So this will help you all that don't use the module system which I still recommend you getting into if your going to do any modding.
So first of all locate "cf_reinforce_party -1" in scripts.txt and replace the entire line with
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.