Pho II -- weekly blog with source* (or How to make your own fantasy mod)

Users who are viewing this thread

gsanders

Grandmaster Knight
The subject says it all.
  I decided all the sources I've seen either are missing too many features or have some fatal flaw in the old code, so it is time to start from the beginning and build a more robust code base.  I may as well show where each resource or topic is found, in as much as they tend to have notes useful for integration and other people's bug workarounds.  I expect updates each Friday and to not invest more than a few days a week, as I don't really have permission from boss or wife to make this my new unpaid career.
         
    https://drive.google.com/drive/folders/0B4sh7GRykLgERHN2SDRKQ1lJNVE?usp=sharing
 
day 1:
      It compiles under Wreck (compile.bat) and build_module.bat

      Diplomacy for Warband 1.172 + fixed Wife as a companion + Troop Tree Viewer + a second cheat menu layer for overflow

      tested working with the following complaints:
  as received,  village improvements don't show the actual cost of improvements nor estimate time correctly
                      the economy absolutely sucks, there is no trading potential at all
                      there is the option to skip the initial bandit
                      wife as a companion has many fixes now
                      some new cheats show inside the town and camp cheat menu and there is some better debug potential
                     
                      PBOD and all of modmerger aren't working yet.  It turns out each of the  module_something.py files needed several lines added to the end for modmerger to activate, and it isn't very obvious.  Until then, everything modmerged will Fail.

https://drive.google.com/drive/folders/0B4sh7GRykLgERHN2SDRKQ1lJNVE?usp=sharing

  At least it loads fast and takes up little room on disk (around 78 MB)

added some loadscreen fluff to remind anyone this isn't Native
 

  Every mod starts from Native,  UNLESS you want to add Diplomacy, in which case it might be fastest to start with Diplomacy (if you trust the integration).  This because Diplomacy is a huge merge. 

  https://forums.taleworlds.com/index.php/topic,324014.msg7647364.html#msg7647364      v4.3-ish for Warband 1.171
                                actually, Diplomacy 4.anything is sort of someone else claiming to have "improved" it.  It's really Diplomacy 3.3 with slight tweaks.  This version happens to have strong multiplayer support, which wouldn't make sense as multiplayer doesn't need diplomacy, but there it is.  Things to look out for in a true MP persistent world are player centric uses of registers which could be stale or overwritten, but since each client PC has its own registers in use I guess maybe it's all good.

  http://www.nexusmods.com/mbwarband/mods/6068/?tab=2&navtag=http%3A%2F%2Fwww.nexusmods.com%2Fmbwarband%2Fajax%2Fmodfiles%2F%3Fid%3D6068&pUp=1
      You'll want some sort of base for the above Diplomacy source to get the textures, maps, resources, sounds, and similar mod overhead, without necessarily staying married to whatever code that was used.  We'll change it as we go along, but the first compile needs enough to be able to run before you've started changing anything, to be sure you aren't injecting some problem into your compile before you even start modding...

      at least it has source, lists open bugs, and seems to have fixed the bugs from older Diplomacy.
      Notice this does NOT have an embedded PBOD, making it no longer dependent on WSE being installed.

  The first item of business is to merge this with the updated header files from Lav's updated Warband 1.66 and make sure to install W.R.E.C.K.  Wreck saves plenty of time debugging and compiling, and Lav's Header_Operations file gives badly needed help on syntax for every operation, to make sure you have not missed a parameter and know exactly what each parameter does.
Use WinMerge to compare each file as you merge, to see what is added, what is changed, and what is honestly expendable.

    http://forums.taleworlds.com/index.php/topic,324874.0.html    Lav's updated Warband 1.66
    http://forums.taleworlds.com/index.php/topic,325102.0.html    W.R.E.C.K.

  If you manage to compile safely and actually can run Diplomacy from above after your merge, you may as well check out
Wife as a Companion, which the above was trying to integrate in the Test version

  https://www.dropbox.com/sh/679r1y39lp1d4s9/AAD2MWmHZtmIYxX4Ubmw002Ea?dl=0  Test version Diplomacy
with (very few) wife as companion changes!?, will need editing from next:

    http://forums.taleworlds.com/index.php/topic,166791.msg4047210.html#msg4047210  Wife as a companion
      notice the large number of fixes added in the discussion that were absolutely missing when I downloaded it from NexusMods
