Author Topic: Disabling Npc Interaction - Apparently it was meant to be in the game.  (Read 33007 times)

0 Members and 1 Guest are viewing this topic.

TheMageLord

  • The Handyman Can
  • Knight
  • *
    • View Profile
  • Faction: Neutral
  • M&BWB
By request of Wraithcat, I looked into a way to disable companion interaction. It turned out to be much simpler than I thought it would be - there is a built in toggle to disable it, but the option to disable it wasn't added in. It's actually there in the .960 module system, but commented out - and doesn't exist in the 1.003 text files. The value is initially assigned as 0 in game_start, though, which is what I'll be editing here (so it would require a new game, unlike the other tweaks).

I won't copy the whole script on this one, since it's ridiculously large, but heres the line of code you need to search for:
Quote
2133 2 144115188075856295 0
144115188075856295 is the actual thing being assigned here, and 0 is what it is being assigned to. Normally this is to get the variable ready to be set elsewhere, but we can just set it here and save the hassle. Change the 0 to a 1, and presto - the next time you start a game, companions will no longer interact (no complaints or compliments).

You COULD work it into a game in progress if you really wanted to, but you would have to add the line of code somewhere. I won't cover that here, but basically you'd just pick a script that will be triggered and add in the 2133 2 144115188075856295 1 thing to the end or beginning of it. Then you add 1 to first number in the script (which is the # of lines in that script, it needs to add 1 because you're actually adding in an extra line of code). You could remove it after you know that the script has been triggered - it stays once set.

This is the first of my tweaks that I won't actually be using, since I usually only keep 2 or 3 companions anyway, but it's good for those who want companion armies. Enjoy.

-edit- For those new to M&B modding, this is all in scripts.txt, which is in Mount&Blade\Modules\Native.

Link to other tweaks.

-edit- If you want to put this into games in progress, you can do like lord Kinlar said and add the line to start_training_at_training_ground. See this for a good (I hope, anyway...) explanation of doing that.

Update: In 1.010 a new global variable has been added. This causes the reference to the variable being set here to be changed. To find the new one you need to search for
Quote
2133 2 144115188075856296 0
Note the 144115188075856295 changed to 144115188075856296, this is due to the aforementioned new global variable. I haven't dug around in 1.010 to see if this still works in 1.010, but I doubt all the workings of it were changed in a bugfix so it probably will.

Update2: In 1.011 this new variable has been moved to the bottom of the list, thus fixing compatibility errors with 1.003. So if you're using 1.011 you have to use the original number mentioned above for 1.003. I still haven't dug around to see if it all still works, though :)
« Last Edit: November 04, 2008, 12:40:17 AM by TheMageLord »
I shall destroy you! I shall cleave off your limbs with a dull axe, rip off your head with my bare hands, tear out your eyes with a rusty SPOON! So please stand there while I find the time. Oh, so busy...

Smitehappy

  • Recruit
  • *
  • 2 inches of FURY!!
    • View Profile
  • Faction: Nord
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #1 on: October 02, 2008, 04:12:51 AM »
Thank god, now I can finally have Matheld in my party without her threatening to slit my party's doctor's throat. :D

Momaw

  • M&B Manual Author
  • Knight
  • *
    • View Profile
  • Faction: Rhodok
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #2 on: October 02, 2008, 04:34:36 AM »
I think TheMageLord needs a script-related special title.  :D
Sea raiders ain't got nothing on landpirates.

Tachyon

  • Veteran
  • *
    • View Profile
  • Faction: Khergit
  • WB
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #3 on: October 02, 2008, 04:52:23 AM »
I think TheMageLord needs a script-related special title.  :D

Lord of the Scripts?

Anyway, his scripts have been really useful...especially his Dhirim siege tower fix.

Wraithcat

  • Sergeant
  • *
    • View Profile
  • Faction: Rhodok
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #4 on: October 02, 2008, 05:18:49 AM »
Absolutely outstanding Magelord!! And damned quick as well!  8-)

You and your scripting have totally changed the game for me

I second, "Lord of the Scripts"!   :D

Lord Kinlar

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #5 on: October 02, 2008, 05:32:21 AM »
Excellent stuff, TML!  :)

