Author Topic: Recruiting Troops in Castles  (Read 7772 times)

0 Members and 1 Guest are viewing this topic.

Damnation

  • Sergeant at Arms
  • *
  • It's most likely that I heart you.
    • View Profile
  • Faction: Bandit
Recruiting Troops in Castles
« on: November 15, 2008, 08:32:23 AM »
Hello everybody,
now I don't know if this is covered somewhere in any of the guides and documentations, i at least didn't find it, but I'm sick of having to train my troops for months before I get a usable army. How do I enable the recruitment of advanced units in castles? Can somebody please be so kind and explain it to me? I have no former mod experience...

Edit: Changed the message icon.
« Last Edit: November 15, 2008, 08:56:22 AM by Damnation »

Thymo

  • Sergeant at Arms
  • *
  • Snow and science!
    • View Profile
  • Faction: Nord
  • M&B
Re: Recruiting Troops in Castles
« Reply #1 on: November 15, 2008, 02:25:36 PM »
Ok, I did this a couple of days ago to practice my Python.. Altough I did it for 'town_trade'..

Here I go:




1. Open "module_game_menus"



2. Search for:
Code: [Select]
    "town_trade",0,



3. You'll find a section that looks like this:
(click to show/hide)



4. Replace it with:
(click to show/hide)



5. Search for:
Code: [Select]
    "town_trade_assessment_begin",0,


6. It will look something like this:
(an excerpt from 2 sections)
(click to show/hide)
(lines: 8253 - 8281 for un-edited module_game_menus)..



7. Change it to:
(click to show/hide)
(You just can't go without the regret assess trade button..  :lol: )



8. That's pretty much it.. You can change where you want to see this menu by editing the location of the "hire_troops" menu in step 4..

You can also edit what type of troops you want to hire, how much they cost and how many you want to hire by editing the details in step 7:

- Edit the text coloured green to whatever type of troop you want..
- Edit the text coloured purple for how many troops you want to hire each click..
- Edit the text coloured blue for how much you want them to cost..


PS: Can anyone help me with a 'random script' for the 'ask about' menu in step 7.. How do i arrange it so that the list of troops i find is randomly generated, and that higher priced groups are more rare.. And that types of troops depends on renown..  :? :?:



Thymo
« Last Edit: November 15, 2008, 02:31:52 PM by Thymo »
e^(i*π)+1=0

DukeKurts

  • Recruit
  • *
  • The Grand Emperor
    • View Profile
  • Faction: Swadian
Re: Recruiting Troops in Castles
« Reply #2 on: November 15, 2008, 03:21:29 PM »
I was looking for a script for that, as well. Thanks Thymo! :D
"The loyalty of your people is not to be taken for granted. Loyalty can not be faked - it must be earned by the respectful and honorable treatment of those who follow you." - Grand Emperor Kurts

Thymo

  • Sergeant at Arms
  • *
  • Snow and science!
    • View Profile
  • Faction: Nord
  • M&B
Re: Recruiting Troops in Castles
« Reply #3 on: November 15, 2008, 03:54:31 PM »
Np  :wink:


And.. Does anyone know wheter editing/creating "slots" (like "(party_get_slot, ":merchant_troop", "$current_town", slot_town_weaponsmith),") is possible.. I'm pretty sure it's impossible, but I was hoping for someone to prove me wrong..  :roll:

(click to show/hide)
e^(i*π)+1=0

Damnation

  • Sergeant at Arms
  • *
  • It's most likely that I heart you.
    • View Profile
  • Faction: Bandit
Re: Recruiting Troops in Castles
« Reply #4 on: November 16, 2008, 08:04:51 AM »
Thanks a lot, though I'm pretty surprised that this hasn't been asked more often before.

There's just one more thing. I've incorporated the script into the module_game_menus, now when I try to start the game though it stops at 3/4 of the loading screen (loading setting data) and gives me this error message: Unexpected End of File while reading file: Modules\Native\menus.txt

Any idea what this could be?

(click to show/hide)
^
Those are my last lines of menus.txt.

Thymo

  • Sergeant at Arms
  • *
  • Snow and science!
    • View Profile
  • Faction: Nord
  • M&B
Re: Recruiting Troops in Castles
« Reply #5 on: November 16, 2008, 01:15:09 PM »

Try implementing it again.. I had no problems with it, and if you get any problems try sending the "module_game_menus.py" to me..  :wink:

Warning: LOTS of text..
(click to show/hide)
e^(i*π)+1=0

Damnation

  • Sergeant at Arms
  • *
  • It's most likely that I heart you.
    • View Profile
  • Faction: Bandit
Re: Recruiting Troops in Castles
« Reply #6 on: November 16, 2008, 03:04:35 PM »

Try implementing it again.. I had no problems with it, and if you get any problems try sending the "module_game_menus.py" to me..  :wink:

Warning: LOTS of text..
(click to show/hide)

Hmm, re tried it, but I also put in different units to be recruitable.

This should be the whole area of the code that had to be modified, as it looks edited by me:
(click to show/hide)

Thymo

  • Sergeant at Arms
  • *
  • Snow and science!
    • View Profile
  • Faction: Nord
  • M&B
Re: Recruiting Troops in Castles
« Reply #7 on: November 16, 2008, 05:23:49 PM »
I fixed it!  8-)

