Compilation of 82 little tweaks to the text files to change your gameplay(links)

Users who are viewing this thread

Great stuff!

Here's one I wonder if you can do... if there's anything in there for how Lords respawn elsewhere after a battle when they're not captured, a way to make it take a lot longer?

Mainly so I don't have to deal with this crazy problem if you push a faction into just a few castles they'll be 15 lords sitting together in them with 50-100 guys each...
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
Mills gives a one time bonus of 5%, which I admit kinda sucks... Changing it to a recurring means you have to add a new trigger (so might not be savegame compatible).

Heres a simple trigger that I made from scratch that you can add that will keep applying the bonus:
720.000000 3 6 3 1224979098644774912 648518346341351501 648518346341351591 541 3 1224979098644774912 131 1 1 3 936748722493063465 1224979098644774912 5
What this does is: Every 720 hours (30 days) it runs a check through all the villages. For each village with a mill, it triggers a script that increases prosperity by 5%.

What you do is open up simple_triggers.txt and paste that whole thing in at the very bottom, then go up to the very top and increase the very first number in the file (84, on line 2) by 1 (so 85 unless you've added other triggers). That way it will read the trigger. Again, I don't know if this is savegame compatible - I don't have a save with a mill built to see if it is or not. Also note that while this trigger *should* work, im only human. I'll be using it myself, though - so I do trust it :smile:
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
bravesirknight, it's possible but it won't be perfect. Go into simple_triggers.txt and search for:
48.000000  23
The 48 is the number of hours between triggering, so this one goes every two days. The trigger takes all lords who aren't currently on the map and puts them in a friendly castle - if the kingdom is destroyed, it gives them a 10% chance to swap to another kingdom.

Raising the 48 to a higher number would increase the interval between checks, but it would still spawn them all at once when it did do the check. Even if you have it set to monthly, you could kill them 1 hour before the end of the month and they'd still pop back in.

Given the module system, it wouldn't be too hard to build in a more complex check that stores the time that they are defeated or released and releases them X days from that point, but without the module system that would be quite difficult.
 

Lord Kinlar

Master Knight
FYI  I've just found a typo in conversations.txt and dialog_states.txt. I don't know if it has an effect on gameplay but here it is...

pretneder_view_char_requested

should be pretender:smile:
 
TheMageLord said:
bravesirknight, it's possible but it won't be perfect. Go into simple_triggers.txt and search for

Given the module system, it wouldn't be too hard to build in a more complex check that stores the time that they are defeated or released and releases them X days from that point, but without the module system that would be quite difficult.

Interesting. Probably means more cheating in my future in the short term lol... At least it will be changeable at some point, sounds good to me.
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
Lord Kinlar, I decided to go ahead and look into the dialogs again and came up with a nice solution to the problem of companions telling you to die.

Go into conversation.txt and increase the number at the top by 1 (so to 1670 if you haven't added anything else in) and then paste this:
dlga_start:member_talk 4095 0  4 33 3 144115188075855885 360287970189639844 360287970189639860 31 2 144115188075856039 1 520 3 1224979098644774912 144115188075855885 130 2320 2 5 1224979098644774912 Yes,_{s5}?  71  0
in somewhere. I put mine directly behind the member_chat one. That alone will work, but lets also add 2147483679 2 144115188075856039 1 (a check if you're in a castle or not) to the member_separate thing (so you can't ask them to leave when they're in the castle, which might screw something up). To do this just put it in right after the first 0 in that dialog, and then change the 0 to a 1 (so it will read the line of code you added).

That section of the dialog file should look like this now if you stuck the dialog in the same spot I did:
dlga_member_chat:member_talk 4095 13  4 2200 1 144115188075855885 1507 1 144115188075855885 520 3 1224979098644774912 144115188075855885 130 2320 2 5 1224979098644774912 Yes,_{s5}?  71  0
dlga_start:member_talk 4095 0  4 33 3 144115188075855885 360287970189639844 360287970189639860 31 2 144115188075856039 1 520 3 1224979098644774912 144115188075855885 130 2320 2 5 1224979098644774912 Yes,_{s5}?  71  0
dlga_member_talk:member_trade 69631 71  0 Let_me_see_your_equipment.  72  0
dlga_member_trade:do_member_trade 4095 72  0 Very_well,_it's_all_here...  73  1 2051 0
dlga_do_member_trade:member_talk 4095 73  0 Anything_else?  71  0
dlga_member_talk:view_member_char_requested 69631 71  0 What_can_you_tell_me_about_your_skills?  74  0
dlga_view_member_char_requested:do_member_view_char 4095 74  0 All_right,_let_me_tell_you...  75  1 2046 0
dlga_member_talk:member_separate 69631 71  1 2147483679 2 144115188075856039 1 We_need_to_separate_for_a_while.  76  2 1 2 936748722493063474 144115188075855885 2133 2 144115188075855902 72057594037927936
Stuff added is in blue, the 0 which was changed to a 1 is in red.

Once this is done, the message that you get when talking to the troops will be the same as the one when you talk to them from the party menu - and you'll be able to change their equipment and look at their skills and everything.

NOTE: The new dialog needs to be ABOVE the section dealing with companions rejoining, or you will encounter a bug later where any companion that leaves you for any reason and rejoins will trigger those dialogs instead of the new one being added. If you put it where I put it in the example you'll be fine. So I suggest you put it exactly where I did on the example to avoid this bug.
 

Lord Kinlar

Master Knight
TheMageLord said:
-edit- For a few minutes, the one I had here was buggy (triggered on other people, since the check was just if they were a hero). I've corrected this now (now it checks if they are one of the companions specifically).

Will this work for claimants now, when you garrison them?
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
No, but the original dialogs for the claimant already works :smile:

No need for a tweak there.

The bug that I fixed was the fact that the original script only checked if they were a hero, and all I added to it at first was a check that they were in a castle/lord's hall. But since there are a LOT of heroes (every single lord, lady, and all the claimants have the hero tag set) it was triggering on everyone while they were in castles.

To fix it, I removed the check to see if they were a hero and added a check to see if they were one of the companions (it's an is_between check). So now it ONLY triggers on companions in castles, and since companions are only in castles when you garrison them, it shouldn't trigger at all except for the exact occurence that it was meant for.
 

Lord Kinlar

Master Knight
TheMageLord said:
No, but the original dialogs for the claimant already works :smile:

No need for a tweak there.

The bug that I fixed was the fact that the original script only checked if they were a hero, and all I added to it at first was a check that they were in a castle/lord's hall. But since there are a LOT of heroes (every single lord, lady, and all the claimants have the hero tag set) it was triggering on everyone while they were in castles.

To fix it, I removed the check to see if they were a hero and added a check to see if they were one of the companions (it's an is_between check). So now it ONLY triggers on companions in castles, and since companions are only in castles when you garrison them, it shouldn't trigger at all except for the exact occurence that it was meant for.

I just thought the claimants would also use the same "surrender or die" dialog when garrisoned*, but you say they don't. I'm still trying to figure out how those dialogs work so I haven't tested your fix yet. This fix will also work for towns, right?

Do you really think adding "1 2147483679 2 144115188075856039 1" to member_separate line is necessary? I mean, what would happen if we ask them to leave in a castle? Would they disappear forever?


* Actually, they don't seem to use that dialog anymore, instead they use this line "My_offer_to_rejoin_you_still_stands,_if_you'll_have_me". In fact, I've discovered a really funny bug which you can use to clone the garrisoned companions. If you accept the above offer to rejoin (in a castle), the game adds them to your party but will not remove the one in the castle, so you'll have one more of each of them.  :smile:



 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
They still use that dialog - thats the one where you ask them to leave. And it does work for towns the same as castles.

If you ask them to leave in the castle, seemingly nothing happens - but it probably sets things in the background that might screw something up later - Personally, I'd rather be safe than sorry.

If you're getting cloned companions, it must be some other change you've done to dialogs to make them use the other dialog. I never get that dialog with the changes I've made.
 

Lord Kinlar

Master Knight
TheMageLord said:
They still use that dialog - thats the one where you ask them to leave. And it does work for towns the same as castles.

If you ask them to leave in the castle, seemingly nothing happens - but it probably sets things in the background that might screw something up later - Personally, I'd rather be safe than sorry.

If you're getting cloned companions, it must be some other change you've done to dialogs to make them use the other dialog. I never get that dialog with the changes I've made.

I did change a few things in scripts.txt and one of them was your fix to disable npc interactions. Maybe that's the reason.
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
I just did a test by turning off npc interactions with a new game, and no matter what I did I couldn't get the other dialog and the cloning npcs thing, stationed in the castle or not.

It must be some dialog editing or something else you've done, mostly likely dialog editing.

 

Lord Kinlar

Master Knight
Nope, the only thing I've changed in conversation.txt was your fix for village quests. I haven't touched dialog_states.txt. There's one more thing though, I've modified the "unmovable in party window" tag for heroes.

 

Btw, you've said that the 33 3 144115188075855885 360287970189639844 360287970189639860 line determines the range of troops. 60287970189639844 360287970189639860 range is for heroes, 360287970189639689 360287970189639805 range is for regular troops. How do you know which is which, is there documentation explaining this? I've added a few custom troops at the end of troops.txt and neither of these ranges include those and they keep saying "surrender or die" when I talk to them.

Ps. I'm using 1.003 btw.

I've checked it again in all three versions. In 0.960 they (companions) say "surrender or die", however in 1.x they say "My offer to rejoin you stil  stands". I haven't modified anything in 1.0 (press copy version) except troops.txt and item_kinds1.txt. So I don't think that's a dialog issue, but as I've said before, I changed the "unmovable in party window" flag to be able to garrison them.
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
360287970189639844 references the first hero, Borcha. 360287970189639860 references the trp_kingdom_heroes_including_player_begin (the one after the last hero). Its all in numerical order though, in the order that they appear in troops.txt. I didn't know this off hand, I took the range from another dialog dealing with heroes. If you add troops to the list before the heroes, or after the heroes, it will throw the numbers off - you'll get ALL kinds of errors, every single script that deals with ranges will be thrown off. Adding them to the end of the file like you did shouldn't cause a problem, though.

I looked up that dialog and the only thing that makes it trigger is if the history of the party history for the troop is set as indeterminate - that happens if you lose him somehow and then meet up with him later. This gets set at that and doesn't get re-set until you make him leave, so garrisoning him and then talking will cause the problem. However, for me it still does not cause the problem - and heres why:

Where your problem comes in at is where you put my new dialog entry. If you put it above that other line that you're getting, it would trigger first and thus yours wouldn't be displayed - you apparently didn't put it where I did, and thus the other line triggers first. Move the new dialog entry to where I put it on my post and everything should work fine.
 

Lord Kinlar

Master Knight
TheMageLord said:
360287970189639844 references the first hero, Borcha. 360287970189639860 references the trp_kingdom_heroes_including_player_begin (the one after the last hero). Its all in numerical order though, in the order that they appear in troops.txt. I didn't know this off hand, I took the range from another dialog dealing with heroes. If you add troops to the list before the heroes, or after the heroes, it will throw the numbers off - you'll get ALL kinds of errors, every single script that deals with ranges will be thrown off. Adding them to the end of the file like you did shouldn't cause a problem, though.

Well, since my custom troops (the ones I've added at the end of troops.txt) are out of the regular troops range so the dialog "how goes the watch, soldier" isn't shown instead I get the "surrender or die" dialog. And it looks like you can't define two different ranges in a single line, one for the regular troops and the other for the custom ones.

TheMageLord said:
I looked up that dialog and the only thing that makes it trigger is if the history of the party history for the troop is set as indeterminate - that happens if you lose him somehow and then meet up with him later. This gets set at that and doesn't get re-set until you make him leave, so garrisoning him and then talking will cause the problem. However, for me it still does not cause the problem - and heres why:

Yes, I hired and released all of the companions once at the beginning of the game to be able to find where they are later in the game by asking travelers. So this causes the dialog difference?

TheMageLord said:
Where your problem comes in at is where you put my new dialog entry. If you put it above that other line that you're getting, it would trigger first and thus yours wouldn't be displayed - you apparently didn't put it where I did, and thus the other line triggers first. Move the new dialog entry to where I put it on my post and everything should work fine.

As I said, I haven't tried your dialog fix yet.

PS. Thanks for your help, btw.  :wink:
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
Ah, if you haven't tried the fix then that's why you're getting that. It is above the surrender or die dialog, and thus triggers first.

Them leaving and coming back sets up the dialog to appear, and it doesn't differentiate between them being left in a tavern and left in the castle - in the native game it doesn't need to. It is a bit sloppy to leave the variable set like that, but if they leave you in a normal fashion (ie, any way other than being garrisoned) the variable gets set again to what it's supposed to be anyway. It's your change to let them be garrisoned that causes it to be an issue.

See, the way dialog works is it goes down the list, from the top, until it reaches a dialog that can trigger. If two dialogs can both trigger, whichever one is higher on the list will be the one that displays.

If you put in my dialog at the appropriate spot, it will correct that (since a dialog higher in the list will trigger first), and everything should work fine.
 

Lord Kinlar

Master Knight
Well, we call it a bug/problem, though for some, it's probably a nice feature. Having a clone that is, which doubles the number of companions. :mrgreen:

I'd like to ask you one last thing

dlga_start:member_talk 4095 0 4 33 3 144115188075855885 360287970189639844 360287970189639860 31 2 144115188075856039 1 520 3 1224979098644774912 144115188075855885 130 2320 2 5 1224979098644774912 Yes,_{s5}?  71  0

You've explained the blue numbers, thanks again, and I can work out what the green ones are for, but what are the red ones for? You have any idea?

It seems to me that since the triggering conditions are different, using
dlga_member_chat:member_talk 4095 13
, instead of
dlga_start:member_talk 4095 0
wouldn't make much difference, would it? Is there a particular reason to use dlga_start?
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
Heres another little quick tweak: Number of mercenaries that spawn in towns.

Open up scripts.txt and find:
update_mercenary_units_of_towns -1
6 6 3 1224979098644774912 648518346341351443 648518346341351461 2136 3 1224979098644774913 360287970189639706 360287970189639713 501 3 1224979098644774912 90 1224979098644774913 2136 3 1224979098644774914 3 8 501 3 1224979098644774912 91 1224979098644774914 3 0
The 3 8 is the range of the amount set whenever the script triggers. You can change it to whatever you like. It recalculates the mercenaries every time, not add to them, so you can't get multiple types in the same town.

The type of mercenaries being added are the numbers in blue, it's a range between 360287970189639706 (watchman) and 360287970189639713 (mercenaries_end). The actual range is between the first number and the second number minus 1 (so it never actually puts mercenaries_end in as a mercenary, it's just a placeholder for where mercenaries end at). Adding in mercenaries without the module system would prove difficult though, since adding troops to the troops.txt list would change all point of reference and screw up the game. You could edit it to include troops close to the list easily, though - by reducing the first number in the range by 2 it would reference farmers and townsmen (so it'd be 360287970189639704 360287970189639713) This is your best bet other than editing the current mercenaries to suit what you wanted. It would not, however, count them as mercenaries in the wage checks until they leveled up to Watchmen - but that's not really a big deal since they are cheap anyway.

and Lord Kinlar - I'll just explain it all :grin:

The first red number is who can trigger the dialog and who is speaking - 4095 is anyone with the npc talking (so it comes up top), and 69631 is anyone with the player talking (so it's a dialog option for you). That blue 0 is the dialog state (start). The green 4 is the number of lines of code to follow. The blue code is what I mentioned earlier (checking if one of the heroes then checking if they're in a castle). The red lines of code are first getting the honorific for the troop, and then storing that honorific as string 5, or {s5}. Thats how you get the "Yes, boss?" and "Yes, sir?" type things, differing between the companions. The 71 is the number for the dialog state that follows this one (member_talk). And that last 0 is the number for how many lines of code come after the fact - after you click through the text if its them saying it, or after you chose that option if its you. It's 0 here because nothing happens after the text comes up. All the dialog entries follow this structure.

It's MUCH easier to read in the module system, though - I have been using the .960 system to "translate" what things do exactly, which is very similar to the 1.003 (not quite, though - you have to pay attention to the text files to spot the differences). Once the 1.003 module system comes out, the editing of text files is no longer necessary - you can just edit the module system .py files and then compile the text files from them. Editing via the text files is kind of akin to reading machine code instead of a scripting language (although not quite so ridiculous).
 
Top Bottom