This alone is a great reason to go back and look at where each OSP or change came from and read for further comments...

      Right about now is a great time to add some testing tools to reports menu, as well as some changes to camp menus.
You'll want to add modmerger framework as well for later, some troop tree viewers, and ideally something to dump raw
data about your troops for debugging.  Often it isn't obvious when your troops have too much junk, what their stats are, or anything else that matters later when you start changing combat.

    http://forums.taleworlds.com/index.php/topic,128890.0.html    Modmerger
    http://forums.taleworlds.com/index.php/topic,213497.0.html    Dynamic Troop Tree presentation by Dunde
        except you don't actually see these turn on until tonight's code release (in a few hours).

  and the simplest link to gather these:
    https://forums.taleworlds.com/index.php/topic,326973.0.html    Lav's "Warband Modders Depository"

 
So, how exactly do you get the first compile to work?
  Let's say you haven't changed even 1 line of a downloaded mod, such as the test version of Diplomacy I linked last post.
But it stops compiling after clicking on  "compile.bat" and gives an "invalid directory" or error on the "exporting" phase of WRECK.

  You need to edit module_info.py and look at the output directory
#export_dir = "C:/Program Files (x86)/Mount&Blade Warband/Modules/Diplomacy/"
  export_dir = "../"

  Win 10 certainly will try to block writing to anything under C:/Program Files (x86)  from a DOS command line as part of UAC
(User Access Control) settings from Windows control panel: Users

  So instead make a directory like    C:\MountBlade    (I use C: only because that is my SSD - my fastest yet smallest disk drive). It could be anywhere EXCEPT a system directory as above.  Now I can compile without Win 10 getting in my face.  What I can't do is compile and instantly run my test, but you'll probably have 100 failed compiles for every time you honestly need to fire up Warband and test your latest rev mod... 

  When WRECK thinks it managed to compile without any red showing, you're ready to copy the resulting .txt files over your mod (just like a patch -- in fact, this is how EVERY patch gets made...) and you can now fire up Warband to test it.  Copying .txt files as part of a BATCH file to your Warband mod always fails in Win 10 because User Access Control in Windows thinks it is saving you from a "suspicious" activity that might "compromise" your operating system.  But the same operation happening as a cut and paste from Windows explorer, driven by your conscious mouse clicks, can proceed (with Windows asking "are you sure?" like you're an idiot and probably demanding to see your credentials as an administrator level user).  Badges?  I don't need no stinkin' badges!

  Other issues... you have to have Python 2.7 installed, not 3.anything
  You edit python files with either notepad++ or python's "Idle", which conveniently color codes different parts of each line
to help you find missing commas and other syntax errors.
  Otherwise, I'll assume you are dangerous, I mean competent, with Windows and have read some sort of Modding Warband already.  Maybe the second is a stretch, so I'll jump in from time to time to explain what happened.
----
 
  in merging Lav's 1.66 Warband with Diplomacy for v1.171 Warband, you'll immediately notice (eventually, you might notice)
the following files need merging INTO the Diplomacy source:
    header_common
    header_item_identifiers
    header_items
    header_skills
    header_triggers
    header_troops

  and besides copying over in its entirety header_operations, you need to edit header operations to add some scene manipulation operations (and operations to set clouds).

  This lets you re-compile diplomacy to use all of Lav's tweaks and to make sure the base still compiles like you hoped it would.
The save game you just made for Diplomacy is now already trashed; all the items are stored "incorrectly" and skills unpack differently.  Not to worry, you'll get used to discarding savegames constantly as you tweak and add.
----
fixed fail to compile normally.  The Diplomacy source incorrectly includes import from compile.py in module_items and module_troops.
 
week 2:
  added 10 new skin (race-gender) definitions and models, from Elven Path and The Last Days (TLD)
  added some items to allow some new troops using the models
      some of these items aren't functional yet, such as magic items.  They're really placeholders.
  edited module.ini to load the models so that no errors are seen compiling or while loading the mod
    have NOT assigned troops.  Races each load correctly.  Added a game_menu choice of race/gender

  edited module_dialogs to adjust Native's assumed gender 0 == Male and 1+ is always Female, since gender and race are really the same thing.  If you add some made up race, like "fairy", since it gets a troop flag value higher than female it normally gets all female dialogs, until you edit both module_scripts.py to test differently and change hundreds if not really thousands of lines in module_dialogs.py to use newer tests and then reorder the dialogs accordingly (else they are backwards anyway at the test).

  testing shows these are working.  So far only Ransom Broker greets player with not human race incorrectly
  all other NPCs tested greet correctly. 

    put the amended base up, it's now 482 MB unpacked
  - GS
 