This is the menu that had errors, errors in red..
(click to show/hide)


This is the fixed menu, corrected sections in green..
(click to show/hide)


Note: I'm not sure if the case of the letters in the name of the menus have any effect, but non of the other menus that i've seen contains upper-case letters.. ;)


~ Thymo
« Last Edit: November 16, 2008, 05:29:35 PM by Thymo »
e^(i*π)+1=0

Damnation

  • Sergeant at Arms
  • *
  • It's most likely that I heart you.
    • View Profile
  • Faction: Bandit
Re: Recruiting Troops in Castles
« Reply #8 on: November 16, 2008, 06:47:56 PM »
Thank you once more! I've replaced the original code(native code, that worked) with the corrected one, yet it still gives me that strange rgl error about menus.txt :(

Thymo

  • Sergeant at Arms
  • *
  • Snow and science!
    • View Profile
  • Faction: Nord
  • M&B
Re: Recruiting Troops in Castles
« Reply #9 on: November 16, 2008, 11:09:59 PM »
Thank you once more! I've replaced the original code(native code, that worked) with the corrected one, yet it still gives me that strange rgl error about menus.txt :(


Hmm, try removing it and run build module to see if the error is in the script..

Or could you send me the whole file? Maybe..?

(Timonico@gmail.com)


~ Thymo
e^(i*π)+1=0

wickedshot

  • Sergeant Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Recruiting Troops in Castles
« Reply #10 on: November 17, 2008, 12:30:19 AM »
I've gotten that code to work, but there's one problem with it: you can buy troops even when you don't have any money.  Other than that its great.

Damnation

  • Sergeant at Arms
  • *
  • It's most likely that I heart you.
    • View Profile
  • Faction: Bandit
Re: Recruiting Troops in Castles
« Reply #11 on: November 17, 2008, 06:01:19 PM »
Thank you once more! I've replaced the original code(native code, that worked) with the corrected one, yet it still gives me that strange rgl error about menus.txt :(


Hmm, try removing it and run build module to see if the error is in the script..

Or could you send me the whole file? Maybe..?

(Timonico@gmail.com)


~ Thymo

I'd love to send you the whole file, yet my internet (or computer?) is behaving really irritably and firefox crashed a few times when I tried to access my e-mail account today (I also strangely cant use the pre-view function of the forums anymore, always says "fetching preview..."). Nevertheless, it's the same thing as before, basically.

When I try to build the module it says:
(click to show/hide)

The line 8254 is:
(click to show/hide)

The error isn't in the original script. I took the original, built the module, started the game, worked. Then I inserted the hire script into that working script and it goes FUBAR. :/


Thymo

  • Sergeant at Arms
  • *
  • Snow and science!
    • View Profile
  • Faction: Nord
  • M&B
Re: Recruiting Troops in Castles
« Reply #12 on: November 17, 2008, 06:04:10 PM »
I've gotten that code to work, but there's one problem with it: you can buy troops even when you don't have any money.  Other than that its great.

Oh, dang.. I never noticed.. Thanks!  :wink:

I don't have the time right now, but I think I know how to fix it.. Something with "restrict_buy*somethingsomething*"..  :?
e^(i*π)+1=0

Thymo

  • Sergeant at Arms
  • *
  • Snow and science!
    • View Profile
  • Faction: Nord
  • M&B
Re: Recruiting Troops in Castles
« Reply #13 on: November 17, 2008, 09:07:09 PM »
Bla, bla, bla...


Here's a copy of my module_game_menus from line 8223 to 8286..



(click to show/hide)

If possible could you send me larger copy than just a copy of the single line, 8252? Muchly appreciated..  :wink:
« Last Edit: November 17, 2008, 09:10:17 PM by Thymo »
e^(i*π)+1=0

Damnation

  • Sergeant at Arms
  • *
  • It's most likely that I heart you.
    • View Profile
  • Faction: Bandit
Re: Recruiting Troops in Castles
« Reply #14 on: November 17, 2008, 09:12:45 PM »
Well, here it is from line 8210 to 8423. (in red, the "faulty" line, as sayeth the build_module.bat)
(click to show/hide)

This should be exactly the script for town_hire which you've corrected. I simply copy & pasted it.

Edit #3: FIXED! There was just a bracket missing before "town_trade".
« Last Edit: November 17, 2008, 09:27:00 PM by Damnation »