Author Topic: Need Help With Tavern Recruitment.  (Read 1357 times)

0 Members and 1 Guest are viewing this topic.

NaglFaar

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Nord
  • MP nick: NaglFaar
  • M&BWBNW
Need Help With Tavern Recruitment.
« on: July 23, 2009, 10:55:57 AM »
OP below.
(click to show/hide)

SOLVED!
Here is the working code. Made by Geoffrey Ashe.
Solution by Hokie BT.

(click to show/hide)


(click to show/hide)


(click to show/hide)


(click to show/hide)


(click to show/hide)

This one, below, is pasted at the bottom of the file.
(click to show/hide)


(click to show/hide)


(click to show/hide)
« Last Edit: July 23, 2009, 11:19:53 PM by NaglFaar »
Mæli þarft eða þegi


the thread is in Alpha stages and when all the ideas have been put together and implemented the taleworlds post shall be completed.

Llew

  • Cheap ass bum
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Vaegir
  • MP nick: nK_Llew
  • M&BWB
Re: Help With Tavern Recruitment.
« Reply #1 on: July 23, 2009, 01:03:24 PM »
I had the exact same problem. Hope you find an answer.

NaglFaar

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Nord
  • MP nick: NaglFaar
  • M&BWBNW
Re: Help With Tavern Recruitment.
« Reply #2 on: July 23, 2009, 02:07:25 PM »
Yeah, I read your thread.
There must be some kind of solution for it since many mods have this feature.
Mæli þarft eða þegi


the thread is in Alpha stages and when all the ideas have been put together and implemented the taleworlds post shall be completed.

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
  • M&B
Re: Need Help With Tavern Recruitment.
« Reply #3 on: July 23, 2009, 05:07:31 PM »

what doesn't work about it or what errors do you get?
 

NaglFaar

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Nord
  • MP nick: NaglFaar
  • M&BWBNW
Re: Need Help With Tavern Recruitment.
« Reply #4 on: July 23, 2009, 06:09:03 PM »
The thing is that if I use the code found in the script exchange I get an error saying:

Unrecognized opcode 66.; LINE NO: 2: At dialog consequence: dlga_tavernkeeper_buy_peasants:tavernkeeper_buy_peasants_2.1. At dialog consequence: dlga_tavernkeeper_buy_peasants:tavernkeeper_buy_peasants_2.1.

And then when I enter where the troops should there's no troops.
It's empty.

And if I use the SoD variant, all I get is a clone of my self but no error.
All I wan't is for the troops to show up in the window and to be able to hire them.


Here is where they differ from each other.
I can't see anything else that
Code: [Select]

Here is the original code found in the script exchange:

[anyone|plyr,"tavernkeeper_talk", [], "I need to hire some soldiers. Can you help me?", "tavernkeeper_buy_peasants",[]],
  [anyone,"tavernkeeper_buy_peasants",
   [
       (store_encountered_party,reg(3)),
       (store_faction_of_party,reg(4),reg(3)),
       (store_relation,reg(5),"fac_player_supporters_faction",reg(4)),
       (lt, reg(5), -3),
    ], "I don't think anyone from this town will follow somebody like you. Try your luck elsewhere.", "tavernkeeper_buy_peasants_2",[]],
  [anyone,"tavernkeeper_buy_peasants", [], "I know a few fellows who would follow you if you paid for their equipment.", "tavernkeeper_buy_peasants_2",[(store_encountered_party,reg(2)),(party_get_slot,"$tavernkeeper_party",reg(2)),slot_town_mercs),(set_mercenary_source_party,"$tavernkeeper_party"),(change_screen_buy_mercenaries)]],
  [anyone,"tavernkeeper_buy_peasants_2", [], "Anything else?", "tavernkeeper_talk",[]],


Note that if this code should work at all I have to add a "(" to: slot_town_mercs)
Otherwise it gives a syntax error.
###################################
###################################

And here is the Sod variant:

[anyone|plyr,"tavernkeeper_talk", [], "I need to hire some soldiers. Can you help me?", "tavernkeeper_buy_peasants",[]],
  [anyone,"tavernkeeper_buy_peasants",
   [
       (store_encountered_party,reg(3)),
       (store_faction_of_party,reg(4),reg(3)),
       (store_relation,reg(5),"fac_player_supporters_faction",reg(4)),
       (lt, reg(5), -3),
    ], "I don't think anyone from this town will follow somebody like you. Try your luck elsewhere.", "tavernkeeper_buy_peasants_2",[]],
  [anyone,"tavernkeeper_buy_peasants", [], "I know a few fellows who would follow you if you paid for their equipment.", "tavernkeeper_buy_peasants_2",[(set_mercenary_source_party,"$tavernkeeper_party"),[change_screen_buy_mercenaries]]],
  [anyone,"tavernkeeper_buy_peasants_2", [], "Anything else?", "tavernkeeper_talk",[]],
Mæli þarft eða þegi


the thread is in Alpha stages and when all the ideas have been put together and implemented the taleworlds post shall be completed.

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
  • M&B
Re: Need Help With Tavern Recruitment.
« Reply #5 on: July 23, 2009, 07:29:48 PM »
I used the SOD code in my mod, while they are similar I don't think you could mix-n-match the code so I'd try and first get Geoffrey Ashe's version working.  If that doesn't work then maybe remove it all and try the SOD source.

In terms of the syntax error, you actually don't want to add another ) you need to remove the extra one I highlighted in red.   See if removing this fixes it?

Quote
(party_get_slot,"$tavernkeeper_party",reg(2)),slot_town_mercs),
 