week 3 begins:

  Now that races with gender/type > 1 are in game and can make a player char with these,
a)
it is time to exercise all the dialogs and make sure each NPC addresses the player correctly - sir or madame, etc
b)
  Also now is a good time to build unit troops.py definitions (and party_templates.py changes) for new factions
c)
  If going to make > the default (6+player) factions you should make a map of your slot assignments.

  Once factions grow above 6 factions it is safest to build a list of how much space is actually used implicitly for faction-faction relations, AND relations between each hero (lord or companion), in order to correctly number the next unused slot.  Failure to do so ALWAYS results in savegame corruption around mid game. The best and only map I've seen was in Silverstag where it was a real eye opener how many implicit slots were used as factions grew, or the number of lords grows, or the number of companions grows, etc.

d) Magic etc needs to wait for this map of slots used, so that any new variables referencing in-memory slots have numbers that are not impacting hero relations (which grows as you add more lords, kings, companions etc).  You'll probably get to edit all your modmerged add-ins (such as PBOD) once you make a map of slot assignments to avoid any hard assignments in modmerged files from conflicting also. 

e) The magic so far isn't really working smoothly.  It would be best to prune this down to a simple area explosion, a shotgun type attack, a simple (single) added attack, and perhaps a sample procedure such as charm_person.  The summonings are garbage at the moment.  The area effect needs edit to not catch yourself in the explosion.  The entire style is not perfected; ideally a mana bar limits ammunition rather than having an endless supply of ammo. This is more a quick and dirty placeholder than something final.

f) items and mounts appropriate to the factions you are building have not been put in, and will doubtless want more resources and textures.  For that matter, the elven path resources and textures in now could probably be cut in half, as there were quite a few environment files for making custom scenes that aren't really used yet.
Scenes, such as new towns, new castles, polished landscapes, and for example better looking armor sets are all possible from here.  The idea was to have a base that compiled smoothly and allowed some flexible testing.  I'm writing this on exactly day 10 of the project, so having this much working well isn't a bad milestone.

  - GS

 
something I noticed that you should be aware of is this:
 
  I earlier made maps of slot assignments for Native and Warsword Conquest / Perisno / etc based on templates lifted from Silverstag.  However, that template actually underestimates the impact of increasing number of factions  and especially number of lords.  I was wondering how ladies (who are still kingdom_heroes) impacted the slot assignments, and how non-kingdom factions still tracked relations with kingdoms.  The answer is simpler than expected, and oh so depressing:

  at module_factions.py:
(go down to the end on diplomacy and take a peak at these lines:

Code:
##diplomacy start+ Define these for convenience
dplmc_factions_begin = 1 #As mentioned in the notes above, this is hardcoded and shouldn't be altered.   Deliberately excludes "no faction".
dplmc_non_generic_factions_begin = [x[0] for x in enumerate(factions) if x[1][0] == "merchants"][0] + 1
dplmc_factions_end   = len(factions)
##diplomacy end+

# GS notice this implies there are 32+1 not 6+1 factions in Native for calculation of faction-faction relations !!!
#  (dplmc_factions_end) - (dplmc_factions_begin) = 33

now look at  module_troops.py:
  find  "kingdom_heroes_including_player_begin"    and skip down to "heroes_end", and you'll see that

Code:
## GS ("heroes_end") - ("kingdom_heroes_including_player_begin") ==
##  16 companions + 6 lords + 6 pretenders + 6 (kingdoms * 20 lords) + 6 (kingdoms * 20 ladies)
##  = 268 heroes + 1 (end marker)

  this means the calculations in THIS slot assignment map are off, which leads to eventual late game corruption:
https://drive.google.com/open?id=0B4sh7GRykLgET3M5dW5DQkRVcXM

  I've underestimated the number of slots to reserve in both cases for troops and factions.
  This is pretty tragic for huge mods like Perisno.

here's the fixed slots map, at least showing where the mistakes in prior calculations would cause corruption:
  https://drive.google.com/open?id=0B4sh7GRykLgEZ0l4YlR0WEp6Z1U
 
This is the most epic Topic on this Side cant wait to see how it continues  :mrgreen:

I believe you wanted to add Magic into the Game as well, I was thinking of a blue bar like the red health bar that slowly regenerates in battle to cast spells. But I have no Idea what can be done in the engine of the game, there are still some phyton files i have not fully gone throught so will go step by step as you post updates.

Thank you for that Modding guide.  :party: 

 
I'll get an article published next week.  I ran out of time working on a [famous mod], which kept me busy the last 3 days.
It did help highlight some weaknesses with the code I put up here on Tuesday.

  Specifically:
    module_strings  which only about 5500 lines, needs around 1500 hand corrections for gender! Wow.
                            I've done about 35% of them so far.

    module_scripts    has more places than I wish to see where the previous author decided it was too slow to use his
                            own gender testing scripts!  (or maybe subsequent authors did this). Anyway you'd need to find
                            every instance of the  get_troop_type  operand and replace it with one of these
Code:
   script_dplmc_store_troop_is_female_reg
   script_dplmc_store_troop_is_female     implicit reg0 returned
   script_cf_dplmc_troop_is_female
   $character_gender 
   script_dplmc_store_troop_is_female
   script_dplmc_print_subordinate_says_sir_madame_to_s0
  each of those has different syntax so you really SHOULD search for them in module_scripts to see what parameters
they get and what registers return the gender  (0 == male, 1 == female).
  If you go find "gender_fix", you'll see the real operation happening that decides what each race/gender is,
and its the only place that needs touching as you add or remove new races from module_skins.py
  Small shout_out  to Michadr of Perisno for the original implementation of that, even if he under-estimated just
what a pain it is to actually fix all the dialogs for multi race (3000+ hand edits!  You've got to be joking!!)

  I've added Lav's Companion overseer, in part because I used it to mark the new from Diplomacy script and game_menus changes in other mods so I the main mod authors can compartmentalize Diplomacy from their existing tailored edits.  Diplomacy is SO large that winmerge gives up in aligning the two files, so I need to put some landmark that can be found every 3000 or so lines.  It looks like winmerge has about a 3200 line buffer to find matches; after that it breaks and you're better off cutting and pasting by hand.  Once in awhile it corrupts files as well so save often; the corruption happens less if you don't have a deep list of changes that could be undone.

  I lost perhaps a half day today by not stopping to check my merges.  At the end suddenly a big file I was working on completely barfs when compiling -- but it won't tell me what line it hates.  I'm just told that now every compare of $cheat_mode with a number is illegal, suggesting somewhere along the line it was fed a character like "o" instead of "0".  Something like that.  Somewhere in the last 20,000 lines...  Thanks for that.

    I'll put some slightly revised code up this weekend Monday late afternoon.  It will be marked "week 3", to helpfully remind me of how little it changed from "week 2".  (Except I did hammer through 35% of file module_strings.py)   
  If you're motivated, you could compare week 3 and week 2 and see what I did to make ALL the companion strings multi-race ready.  It took freaking hours, about 2200 lines done of 5500.  That was part of my yesterday.  I'll hammer those changes out Monday Tuesday afternoon.!

  The [famous mod] is something I really enjoyed, so I'm happy to kibbutz.  I'll get back to Warsword Conquest soon enough. In my absence Nameless Warrior cooked up all sorts of stuff, all of which I'm not at liberty to discuss. 
Probably, one mod or the next should knock your socks off, and as always, I pretty much get to watch...

  - GS
 
Week 3 is up
  direct link to current source & compiled (patch) output:
    https://drive.google.com/file/d/0B4sh7GRykLgENnZFTmd1ekoxNkU/view?usp=sharing

Lav's companion overseer is installed
a map of the data is correctly edited for this week's build (as an Excel file)
all of module_strings.py is correctly edited for multi-race gender correct strings (about 3000 lines more than week 2)
some small fixes at scripts and dialogs for overlooked multi-race gender strings from last week
module_simple_triggers.py got trigger numbers in comments for faster future debugging use
small fixes otherwise

  PBOD and formations constants have NOT been edited from default values as supplied by downloads
      these should be edited to match the slot values given in the excel file to avoid colliding with other variables DONE, and updated Excel file "Slots_PhoII.xls".  Recompiled and re-zipped for fast patch.

  Magic is from a 10+ year old mod and is not very stable.  It's here as a temporary place holder until a better
system replaces it, in my infinite spare time.  What really matters is to watch how to make a single target attack by script call, an area effect grenade type attack, a shotgun type attack, and a misc. attack; the idea is to make your own attacks not to just cut and paste something you find.  For now it "sort-of" works but its not good enough for a real mod.

  The whole point of this "3 weeks" stub of a mod was to have enough races defined to be able todrive testing of diplomacy in a multi-race mod environment, without having to lift some other mod's proprietary code to do so.  Everything here is from OSPs that everyone (including You) are welcome to use. 

    As a proof of concept, this exact code drove a merge of Diplomacy (and darn near everything else you see here except skins, items, troops and the resource and texture folders of the "base" PhoII mod) over the unreleased (and at that time unable to successfully compile) Phantasy Calradia for Warband v1.171.  In FIVE (5) man days (the mythical 40 hour workweek!).  I'm writing this on day 7 of that merge, by way of explaining how come it took me so long to post week 3.  Yes, 3 weeks from deciding to start over, but a week of that was at another mod.  The two weeks head start is a HALF MONTH of labor you don't need to burn yourself.  Time is money, they say...

  I was able to replace half of the one mod with files from this one, building a scaffold of sorts, in order to test the suspicious files from the other mod in isolation.  But first, I needed to merge  module_common.py from from this set and from his set, which needed a data model map built to decide where all of his new variables should go in order to not collide with anything.  I used the generic dialogs and game_menus from here, dropped in generic mission_templates since the other mission_templates wouldn't even compile, and next merged scripts, then dialogs, then game_menus in that order, and thence meshes, scene_props, sounds, skins, triggers, simple_triggers, and kept all the header files from here except needing to edit header_troops to account for the different skins.

  You'd think that should do it, but then came trying to get it to compile with his old header files, which always failed.  It turns out header_triggers declares variable "keys", and it is needed by the troop viewer that was added in here.

  Five days to merge all this stuff is not bad.  But when something stopped working, having the source for the generic version in one folder and the source for the original target mod in another folder and then making a hybrid of the two in a THIRD folder gets the job done.  You'll probably want to stop and try to compile every few hours, and make a backup of whatever you're doing every few hours, in case you wish you didn't overwrite something and now its gone...

  The rest of the month my calendar is busy, but when I resume we'll start customizing what is here to make a more natural feel for diplomacy - with racial prejudices.  We'll examine PBOD and formations in better detail.  And I think we'll make a simple abstract magic that works for everyone EXCEPT the player, so we can keep it nice and simple but get away from these terrible (and buggy) magic items.  That would be a good time to use the modmerger item properties OSP as well.

  - GS

 
 
week 4 target: Racial Prejudice, and a few (troops, items, factions,  and parties) edits.

  By now we have some working Diplomacy code, and some races that the player could try on for dialogs testing.
But to put those races to work we either make a bunch of new factions (and then have to populate them with new lords, ladies, towns, villages, castles, troop definitions, maybe adjust the armors, drag models from other OSP mods and declare the new resource .brf files at module.ini and copy them to resources folder, then fire up Brfedit, point it to your mod's directory, select the .brf you just declared in module.ini, find each and every texture (.dds) file that resource (.brf) file uses and copy THOSe into textures folder, and then try starting your mod and hanging on each file you forgot to copy over... OR

  Or decide its really a lot of work and be satisfied that, hey, there's a few leftover armors and items already in place from week 2, and we should just scrounge from those.  Yeah, that saves a few hours.  We could also assign the races to existing factions and troops, saving us a few more days, except once villages, castles, and towns belong to non-human races you'll want to change all their walkers, village elders, heroes (kings, lords, ladies), mayor, arena master, 3 kinds of sellers, and troops for THAT faction to use the new race.    This means you'll first want to decide what villages belong to what faction, so you know that say village "Nameja", over in Swadia, is ALSO "village_13", which you get by comparing  module_parties.py with looking in game (in windowed mode so you can keep updating your list of villages / castles).  Now with that, you can edit module_troops.py and find "village_13_elder", who now gets edited to label him as no longer using the (default) human male skin (that is, value = 0 since it wasn't explicitly called out before). 

    This should blow a few days of your time...  After which you'll be ready to finally start making factions hate each other (reliably), in Diplomacy.  But first you need them to have something to dislike, mainly their own skin...
I suppose I'm stuck doing this, but I don't have time to bang it out today.  It burned a fair amount of time just gathering half of a list of what villages are owned by each faction.  Uggh!  But hey, that's modding, too.  Chasing every little detail until you need aspirin.  Then making some little change that you didn't find in an OSP, just in case you weren't sure if you can just cut and paste.  Cutting and pasting gets you mostly there.

Those last couple lines -- that's your signature.

  - GS

---
edit: Monday 14 August:
  finished mapping all the villages, castles so knew what factions each start as
  started converting troops to use non-human races.  It's really a lazy conversion, just changing the name and race
      khergit -> orc  sarranid  -> undead  rhodok -> drow  swadian -> elven      I'd have made  nord -> dwarf
        except then I'd be on the hook to fix all their outfits.

    these are needed to be able to see the effects of prejudice, when implemented.
 
Week 4 is looking fairly weak:
  So far, module_parties.py  had each starting town/village/castle marked with appropriate faction names.
Today the spacings for markups were squeezed a bit to better fit on my second monitor, which is taller than it is wide.

  module_troops.py now gets races adjusted for all the starting NPC merchants, seneschals, arena masters, mayors, and village elders.  Except as stated before I was too lazy to convert Nords into Dwarves, as I'd then have to edit their clothes to use something that didn't cover their heads and misalign with their arms.  You could, if you wish, do this as an exercise.

  Once this is done you're on the hook though for a different wrinkle: now every time some siege is lost or a lord defects you'll have the wrong faction's NPCs at each town/castle/village.  Notice the town/castle/village itself starts as "fac_neutral", and the actual faction isn't set until script_script_give_center_to_faction_aux, which also loops to attach villages to towns and castles on change of faction.  Thus this is the script to update
  towns get different {seneschal, arena_master, armorer, weaponsmith, tavernkeeper, merchant, horse_merchant,
      mayor, and master_craftsman}
  castles get {senechal}
  villages get {elder}

  It actually would have been more elegant to let your modified script "give_center_to_faction_aux" change town NPCs according to current faction/culture; writing them explicitly just helps remind you of what they should look like at day 0.  You could modmerge the differences from module_troops.py in week 3's code with week 4, and just leave out the explicit race declarations for the various town npc, castle seneschals, and village elders - but carry forward the twon and village walkers, and the spy walkers. 

  If you wanted to be fancy you might check the gender on the existing NPC you're about to overwrite with a new skin/gender so that the new choice is correct for clothing. Or not -- perhaps it appeals to your sense of humor to put orcs in dresses as human female merchants/barkeeps/etc change skins.  I've done it for you in the scripts for week 4.

You'll probably want to go and add some lines to module_troops.py to support different skins village_walkers and town_walkers.  If you have the "find the spy quest" and that spy is the only one that is human in a non-human town, that might also get embarrassing.  It depends how much time you feel like spending to make your mod consistent.
Lucky for you (and me) the place where village walkers are set, by culture, is fairly early in script game_start, around line 202.  You'll just need to define some new walkers using the right skin (and possibly a change of clothes) and point them here at the "# Cultures" tag in "game_start" inside module_scripts.py    The use of separate town and villagers
definitions in module_troops was so you could dress them differently.  For now they all have the same clothes as their human counterparts.

  Notice we haven't yet changed (in module_troops.py) ransom_brokers, tavern_travelers, tavern_booksellers, tavern_minstrels, trainers, or farmers.  If you do, you probably also have to hunt down each instance of those troop names in  module_scripts and module_dialogs to adjust the ranges to check according to whatever was just added, else those scripts/dialogs work correctly only for the original (human) ones and not for the race modified versions you added.  If for example you were asking a town traveler about minstrels, and you did zero effort at fixing up dialogs, then he or she will list all the (human) minstrels in game, but NOT any other minstrels you added.  You'd want to adjust the tavern visitors accordingly as well, including each that are placed by timer within simple_triggers. 

  We still haven't defined prejudice or made it useful yet; that's next post.
  Updated module_constants.py to add 2 skins values to factions slots; updated spreadsheet  Slots_Phoii.xls

  - GS
 
week 4, part2: Prejudice
 
  we want to adjust module_scripts.py in a few places:
    "start_game"    initialize prejudice
    "diplomacy_start_war_between_kingdoms"
    "diplomacy_start_peace_between_kingdoms"
    "randomly_start_war_peace_new"
    "npc_decision_checklist_peace_or_war"

you will see these scripts modified to include calls to prejudice scripts placed at the end of module_scripts.py
  these have a dependency on "list manager" OSP which is pasted just before the prejudice scripts.
    List manager in turn needs some troops added at module_troops.py to use as place holders

module_game_menus:
    reports are numbered and split across 2 pages to allow more debug output for watching number of parties,
      prejudice by skins, trade routes.  The intent is to provide room for modmerger to add reports later (remember
      menus can have no more than 16 (0..15) choices before they are truncated.

    mnu_recruit_volunteers  under mnu_village:
      adjusted for prejudice results; now you can scare away villagers when trying to hire into mixed parties
      fixed a recursive menu call in the diplomacy source (eek)

    numbered the menu options under village.
      notice there are 18 potential menu items, although some are rare.  moved cheat menu items after leave village
      in case leave village option gets truncated by special conditions showing too many menu items.
      added item 17 - "cheat - unloot village", which works by the way.

module_strings:  added names for skins to use in a menu "show_raw_prejudice" under mnu_reference_reports

fixed some warnings reported by Wreck in modules  meshes, troops, strings, sounds, items.
  now down to some blue messages about variables declared but not used -- and most if not all of these came from the diplomacy source used. !

  - GS

edit: all of the code discussed today is up at google drive, but I have not tested it yet.  It seems to compile cleanly.
      I won't have time to test before Sunday noonish, although I may get a quick session in Friday early evening.
    https://drive.google.com/drive/folders/0B4sh7GRykLgERHN2SDRKQ1lJNVE?usp=sharing

edit2: quick first look and the routines for setting race on the NPCs isn't working right, plus sometimes guesses wrong on gender.  I'll investigate what is happening later today, first have some urgent business at work to do.  corrected and working.  Full mod, source to this moment, uploaded in .7z and .zip formats
 
Open list of issues:
  Week 4 changes:
a)      new reports (cheat hidden reference reports):
        look at "Notes: Recent messages" in game to see output!

b) wizards and their items tend to self destruct right now.  This will be resolved in September with a NPC magic revamp
    similarly, there are plenty of items sold at merchants that don't do anything special, despite fancy names.  This changes "soon".

c) troop tree: missing textures for undead
      add the textures in the textures folder now uploaded to https://drive.google.com/drive/folders/0B4sh7GRykLgESm5rSjNCRS1rTE0?usp=sharing

