SP Tutorial Module System Recruit your custom troops in your own Kingdom

Currently Viewing (Users: 0, Guests: 1)

Aaeni

Sergeant
Best answers
0
Crud. Well, tried it again for the second time and this time it says there is an unexpected end to the scripts.txt file and crashes. I forgot to back it up and all, so I don't know what to do. D:
 

Maksim125

Banned
WB
Best answers
0
What is the code back to normal because im recruiting chamberlins in my village.



Thanks for nothing I got it.
 

AndarielHalo

Regular
WBNW
Best answers
0
I can barely comprehend any of what's posted here.  So I added some custom troops and I'm trying to make it so I can recruit them from my own independent kingdom.  Can I do it WITHOUT having to deal with the dense and incoherent text files with the big numbers?  I've already added them to the Troops.txt and such.


How do I make them recruitable in the module script python?


I actually did the Module script option in the first post, but it didn't work at all.
 

Krash

Recruit
Best answers
0
It is possible make something like that:

Village "A" - Faction 1 - swadian recruit
Village "B" - Faction 1 - custom troop
Village "C" - Faction 1 - swadian recruit

???
I want to recruit my own troops in only few villages.
 

General WVPM

Recruit
Best answers
0
LOLLord Ben said:
Alright, just downloaded Module Sys 1.113 and did this:

Under
Code:
  (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
insert:
Code:
	 # MOD begin
       (store_faction_of_party, ":center_faction", ":center_no"),
       (try_begin),
         (is_between, ":center_faction", "fac_kingdom_1", "fac_kingdoms_end"),
         (faction_get_slot, ":volunteer_troop", ":center_faction", slot_faction_tier_1_troop),
         (assign, ":volunteer_troop", "trp_swadian_sergeant"),
       (try_end),       
	 # MOD end
That gives ya always your troop, in my case it is "trp_swadian_sergeant", but you can try all other troops to put behind "assign", WOOT! Thx for the script Topper, now with 1.113 we can go hog wild lmfao. :mrgreen:
you are my hero thank you sooo much it works with warband 1.134 thank you :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :grin: :grin: :grin: :grin: :grin: :grin: :grin:
 

LOLLord Ben

Recruit
Best answers
0
General WVPM said:
you are my hero thank you sooo much it works with warband 1.134 thank you :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :grin: :grin: :grin: :grin: :grin: :grin: :grin:
LOL, you're welcome; it works and (as it seems) will work in future updates as well (I hope).
Only thing is I'm too stoopid to write somebig-assed code to make it spawn different men in different towns and different factions. But if one wants to recruit his FAVOURITE Units all the time, it's perfect.

FYAI: I had to tweak my own custom troops about a billion times now, coz they either got cut down in one swing by some random peasant or none of them would ever die, even when hit with 255 damage, lmao.
 

erundil

Recruit
Best answers
0
Yeah, the code works just fine. In my mod I go to village of any faction in I always recruit units from my faction.
Default is: recruits' faction number  is village's faction number
It changes to: recruits' faction number is your faction number

Now here's a new idea:
RECRUITS' FACTION NUMBER IS NUMBER I WROTE IN THE FILE (e.g. always Swadian, or always Vaegir).
Is that possible? And if so, could anyone post a code, that has to be pasted into game's text file or python code for that?
 

Askorti

Sergeant Knight at Arms
WB
Best answers
0
Is there an easy way to do this in mods like Diplomacy+PBOD?
This is probably last thing I need to make this mod almost perfect, my own units :/
 

erundil

Recruit
Best answers
0
KuroiNekouPL said:
Is there an easy way to do this in mods like Diplomacy+PBOD?
This is probably last thing I need to make this mod almost perfect, my own units :/
It depends.
If you have a module system for Diplomacy+PBOD you can edit python script.
Else if not, you can hope that this mod doesn't change function "update_volunteer_troops_in(...)" and paste the code provided on the forum into scripts.txt.

If none of those above are possible, because you don't have a module system and mod changes the function, there is only one thing you can do: contact the mod's authors and either ask them to do it for you, or ask them for a module system (and then edit it and compile yourself).
 

leroyeser

Recruit
M&BWBWF&S
Best answers
0
Hello a question my code is wrong i think becuz something weird appears when i wait 72 hours and then want to recruit so ill explain

Standard number:
360287970189640610

Number i Need (My Warband Recruit is number 944 and the first one in the new list has 930):
360287970189640625

but this isnt working i get a weird line of text and when i press recruit 1 i dont get the recruit so any idea why

Here is a pic of my troop list:


Edit: Oops srry noticed it had to be  360287970189640624 its working now great work man thanks for the code!
 

chibifain

Recruit
Best answers
0
Topper do you know if this method still works? i'm showing a little over 900 units in Native now, and this didnt work for me. Can you double check it and update if it's wrong for the new update? Thanks bunches!
 

Cheator

Regular
Best answers
0
Hello
How do I make this work with warband 1.134?

When open scripts.txt, the entry for update_volunteer looks entirely different and I can' find where to put the 360287970189640610 and when I paste the entire code from the first post my game crashes on start with "unexpected end" error
 

Lord Innos

Recruit
Best answers
0
boogie85 said:
Does anyone know how I get this to work with 1.143?
Bump! This is basically the last thing Im missing for my module and I cant seem to make it work, when I try changing the .txt files It doesnt work, it lets me recruit "Robbers" which are units 3 lines up from mine, and using the code it doesnt do anything.
 

erundil

Recruit
Best answers
0
Of course it won't work. I'd be surprised if it actually did.

You have to:
1. Download a clean module system (wth no changes)
2. Edit the module system
3. Compile it several times with different units set
4. Compare the files

That way everyone here will get the proper code to paste into scripts.txt and noone will have to bump it anymore. I won't o it because i got bored with this game, but maybe you can do it for the community.
 

Federick421

Squire
Best answers
0
Ive got the most recent version of Morghs M&Blade editor, now I need some help to make my own kingdom troop line which I decided to base it on medieval England
 

Lord Innos

Recruit
Best answers
0
So, i've been tinkering with Bismark's code and Seek'N'Destroy's about this, and to no avail.. cant seem to make it work, I dont like modifying the .txt files since I'd have to change it over and over again everytime I compile a new piece of code.

If anyone has any hint to try codding this... please share it with me, cause I have my mod sitting there unused since it still lacks what I think its more important for the completion of it.

EDIT: I've finally found a way, by merging stuff from Seek & Destroy's code from his "polished native" mod into Bismark's compilation, so I have now the source for a Bismark Compilation WITH custom troop recruiting for both the player and the NPCs... if I have the time later Im going to upload it, so anyone who wants to use Bismark compilation and wants to be able to recruit custom troops can do it.