Author Topic: [OSP][Code] Custom Player Kingdom Vassal Titles (Open Source)  (Read 27428 times)

0 Members and 1 Guest are viewing this topic.

Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
[OSP][Code] Custom Player Kingdom Vassal Titles (Open Source)
« on: December 07, 2010, 08:31:55 PM »
Lord/Lady is a fairly bland title of nobility for a player running the "Czardom of the Glorious Revolution" or some such. This bit of code will add an option to the Camp Action menu much akin to the Rename Kingdom option. Within this, the player can set a title for their male nobility as well as for their female vassals. The change in the character's name and their party (if they lead one) will be instantaneous, however notes referring to the lord will not be updated until there is reason to update them (to prevent cheating by re-titling characters).

Similarly, defecting Lords should receive the appropriate, custom title of nobility when they arrive at the player's hall.

Without further ado, the code:

(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)

Since there isn't a way to edit the strings stored in strings.txt or quick_strings.txt, I use the troop name and plural name for one of the "fake" troops -- "trp_quick_battle_troops_end" "trp_heroes_end" -- that is used by the engine as a looping device rather than an actual agent-template. I haven't seen any ill effects for editing its names this way, nor for using two slots assigned to it. (One must use a troop that is flagged as a hero tf_hero for this, or the change in names is not stored in the savegame.)
« Last Edit: June 09, 2018, 11:55:59 PM by BNS Marko »



FrisianDude

  • Coitus non Awesome
  • Archduke
  • *
  • Zis is Tshörman tärritorie!
    • View Profile
  • Faction: Neutral
  • MP nick: Liudulf Ward/Léodwulf
  • M&BWB
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #1 on: December 08, 2010, 02:13:26 PM »
Caba, I'm becoming more and more convinced that you're a bit of a saint. This sounds lovely and very useful, and so the village raid OSP you posted as well, and all your other previous WB, SP, Codes! :D
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!

Paradoxis

  • Knight
  • *
  • Warband noobie
    • View Profile
  • Faction: Swadian
  • WBWF&S
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #2 on: January 31, 2011, 02:56:44 AM »
I have never tried to alter the codings although i do want to put this custom titles into my game. Is there an idiot-proof, step-by-step guide to doing this?

What you just presented is unable to be deciphered by my comprehension level.

(e.g. where do i find module_presentation?)
Needing a cool sig since 2011.

Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #3 on: January 31, 2011, 03:17:13 AM »
You find the various module_*.py files in the Module System, or the source code. You can download Warband's Native Module System from the Taleworlds website, or use the source code from another mod, such as Diplomacy. You'll want to take a look at Getting Started to get the ModSys set up with Python installed (to turn these .py files into the .txts that the game reads) etc.

Once that is taken care of, each of those spoilers above is in reference to a specific module_*.py file. Open the file up and follow the given instructions in the spoiler. So for the presentation, just scroll to the very bottom of the module_presentations.py file and copy-paste the above before the last character, which is a ] closed bracket.

For game_menus, you want to search for:  ("camp_action"  and then find the code that looks similar to what is in the spoiler here, but references changing the kingdom's name. Paste the code from the spoiler all before the ("action_rename_kingdom" 

For scripts, search for "troop_set_title_according_to_faction" and then copy-paste what is in the spoiler on top of everything contained there, replacing it.

For the dialogs, search for the code in the spoiler, find that spot, and then copy-paste that one line into the correct position.



Paradoxis

  • Knight
  • *
  • Warband noobie
    • View Profile
  • Faction: Swadian
  • WBWF&S
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #4 on: January 31, 2011, 09:02:17 AM »
That's great :D

Thank you for the patience to teach this newbie.
Needing a cool sig since 2011.

Marcolino

  • Knight
  • *
  • Fortitudinem et honorem
    • View Profile
  • Faction: Neutral
  • MP nick: Marcolino
  • M&BWB
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #5 on: March 22, 2011, 01:32:23 AM »
Hi. I added this script to my mod and it is working - thanks! :D
But I have a simple question. How do I add a title to my character? I wanted him to be "King", "Kaiser", whatever, when I decide to create my own kingdom. Is there a script for that?

Thanks
Ego nunquam mendacio, sed sanguinarius et indomitus sum

Fortes fortuna adiuvat

"Quod melius est in vita? Ut conteret inimicos tuos, educ tecum, et audiunt lamenta feminarum suarum"

Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #6 on: March 22, 2011, 01:34:33 AM »
But I have a simple question. How do I add a title to my character? I wanted him to be "King", "Kaiser", whatever, when I decide to create my own kingdom. Is there a script for that?
Easiest way to do that is just go into your Character page and click in your name. You are free to edit it at any time ;)