You COULD work it into a game in progress if you really wanted to, but you would have to add the line of code somewhere. I won't cover that here, but basically you'd just pick a script that will be triggered and add in the 2133 2 144115188075856295 0 thing to the end or beginning of it. Then you add 1 to first number in the script (which is the # of lines in that script, it needs to add 1 because you're actually adding in an extra line of code). You could remove it after you know that the script has been triggered - it stays once set.

If I add that line (2133 2 144115188075856295 1) to, let's say, start_training_at_training_ground for example, would it get triggered when I start training at a training ground?  :?:

And if the method above works, is there a way to turn it off after that, like adding 2133 2 144115188075856295 0 line again?




 

TheMageLord

  • The Handyman Can
  • Knight
  • *
    • View Profile
  • Faction: Neutral
  • M&BWB
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #6 on: October 02, 2008, 05:44:18 AM »
Haha, apparently my title is now "The Handyman Can." Catchy, I kinda like it :D

I expected the request to be *way* more complicated. Who would've thought that there would be a simple trigger to turn off every single npc interaction?

Kinlar: It should, you could try it and then see if the companions stop bickering. If they do, all is well. If not try again. And yes, that's all you'd have to do to turn it back off. What it does is every time an opportunity comes up for them to complain (after battles) it checks it, if it is set to 0 they complain as usual. If not it just doesn't do anything. So turning it back to 0 should make them start complaining again at the next opportunity.

When the module system comes out it would be trivial to add a menu or something to set it as an option. I'm really surprised it wasn't added already, considering all the scripts already check for it.
I shall destroy you! I shall cleave off your limbs with a dull axe, rip off your head with my bare hands, tear out your eyes with a rusty SPOON! So please stand there while I find the time. Oh, so busy...


Hound_of_Culann

  • Recruit
  • *
    • View Profile
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #8 on: October 02, 2008, 08:23:41 AM »
This really sounds like something I would like to implement, but i don't know much about modding.  Where do I find game_start?  In the program files or do I need an editor?  I looked in the program files but couldn't find it.  Or am I missing the mark completely?

TheMageLord

  • The Handyman Can
  • Knight
  • *
    • View Profile
  • Faction: Neutral
  • M&BWB
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #9 on: October 02, 2008, 08:27:59 AM »
Ah, sorry - I should have specified.

You need to open scripts.txt in Mount&Blade\Modules\Native.

Game_start is the name of the script inside scripts.txt (incidentally, it's the one at the top). Inside the file you need to open up the search function in whatever text editor your using, and do a search for 2133 2 144115188075856295 0.

Once you've found it (there is only one in the whole file) change the 0 to a 1.

The only thing this does is make companions not interact with eachother - they won't compliment eachother, they won't complain - and they won't leave due to disliking someone. If you want a really big party without bothering with figuring out who hates who, this is useful. I personally never use big parties of heroes anyway so I left mine at the default setting.
« Last Edit: October 02, 2008, 08:32:40 AM by TheMageLord »
I shall destroy you! I shall cleave off your limbs with a dull axe, rip off your head with my bare hands, tear out your eyes with a rusty SPOON! So please stand there while I find the time. Oh, so busy...

Hound_of_Culann

  • Recruit
  • *
    • View Profile
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #10 on: October 02, 2008, 08:53:12 AM »
Thanks a lot man, you're a gentleman and a scholar  :wink:

Muglebust

  • Veteran
  • *
    • View Profile
  • Faction: Nord
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #11 on: October 02, 2008, 09:03:06 AM »
:thumbsup: Handyman, I am sure a 16 companion party can take over the world

Zandman

  • Sergeant at Arms
  • *
    • View Profile
    • Zandmod I
  • Faction: Vaegir
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #12 on: October 02, 2008, 09:06:40 AM »
Call me crazy, but I really like the NPC interaction.

it really helps creating an image of the characters in my mind and make them come to life without having to construct elaborate storylines in the game. Say that Matheld, e.g., is a terrible, intolerable woman and doesn't suit the style of your party - well, then, you have to either change your own style to accomodate her or just leave her be. I know that when I recruit that obnoxious Alayen, he won't stay long, so I try using him for what he's worth while he's there.

Interaction adds depth, IMO


... and I bet my opinion on this is frightfully interesting to many people.  :roll:
(download HERE! )

TheMageLord

  • The Handyman Can
  • Knight
  • *
    • View Profile
  • Faction: Neutral
  • M&BWB
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #13 on: October 02, 2008, 09:17:33 AM »
I actually feel the same way, Zandman. I just made this tweak as a request from Wraithcat (he sent me a PM).

Although the bickering doesn't affect me much anyway. I prefer running with 3 or 4 heroes to carry key skills - one with training + engineering + first aid + wound treatment, another with training + pathfinding + spotting + tracking, the third with high dexterity and looting with a bit of training, and the fourth as a backup for the others - with high first aid, wound treatment, training, and pathfinding. Two pairs that like eachother works fine for this.

I never get surgery (feels too much like cheating, imo) and I customize the party based on my skills. If I go with high charisma, I get trading and leadership. If I go with high dex, I get looting and have that guy focus on charisma to do the trading. Everyone, including me, does the training - and in a couple days I can train a party from raw recruits to hardened soldiers.

The game just feels more real when my people DIE when they get chopped up, instead of magically staying alive (as either a hero or a surgically saved character). Seeing a guy get smacked in the head with an axe and only going unconscious just feels wrong... What did I do to save him, sew his head back on?
I shall destroy you! I shall cleave off your limbs with a dull axe, rip off your head with my bare hands, tear out your eyes with a rusty SPOON! So please stand there while I find the time. Oh, so busy...

Muglebust

  • Veteran
  • *
    • View Profile
  • Faction: Nord
Re: Disabling Npc Interaction - Apparently it was meant to be in the game.
« Reply #14 on: October 02, 2008, 09:40:29 AM »
Interaction adds depth, IMO
indeed, but I have one love above anything else, and thats options, Handymans tweaks adds more of them and thats a good thing in my book