d) script "faction_to_skin" is flawed.  Instead of comparing ":faction2" to integer numbers I should have compared to "fac_kingdom_1" instead of 1, etc.
    Thus it always gives human male skin as a result, making prejudice not really active as compiled.  Thankfully its a quick fix to correct.
  script "faction_to_skin2" also needs an adjustment, it should convert player culture to an expected npc faction instead of the nonsense it had for "week 4".


 
week 6:
a) "Eat, Drink, and be Merry":  re-organized items so that more dried foods are added and in preparation to add drinks as food items.
      Gave drinks morale benefits and adjusted morale from various foods.
      changes:  scripts    "initialize_item_info"  and "game_get_item_extra_text",    simple_trigger # 100, 
                      defines (in constants) trade_goods_begin , food_begin

      added at game_menus  mnu_camp  mnu_actions  support for smoking various meats to produce dried variants (that don't go rotten)

b) Simplified crafting:
    added support for Rigale crafting in a "simplified" fashion, for now just (dried fruit, raisins)
      (mainly, the idea is to take several of one input to make 1 output, plus leave hooks to add recipes later. 
      This allows one dried fruit slot to hold many fresh fruits...)

      Instead of starting crafting and setting global variables then waiting for simple_triggers to fire the check for crafting completed,
        right now the crafting completes exactly after waiting some time, but the player could cheat a bit by breaking the sleep (perhaps responding to an attack)
        and get the item immediately.  Its not an issue for making raisins but it would become an issue for making something like a complex suit of armor...

        There are no guilds or guild services (or learn-able crafting skills) implemented at this time; cooking skill is abstracted to "8" (low-middle of range)
          to avoid having to define troop slots for (new) player learn-able skills

        items changed to support all the crafting intermediates later, which implies adding some Textures and Resource folder contents for the new items.

