Author Topic: A couple of very specific companion NPC creation related questions.  (Read 1532 times)

0 Members and 1 Guest are viewing this topic.

Hatonastick

  • Guest
Firstly I've searched on here, through the source (as best I could -- need to get something better than Windows search) and the web.

In the file 'module_scripts.py' you get blocks of code that define an NPC companions morality, personality etc.  For the most part it seems to be used with the NPC dialog entries in 'module_strings.py' to generate what NPCs say and when.  Anyway here goes.

I can't for the life of me work out exactly what each morality type in 'slot_troop_morality_type' (which can be tmt_aristocratic, tmt_egalitarian, tmt_humanitarian, tmt_honest, or tmt_pious) does, what 'slot_troop_morality_value' (I'm guessing maybe a start morality value) is used for, and why there's also a secondary lot of morality settings (for only some of the NPCs) in 'slot_troop_2ary_morality_type' and 'slot_troop_2ary_morality_value'.

With regards to the morality settings I suspect they are used in various places to determine a companion NPCs response in certain situations eg. you attack a town and decide to ransack it.  I'm probably way off, but I suspect the value is kept track of and when it reaches zero or something, that's when the NPC kicks up a stink and leaves your party.  Maybe.  I realise I could just cut and paste blindly, but as I'm designing a series of companion NPCs in a way to fit them into the game properly, I'm wanting to decipher that entire block entry made up of 'troop_set_slot' commands used for each NPC in 'module_scripts.py'.

Come to think of it I'm not entirely sure what 'slot_troop_town_with_contacts' and 'slot_lord_reputation_type' do either (although I can guess with the latter that it has something to do with their personality type when made a fief or something).

Everything else has been a piece of cake.  Sort of.  :D

Edit: They seem to tie in with calls to a script called 'script_objectionable_action', which is called in various places in different situations.  eg. (call_script, "script_objectionable_action", tmt_egalitarian, "str_men_unpaid"), or (call_script, "script_objectionable_action", tmt_egalitarian, "str_men_hungry"), or (call_script, "script_objectionable_action", tmt_honest, "str_fail_quest").  However I'm yet to find where this script actually is.  :|

Edit: Anyway after installing a half decent file search tool and trying again I got the following.

(click to show/hide)

Which covers: tmt_aristocratic, tmt_egalitarian, tmt_humanitarian, tmt_honest.  However tmt_pious obviously isn't used.

Oh dear.  The script that covers all this is _RIGHT UNDERNEATH_ the blocks that define NPC companion behaviour.  Whoops...  I forgot that the actual script name would be 'objectionable_action', minus the 'script_'.  Anyway attempting to decipher that (my background is mostly languages like C, Python is new to me) I think I have a vague understanding as to how it works.  I'm still not sure whether a higher morality value is good or bad.  Looks to me as if it adds or multiplies the value when bad things happen, rather than decreasing it.

The secondary morality type and value is simply (I now feel stupid for asking) to allow an NPC to have more than one type of morality check in place.

Amazingly all it took was for me to get off my backside and find a decent file search tool.  Using that I've worked out more in the last five minutes than the previous few hours.  :roll:

Edit:  Basically the morality types work thusly.

(click to show/hide)

The only real question I have left is whether or not a high morality value is good or bad.
« Last Edit: May 11, 2010, 03:17:25 PM by Hatonastick »

Dietre

  • Recruit
  • *
    • View Profile
  • Faction: Nord
depends on what your refereing to as good or bad?

high morality for humanitarian would mean like yamir will get royaly pissed and leave if you steal from a village, or whatever rolf is will leave if u have to retreat ect

I like it to be low so its only a minor piss off to them if i do bad things, lol

Depending on if your trying to keep hero's around longer u'd adjust those values or take em out completely

MadVader

  • Grandmaster Knight
  • *
  • Prophesy of Pendor 3.61 released - it's yummy
    • View Profile
    • Prophesy of Pendor
  • Faction: Neutral
  • M&BWB
Yes, low slot_troop_morality_value is good for your nerves. You can even set it to -1 to get praised for being a jerk.
You would save yourself plenty of pain if you download and use Notepad++.

Dietre

  • Recruit
  • *
    • View Profile
  • Faction: Nord
Love the ID picture Madvader LOL
And yes notepad ++ is a must!!

Also the disable companion disputes functions isnt working with new patch i am finding, so if you dont want hero's dislikeing other hero's take one of them and make them all hate that one hero. just make like 2 new heros to replace the native one OR if you like the native hero's, make a new hero called "But Head" and make all native heros hate npc17 lol

Little trick....
then as vader said, -1 on morality and your heros are happy as can be unless you can get that script to work again.

Hatonastick

  • Guest
Ok thanks guys, it's now sorted.  Mostly. :)

I use a combination of FileSeek (as of yersterday) and PSPad -- so far it suits the way I do things just fine.  I've used Notepad++ before, but it's not really my sort of editor.

Does anyone know what these do specifically?  ie. slot_troop_kingsupport_argument,  slot_troop_kingsupport_opponent, slot_troop_town_with_contacts, slot_troop_original_faction and slot_lord_reputation_type.  I know what the various options for each is, but not totally sure what they actually do.  I suspect slot_troops_kingsupport_opponent is a hero/companion NPC that they are unhappy about you selecting as a fief, and I think slot_lord_reputation_type may determine what sort of Lord they are if you promote them (whether it has any real impact in the game or is just related to a description I have no idea).

If not I'll keep digging.  Just asking to try and save some time.  This has already taken waaaay too much time to figure out.  :|

Edit:  Just realised I made some pretty wrong guesses with the above.  I don't know what slot_troops_kingsupport_opponent actually does but it doesn't appear to have anything to do with the npcX_kingsupport_objection (where X is NPC number) dialogs, which is what I originally thought.  All I know is the obvious and that is it's all to do with the new 'player can be a ruler' system I guess.
« Last Edit: May 12, 2010, 04:58:25 AM by Hatonastick »