Up2date Guide to make New companion recruitable?

Users who are viewing this thread

spiritwind

Squire
Is there any guides on how to make a companion recruitable using the py files?  That includes Dialog, scipts, etc? 
If not is there someone willing to teach?
 
spiritwind said:
Is there any guides on how to make a companion recruitable using the py files?  That includes Dialog, scipts, etc? 
If not is there someone willing to teach?

Hey mate,

Are you trying to add more companions and want to know how to do this?  If you can confirm that this is your goal I can write up a quick guide for you.

Best,

Saxondragon
 
I know how to add new people into the game, I just don't know the system well to get them recruitable. 
For instance I know all the blabla bla with troops.py, basic dialog system, and hardly no scripting.  I'll send you what I got right now in a PM
 
spiritwind said:
I know how to add new people into the game, I just don't know the system well to get them recruitable. 
For instance I know all the blabla bla with troops.py, basic dialog system, and hardly no scripting.  I'll send you what I got right now in a PM

I am going to post in public for other folks to reference what I sent you in the PM.  I am sure that there are others who would like this question answered.  ~S

-------------------------------------------------------------
So, it sounds like you want to use the existing dialogue and npc system that is in place to recruit a new character.. effectively increasing the amount of npc's from 16 to some higher number.  Since we have not corresponded before, I do not have a sense of how well you know the module system or how to code, so I apologize if my explanation is basic.

This is what you need to do:

Step 1: Organization and overview of files we will be touching.
The files we will be modifying are:
module_troops.py
module_scripts.py
module_strings.py
module_dialogues.py (reference only)

and as with almost every coding venture you will reference:
header_operations.py
module_constants.py


Module_troops.py
You need to create a new character, and place him at a specific location in the module_troops.py file.  As we reference the module_constants.py file we see these line that dictate where our companions should be located in our troops file.

companions_begin = "trp_npc1"
companions_end = "trp_kingdom_heroes_including_player_begin"


modlule_scripts.py
Search for the routine "initialize_npcs", which is towards the end of this file line 17150 or so depending on other custom  scripts.  This script is the heart of the system you are trying to modify.  There are 16 groups of declarations that change key variables that are connected to specific troops.  You will want to copy one block and paste it at the end of this routine.

Code:
        (troop_set_slot, "trp_npc16", slot_troop_morality_type, tmt_aristocratic), #klethi
        (troop_set_slot, "trp_npc16", slot_troop_morality_value, 4),
        (troop_set_slot, "trp_npc16", slot_troop_2ary_morality_type, tmt_humanitarian),
        (troop_set_slot, "trp_npc16", slot_troop_2ary_morality_value, -1),
        (troop_set_slot, "trp_npc16", slot_troop_personalityclash_object, "trp_npc15"), #klethi
        (troop_set_slot, "trp_npc16", slot_troop_personalityclash2_object, "trp_npc1"), #klethi - borcha
        (troop_set_slot, "trp_npc16", slot_troop_personalitymatch_object, "trp_npc7"),  #deshavi - klethi
        (troop_set_slot, "trp_npc16", slot_troop_home, "p_village_20"), #Uslum
        (troop_set_slot, "trp_npc16", slot_troop_payment_request, 200),

You will need to modify this section in several areas to get the desired effect.  The first location is where it says "trp_npc_16" should read "trp_<handle of your new character>.  To keep things simple you may want to keep the handle of "Vic" to be npc_17 to continue with the naming conventions.  (If you do not know what the handle is then ask).

The morality types (there are two) indicate what issues the character will respond to based upon game events...ie what makes him/her upset.  Then there are two personality clashes and one personality match.  These will have to be addressed in the next section as well as the "home speech" which will kick off when that location is sighted.  The last part is how much gold the character desires for being hired.

module_strings.py
This is where you write in and create the conversation that you want to have with the npc, what he/she says etc. search for "#NPC strings"

This section starts with blocks of 16 conversation strings.  You merely need to append each block with a new line so it can be read.  From here it should be evident what to do, and make sure that you cover all the dialogue for every npc you have.

I hope that you find this useful...

Best regards and good luck,

Saxondragon
 
I'm sorry for necroing this but has anyone found out more details about the morality, the morality value, the 2ary morality and the 2ary morality value? I'm designing some companions for SOD Warlords but I wont be happy if I can't define their personallities to my liking.
 
Code:
mt_aristocratic = 1
tmt_egalitarian = 2
tmt_humanitarian = 3
tmt_honest = 4
tmt_pious = 5
You can define as many morality types as you like as long as they have unique integer values. Morality values define how strongly they feel about objectable actions (their grievance will increase by this value * 2) called via (call_script, "script_objectionable_action", tmt_value, "str_reason"),
 
Back
Top Bottom