status: NOT YET UPLOADED
  Wed evening status:  Enterprises broke sometime between week 2 and now so I want to explore this further tomorrow before release of this weeks changes.

  Thu AM: found it, at week 3:  two parts to the solution:
    a)PBOD had item slots settings conflicting with enterprise production, setting modmerger to not load PBOD avoids issue.
    b) constants  has two defines for  slot_town_trade_good_productions_begin

      uploaded corrected base for use with weeks 2 and 3; uploaded corrected source for week 3;
        changed constants for week 6 to fix clash with PBOD and added pbod_resources to module.ini for PBOD presentations
        uploaded base for week 6 - its not needed, but saves collecting loose resources, textures, module.ini and having to compile the source (it's ready to play)
          otherwise you could probably get all the changes with about 15 MB of selective downloading..

    the latest crafting changes for dried fruits and making raisins don't work yet.  That will need to be the next place I resume when I have time...
      probably I'll revert to Rigale crafting, and instead see if I can control the "stuck in town" issue now that Nunu found a fix last summer.

      meat smoking works.

    - GS

Friday AM: stripped away Rigale crafting and made an even simpler scheme for dried fruit and raisins, that works.
                Now it is simple enough to export to Phantasy Calradia (or Warsword Conquest)  :wink:
 
Fascinating programming blog! :mrgreen: I'm "looking through a glass darkly" at all this, my coding being old BASIC stuff and various calculator scripts. :oops:
Still, thanks so much!
 
Cant wait for the next update  :mrgreen:


Can I ask a Question about Supporting a Pretender in the Base game and if its possible to mod the mechanics to work differently?

Like I never used that option, so how does it work? Like I read you need to have like 200 points of Fame/Renown and start the Rebellion?

So once started can you back out like when you losing and continue it later or will you have to fight till the end? Does the Pretender join you as a companion or goes around as a independent Lord? I guess if the King loses he goes into Exile and the Pretender if he loses also?


I just keep wondering if its possible to like just support them without joining them? I read that once you agree to help them you lose the faction you created. Rather though it be nicer to like support them via troops and Money or give them one of the Castles as a Base. Just like if its a friendly Lord. But not sure if its possible to mod that way.

Also I was wondering if its possible to like Build a Bandit Camp kinda like the Bandits use to spawn raiding parties.  Then like building camps all over the place to harass Caravans would be a nice option.




 
LAST_ACTION_HERO said:
Cant wait for the next update  :mrgreen:

Can I ask a Question about Supporting a Pretender in the Base game and if its possible to mod the mechanics to work differently?

Like I never used that option, so how does it work? Like I read you need to have like 200 points of Fame/Renown and start the Rebellion?

So once started can you back out like when you losing and continue it later or will you have to fight till the end? Does the Pretender join you as a companion or goes around as a independent Lord? I guess if the King loses he goes into Exile and the Pretender if he loses also?

I just keep wondering if its possible to like just support them without joining them? I read that once you agree to help them you lose the faction you created. Rather though it be nicer to like support them via troops and Money or give them one of the Castles as a Base. Just like if its a friendly Lord. But not sure if its possible to mod that way.

Also I was wondering if its possible to like Build a Bandit Camp kinda like the Bandits use to spawn raiding parties.  Then like building camps all over the place to harass Caravans would be a nice option.
  As you might know, I'm knee deep trying to launch Phantasy 2017 (rebuilt Phantasy Calradia) right now.  The base for PhoII became Phantasy Calradia's base, and if Phantasy Calradia finishes (which I expect in the next 2 weeks or so) I'll take that base and put it in Warsword Conquest for their diplomacy layer.  The diplomacy mostly looked working but so far I have a report that the tutorial needs to be reworked/fixed.

  As for the pretenders, if you decide to support them the pretender is added to your party and you need to seize a castle, then survive the response by the nation that the pretender is a rebel to, and other factions might jump you as well if you seem weak.  It;s a fairly difficult matter; the lords won't join you unless you have a castle or town, or several; you need to start a rebellion when the main faction for that rebellion is very weak from wars and you should be able to defeat any of the lords one on one that you meet in the field, so by then you will have at least 200 renown if not 500-800ish.

  You can back out of a pretender's rebellion at any time, essentially burning your relation with the pretender.  You can also marry a female pretender.  Pretenders have very high stats and skills.

  Building bandit camps you'd have to add the OSP for that and it is notorious for having unreliable side effects.  No mod that I know of has stable player made bandit camps, although many claim to let you build camps.  Nova Aetas for example might do it well; but some complain that mod has issues.  I'm not sure.
In any case, I'll been at Phantasy Calradia mod since August 02 and it gets my daily attention right now. 
https://forums.taleworlds.com/index.php/board,333.0.html

- GS
 
Back
Top Bottom