Marcolino

  • Knight
  • *
  • Fortitudinem et honorem
    • View Profile
  • Faction: Neutral
  • MP nick: Marcolino
  • M&BWB
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #7 on: March 22, 2011, 01:42:14 AM »
Thanks - This is what I have been using.

However, I just wanted to know if that was a way to mod that as well (more elegant solution)?

Thanks
Ego nunquam mendacio, sed sanguinarius et indomitus sum

Fortes fortuna adiuvat

"Quod melius est in vita? Ut conteret inimicos tuos, educ tecum, et audiunt lamenta feminarum suarum"

Hatonastick

  • Guest
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #8 on: March 22, 2011, 03:24:59 AM »
Hahaha!  Brilliant mate!  I think I'm going to give this coding thing away and just throw a bunch of your scripts into my mod and call it a day. :)

del

  • Master Knight
  • *
    • View Profile
    • warsword
  • Faction: Sarranid
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #9 on: March 22, 2011, 12:21:07 PM »
On something the same as this Caba`drin one of the biggest problems mount and blade has is if you add a new race or body type in module skins and header_troops the game considers them all to be female and calls them so in the mod ?

Is their any chance you could do a code in which you can set the tf_ troop header to be male or female so the game considers them to be as such ?

Love the work you have done for mount and blade warbands Caba`drin and you are definately one of the best coders of mount and blade on the forums   8-)

Marcolino

  • Knight
  • *
  • Fortitudinem et honorem
    • View Profile
  • Faction: Neutral
  • MP nick: Marcolino
  • M&BWB
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #10 on: March 27, 2011, 10:09:18 PM »
This is a pretty good script. Now I checked around and found the "Expanded Nobility Title System kit (v0.33)" by jrider. His script include automating the player's character titles in case he/she becomes a vassal to one of the existing kings or if he/she decides to become a king/queen in his/hers own right
Ego nunquam mendacio, sed sanguinarius et indomitus sum

Fortes fortuna adiuvat

"Quod melius est in vita? Ut conteret inimicos tuos, educ tecum, et audiunt lamenta feminarum suarum"

Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #11 on: April 20, 2011, 09:49:58 PM »
Code fixed above. I overlooked the fact that non tf_hero troops do not have name changes stored in savegames, so the troop I use to store strings in has been changed to trp_heroes_end. Now changes in titles will actually be persistent with saving/loading the game.

Also added a "revert to default titles" button in the presentation.



13exa

  • Knight at Arms
  • *
  • B23A, RoB, and MC Modder
    • View Profile
  • Faction: Nord
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #12 on: May 04, 2011, 02:46:33 PM »
Are you make other [WB, SP, Code] now?? You are very great Coder Caba' drin
(click to show/hide)
(click to show/hide)

13exa

  • Knight at Arms
  • *
  • B23A, RoB, and MC Modder
    • View Profile
  • Faction: Nord
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #13 on: May 07, 2011, 11:12:42 AM »
(click to show/hide)
Im sorry, When i add this to dialog and replace "member_fief_grant_3", it was getting error.
(click to show/hide)
(click to show/hide)

Lumos

  • Probably Not a Help Desk
  • Moderator
  • *
  • Mens INsana in corpore sano
    • Steam - lumosx
    • YouTube - LumosX
    • View Profile
  • Faction: Nord
  • WBWF&SNWM&BVC
Re: [WB, SP, Code] Custom Player Kingdom Vassal Titles (Open Source)
« Reply #14 on: May 07, 2011, 11:25:25 AM »
Your comments must begin with #s, not //s. If you really have comments beginning with //, fix them.