NaglFaar

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Nord
  • MP nick: NaglFaar
  • M&BWBNW
Re: Need Help With Tavern Recruitment.
« Reply #6 on: July 23, 2009, 07:49:33 PM »
Aha. I added a ( to it.
(party_get_slot,"$tavernkeeper_party",reg(2)),(slot_town_mercs),

instead of removing it, like this:

(party_get_slot,"$tavernkeeper_party",reg(2),slot_town_mercs),


I'll try and see if it your solution gets me anywhere.

-EDIT-

Glory and riches to thee!
Your might shall allways prevail and never fail you.

No but seriously, Thanks.
It helped. No errors, all troops showing.
Again. Thank you.

Mæli þarft eða þegi


the thread is in Alpha stages and when all the ideas have been put together and implemented the taleworlds post shall be completed.

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
  • M&B
Re: Need Help With Tavern Recruitment.
« Reply #7 on: July 23, 2009, 08:32:36 PM »

damn, good to hear.   I think I tried to help Llew2 out a while back and we could never get it working.  2nd time is the charm apparently....   hehe
 

NaglFaar

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Nord
  • MP nick: NaglFaar
  • M&BWBNW
Re: Need Help With Tavern Recruitment.
« Reply #8 on: July 23, 2009, 11:14:16 PM »
Yeah. I'll send him a PM and let him know that there is solution to it.

I'll also edit my OP to show the correct line of the code.
Mæli þarft eða þegi


the thread is in Alpha stages and when all the ideas have been put together and implemented the taleworlds post shall be completed.

dariel

  • Knight
  • *
    • View Profile
    • The Madman's Cave
  • Faction: Khergit
Re: Need Help With Tavern Recruitment.
« Reply #9 on: July 31, 2009, 05:45:05 PM »
Hi,

I'd like to get help doing something similar at the tavern.  What I want to do is to check for the faction of the town, and call that faction's basic elite troop and put it into the mercenary buy screen.

I was able to get HokieBT's version working, but that put all factions' nobles for hire so I tried to tweak it to check for faction.  When I tried to adapt the update village volunteers script (with my very newbie knowledge of coding) I got the same error as NaglFaar -- my character shows up in the buy screen.

Here's the code I tried to work with:

(click to show/hide)
I'm a nut, I know I'm a nut, and I like being a nut so I'll stay a nut. 
(from The Legacy of Nathan Brazil, Jack Chalker)

FrisianDude

  • Coitus non Awesome
  • Grandmaster Knight
  • *
  • Zis is Tshörman tärritorie!
    • View Profile
  • Faction: Neutral
  • MP nick: OLL_SirAndelot/Liudulf Ward
  • M&BWB
Re: Need Help With Tavern Recruitment.
« Reply #10 on: July 31, 2009, 07:04:14 PM »
Dariel, maybe you could use
Code: [Select]
slot_faction_tier_5_troop in there?

Like so:
(click to show/hide)
At least, I assume you meant the highest tier troop (defined in module_scripts) with your "elite"? I wouldn't know if it works, though.

Nords ruled by King Ragnar, Khergits ruled by Sanjar Khan, Rhodoks ruled by King Graveth, Swadians ruled by King Harlaus, Vaegirs ruled by King Yaroglek. All those peoples live, fight, and die in the continent of Calradia. The Nords and Rhodoks field solely infantry and archers, the Swadians and Vaegirs have infantry, archers and cavalry and the Khergit field almost exclusively cavalry. No such things as "infarty" or "calvary" exist. Play Vikingr!

iggorbb

  • Master Knight
  • *
  • ...meh...
    • View Profile
  • Faction: Vaegir
  • MP nick: terorminator
Re: Need Help With Tavern Recruitment.
« Reply #11 on: December 14, 2009, 09:18:35 PM »
I got problem with tavern recruitment, this is what module.bat says:


Initializing...
Traceback (most recent call last):
  File "process_global_variables.py", line 11, in <module>
    from process_operations import *
  File "c:\Program Files\Mount&Blade\Modules\test2\process_operations.py", line
20, in <module>
    from module_scripts import *
  File "c:\Program Files\Mount&Blade\Modules\test2\module_scripts.py", line 691,
 in <module>
    (party_set_slot,":town_no", slot_town_mercs,":cur_object_no"),
NameError: name 'slot_town_mercs' is not defined
Exporting strings...

what should I do?
Бој не бије свијетло оружје, већ бој бије срце у јунака.

bb_osp

NaglFaar

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Nord
  • MP nick: NaglFaar
  • M&BWBNW
Re: Need Help With Tavern Recruitment.
« Reply #12 on: December 14, 2009, 10:18:59 PM »
This means you haven't defined the slot_town_mercs in module_constants I believe.
Some one correct me if I'm wrong.
Mæli þarft eða þegi


the thread is in Alpha stages and when all the ideas have been put together and implemented the taleworlds post shall be completed.

iggorbb

  • Master Knight
  • *
  • ...meh...
    • View Profile
  • Faction: Vaegir
  • MP nick: terorminator
Re: Need Help With Tavern Recruitment.
« Reply #13 on: December 15, 2009, 12:56:24 AM »
Got it all from up there, is there anything else I dont know?
Бој не бије свијетло оружје, већ бој бије срце у јунака.

bb_osp

iggorbb

  • Master Knight
  • *
  • ...meh...
    • View Profile
  • Faction: Vaegir
  • MP nick: terorminator
Re: Need Help With Tavern Recruitment.
« Reply #14 on: December 15, 2009, 06:26:38 PM »
Got it, sorry.
Бој не бије свијетло оружје, већ бој бије срце у јунака.

bb_osp