Author Topic: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)  (Read 14282 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
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #30 on: January 30, 2016, 11:27:14 PM »
The script in the OP is outdated. A few posts above is the new code. It should be working.

Giggityninja

  • Sergeant
  • *
    • View Profile
  • Faction: Swadian
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #31 on: January 31, 2016, 12:03:34 AM »
The script in the OP is outdated. A few posts above is the new code. It should be working.
Wow, very fast response! After an attempt to install the new version, it seems like routing doesn't even happen.
Is this how I'm supposed to add the triggers into lead_charge?

      jacobhinds_battle_ratio_init,
      jacobhinds_battle_ratio_spawn_bonus,
      jacobhinds_battle_ratio_calculate,

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 #32 on: January 31, 2016, 12:19:36 AM »
They go in the "consequences" segment of the mission template. Mission templates follow this general structur:

("lead_charge", mtf_whatever|mtf_somegarbage, other garbage,
"Your men charge the enemy"
[
(1, Spawn point info),
(34, Spawn point info),
(35, Spawn point info),
],
[
Consequences
] + trigger_triggers

Look particularly at the placement of the square brackets since those are what delineate the different segments of the mission template.

Giggityninja

  • Sergeant
  • *
    • View Profile
  • Faction: Swadian
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #33 on: January 31, 2016, 03:13:56 AM »
They go in the "consequences" segment of the mission template. Mission templates follow this general structur:

("lead_charge", mtf_whatever|mtf_somegarbage, other garbage,
"Your men charge the enemy"
[
(1, Spawn point info),
(34, Spawn point info),
(35, Spawn point info),
],
[
Consequences
] + trigger_triggers

Look particularly at the placement of the square brackets since those are what delineate the different segments of the mission template.
This is what I put, replacing the comma in the last bracket:

    ] + jacobhinds_battle_ratio_init,
  ),


  (
    "village_attack_bandits",mtf_battle_mode|mtf_synch_inventory,charge,

And I get this error:
TypeError: 'tuple' object is not callable
« Last Edit: January 31, 2016, 03:38:41 AM by Giggityninja »

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 #34 on: January 31, 2016, 07:33:13 AM »
That's not here you puy it. It goes before that square bracket in the bit I marked "consequeces".

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 #35 on: January 31, 2016, 08:07:31 AM »
This is where you put it:

Code: [Select]
      common_battle_order_panel,
      common_battle_order_panel_tick,
#Battle Morale Begin
      jacobhinds_battle_ratio_init,
      jacobhinds_battle_ratio_spawn_bonus,
      jacobhinds_battle_ratio_calculate,
#Battle Morale 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 #36 on: January 31, 2016, 08:35:11 AM »
Yep.

BrandonM

  • Regular
  • *
    • View Profile
  • Faction: Neutral
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #37 on: February 04, 2016, 05:00:04 PM »
Not sure if this will prevent it from working right - but trying to add this to silverstag I ran into a few issues:

1> (call_script, "script_agent_remove_from_square", ":cur_agent"), #jacobhinds infantry square script - I had to comment out references to these because I don't think Silverstag uses your infantry formations - these lines are in both the Native and FormAI versions you posted.

2> # (try_begin),
         #  (call_script, "script_dplmc_store_troop_is_female", ":troop_id"), #shout "retreat" if male
         #  (neq, reg0, 1),
           #(agent_play_sound, ":cur_agent", "snd_man_retreat"), #uncomment if you want retreating voices
       # (try_end),

Again - I didn't find this script: dplmc_store_troop_is_female anywhere in the Silverstag source.  It looks like you're just using it to make a shout so I'm hoping the rest of your script will work without that.

Just to make sure it wasn't just me :) I also checked the untouched original Module System files to see if either of those functions exists and they don't.  I'm guessing the formation one comes from your musket square script - and the second from some diplomacy scripts(?)


Thanks,
Brandon

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 #38 on: February 04, 2016, 05:25:51 PM »
Yep, those two scripts are completely optional. I'm pretty sure I removed them from the post after Produno told me they weren't compatible with his scripts, but I'll give it another look.

HarryPham123

  • Knight
  • *
    • View Profile
  • Faction: Swadian
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #39 on: May 14, 2016, 08:38:32 AM »
i have a problem in a new version that i have a invalid syntax error this invalid syntax is jacobhinds_battle_ratio_init = (

#jacobhinds Morale Code BEGIN


jacobhinds_battle_ratio_init = (
#proportionalises battle ratio by adding ABS of ratio to both sides when they spawn
   0, 0, ti_once, [],
   [
      (call_script, "script_cf_calculate_battle_ratio"),
   ]),
                 

jacobhinds_battle_ratio_spawn_bonus = (
#proportionalises battle ratio by adding ABS of ratio to both sides when they spawn
   ti_on_agent_spawn, 0.1, 0, [],
   [
      (store_trigger_param_1, ":agent"),

      (agent_get_slot, ":courage", ":agent", slot_agent_courage_score),
      (try_begin),
         (ge, "$battle_ratio", 0),
         (val_add, ":courage", "$battle_ratio"),
      (else_try),
         (val_sub, ":courage", "$battle_ratio"),
      (try_end),
      (agent_set_slot, ":agent", slot_agent_courage_score, ":courage"),
   ]),
                 

jacobhinds_battle_ratio_calculate = (
   10, 0, 0, [],
   [
      (call_script, "script_cf_calculate_battle_ratio"),
   ]),
           
#jacobhinds Morale Code END

HarryPham123

  • Knight
  • *
    • View Profile
  • Faction: Swadian
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #40 on: May 14, 2016, 01:45:46 PM »
i have a problem in a new version ...

don't double post @HarryPham123, that is kind of against the rules you know  :mrgreen:

https://forums.taleworlds.com/index.php/topic,350526.msg8404195.html#msg8404195

Q&A thread is your friend. Post the entire thingy, as you probably copied it to the wrong place/way

wait it seem like your misunderstanding buddy my question is the invalid syntax not the topic that i have done  :)

TheDragonknight

  • Veteran
  • *
    • View Profile
  • Faction: Swadian
  • WBVC
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #41 on: May 15, 2016, 12:32:18 AM »
Perfect this is exactly what I needed!

Mispronounced

  • Sergeant
  • *
  • Behold! The capybara!
    • Skype - Battlefiend1021
    • Twitter - XilencePls
    • View Profile
  • Faction: Bandit
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #42 on: August 08, 2016, 07:57:38 PM »
Nice! I'll attempt to add it into my mod :)
*cool signature*

Check out my mod: The Fallen Republic
- It's basic, but something I decided to do :)

Godarcher

  • Sergeant at Arms
  • *
  • How far will you go For Rome?
    • View Profile
    • Moddb site
  • Faction: Khergit
  • MP nick: Godarcher
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #43 on: November 24, 2016, 01:49:24 PM »
The new version is MUCH better than native thx for the cool code
in exchange a funny addition:
what this does that is tells you the enemy or you troops are routing in a tactical way it does this only one time but for both teams

behing (agent_start_running_away, ":cur_agent"),

implent it as following
(click to show/hide)

then in module mission templates
(click to show/hide)

i maybe will later add a sreenshot
« Last Edit: November 24, 2016, 01:55:58 PM by builder of the gods »
How far will you go For Rome?color]

produno

  • Master Knight
  • *
  • AWoIaF Developer
    • Twitter - @TheRealProduno
    • YouTube - Produno
    • YouTube - UC3bE9brC2akVBYo5-HT0U-Q
    • View Profile
    • Official A World of Ice and Fire Webpage
  • Faction: Neutral
  • M&BWBWF&SNW
Re: [OSP][Code] Overhauled Morale and Routing (Also Reduces Stuttering)
« Reply #44 on: November 26, 2016, 10:31:41 AM »

typo?


Code: [Select]
common_check_message_time = ( #checks if messages are allowed to display
   ti_before_mission_start, 0, 0, [],
   [
(assign, "$g_message", 0),
(assign, "$g_message1", 0),
   ]))