Author Topic: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)  (Read 14330 times)

0 Members and 1 Guest are viewing this topic.

NUQAR'S Kentucky "Nuqar" James XXL

  • BioAfrikaner
  • Duke
  • *
  • 🖕IF YOUR EASILY OFFENDED...GROW SOME BALLS...!!🖕
    • Twitter - yaqobhyndes
    • View Profile
    • Artwork Gallery
  • Faction: Khergit

Here's a set of codes that should make the morale system in Warband work better and run a lot faster. Soldiers take into account the number of enemies of the battlefield and the number of their own dead, so it's possible for a small army to rout a larger one if the casualty ratios are large enough (to an extent).

(click to show/hide)

Module Scripts

(click to show/hide)

module_mission_templates.py

(click to show/hide)

module_constants.py

(click to show/hide)
« Last Edit: February 10, 2017, 09:41:43 AM by jacobhinds »

phlpp

  • Knight
  • *
  • Gekokujo Dev
    • Steam - marty4286
    • YouTube - marty4286
    • View Profile
    • Gekokujo Mod Page
  • Faction: Bandit
  • WBWF&S
Re: [OSP][Code] Overhauled Morale and Routing
« Reply #1 on: December 14, 2014, 01:02:37 AM »
I'll try that out for Gekokujo 3.1. I'm trying to improve the crappy battlefield AI i slapped together, and this could top my fixes off

cwr

  • so how did that fuckin go then?
  • Count
  • *
    • Steam - cwr1
    • YouTube - UC-L6PNU39-gVmlS_1Wkr0ng
    • View Profile
  • Faction: Vaegir
  • M&BWB
Re: [OSP][Code] Overhauled Morale and Routing
« Reply #2 on: December 16, 2014, 03:16:32 AM »
Cool! Thanks for this, I will see if it can be put into the next version of Perisno.

NUQAR'S Kentucky "Nuqar" James XXL

  • BioAfrikaner
  • Duke
  • *
  • 🖕IF YOUR EASILY OFFENDED...GROW SOME BALLS...!!🖕
    • Twitter - yaqobhyndes
    • View Profile
    • Artwork Gallery
  • Faction: Khergit
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #3 on: December 16, 2014, 10:28:29 PM »
I've updated the code. There's a mission template, a mission template edit, and a script.

One allows routing troops to recover morale (sudden morale shocks aren't as likely to cause instant victory), while the other two allow the player to claim victory if all all the remaining enemy agents are routing.

Damian97

  • Squire
  • *
    • View Profile
  • Faction: Nord
Re: [OSP][Code] Overhauled Morale and Routing
« Reply #4 on: December 17, 2014, 01:59:54 AM »
 :) Very good. I may combine this with some AI scripts I've been writing.

fladin

  • Baron
  • *
    • Steam - infomatec
    • YouTube - UCJd5LBSuJabHUmwxD1eQe2w
    • View Profile
    • said.ovh
  • Faction: Neutral
  • MP nick: infomatec
  • WBNWVC
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #5 on: December 17, 2014, 05:48:46 PM »
Nice :) that  will make  battles more "alive"
Thanks

DerGreif

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
  • WBVC
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #6 on: December 17, 2014, 06:11:12 PM »
Very nice! An excellent overhaul! Thank you for sharing!
   

Lionheart2

  • Veteran
  • *
  • Would rather be a pikeman than a knight
    • Skype - BBSpecs2
    • View Profile
  • Faction: Rhodok
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #7 on: December 17, 2014, 10:40:45 PM »
Getting an error after pasting the new code (Today's update)






NUQAR'S Kentucky "Nuqar" James XXL

  • BioAfrikaner
  • Duke
  • *
  • 🖕IF YOUR EASILY OFFENDED...GROW SOME BALLS...!!🖕
    • Twitter - yaqobhyndes
    • View Profile
    • Artwork Gallery
  • Faction: Khergit
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #8 on: December 17, 2014, 10:42:47 PM »
You must've missed a comma somewhere. Check the line before the one mentioned.

Lionheart2

  • Veteran
  • *
  • Would rather be a pikeman than a knight
    • Skype - BBSpecs2
    • View Profile
  • Faction: Rhodok
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #9 on: December 18, 2014, 06:44:38 PM »
Fixed it. The new code is bugged. Should look like this:

  (
  3, 0, 0, [],
    [
        (try_for_agents, ":agent"),
            (agent_is_alive, ":agent"),
            (agent_is_human, ":agent"),
            (agent_get_slot, ":routing", ":agent", slot_agent_is_running_away),
            (eq, ":routing", 1),
            (agent_get_slot, ":courage", ":agent", slot_agent_courage_score),
            (val_add, ":courage", 100),
            (agent_set_slot, ":agent", slot_agent_courage_score, ":courage"),
        (try_end),
   ]),

NUQAR'S Kentucky "Nuqar" James XXL

  • BioAfrikaner
  • Duke
  • *
  • 🖕IF YOUR EASILY OFFENDED...GROW SOME BALLS...!!🖕
    • Twitter - yaqobhyndes
    • View Profile
    • Artwork Gallery
  • Faction: Khergit
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #10 on: December 18, 2014, 06:48:20 PM »
Ah, sorry about that. I use that script in a lot more mission templates and define them at the beginning, which explains the missing comma.

Lionheart2

  • Veteran
  • *
  • Would rather be a pikeman than a knight
    • Skype - BBSpecs2
    • View Profile
  • Faction: Rhodok
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #11 on: December 18, 2014, 07:41:01 PM »
Yeah I suspected that. It is a little confusing that different syntax is needed at different places in the file

Lord of Shadows

  • Sergeant Knight
  • *
  • You cannot fight the shadow.
    • View Profile
  • Faction: Neutral
  • MP nick: Shadow
  • WBNWVCWF&SM&B
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #12 on: January 05, 2015, 11:49:05 AM »
Is this savegame compatible?

NUQAR'S Kentucky "Nuqar" James XXL

  • BioAfrikaner
  • Duke
  • *
  • 🖕IF YOUR EASILY OFFENDED...GROW SOME BALLS...!!🖕
    • Twitter - yaqobhyndes
    • View Profile
    • Artwork Gallery
  • Faction: Khergit
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #13 on: January 05, 2015, 12:26:01 PM »
Probably, but I'm not an expert on how saves handle new global variables being thrust on them.

Lord of Shadows

  • Sergeant Knight
  • *
  • You cannot fight the shadow.
    • View Profile
  • Faction: Neutral
  • MP nick: Shadow
  • WBNWVCWF&SM&B
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #14 on: January 05, 2015, 01:41:34 PM »
Ok, thank you.