Author Topic: Have a question about Modding? Ask Here!  (Read 163473 times)

0 Members and 1 Guest are viewing this topic.

Offline Ivkolya

  • Sergeant Major
  • *
  • Posts: 295
    • View Profile
  • Nick: Ivkolya
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1755 on: December 18, 2018, 03:09:42 pm »
UPD. I've finally found a solution, but if there are another, simplier thoughts - I'll be grateful :)

How to disable bots spawning as cavalry units on certain maps of team deathmatch mode?

Hello all, in siege mode in NW there is working restriction for bots spawning as cavalry, at least in defending team, but I didn't find script for that. Maybe someone can point me where it is? I think it can be a start for disabling AI cavalry in other modes

Also I've noticed that on my new scene attacking team has no horses (but all bots are of the same unit), and defending team has cavalry, which is strange

I created new topic, but maybe here someone will see and help me (and, I guess, help many other modders), so sorry for double-posting.

I made many attempts to find a solution. I was advised to look into this module_mission_templates code,

Spoiler
Code
      (call_script, "script_multiplayer_find_bot_troop_and_group_for_spawn", ":selected_team", ":look_only_actives"),
      (assign, ":selected_troop", reg0),
      (assign, ":selected_group", reg1),

      (team_get_faction, ":team_faction", ":selected_team"),
      (assign, ":num_ai_troops", 0),
      (try_for_range, ":cur_ai_troop", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
        (store_troop_faction, ":ai_troop_faction", ":cur_ai_troop"),
        (eq, ":ai_troop_faction", ":team_faction"),
        (val_add, ":num_ai_troops", 1),
      (try_end),
[close]

As I think, disable cavalry for certain scenes could be made by adding list of scenes as condition and excluding cavalry units from available for spawning after oriiginal line

Code
	   (try_for_range, ":cur_ai_troop", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),

First of all I tried to add lines like (neg|troop_is_guarantee_horse, ":cur_ai_troop") or (neg|troop_select_type_cavalry, ":cur_ai_troop") and couple of other variants, but they didn't work, bots were dead in list of players.

In the end I changed module_constants (added infantry of all factions) after multiplayer_ai_troops_end (as this variable is referenced in original script)

Spoiler
Code
multiplayer_ai_troops_begin = "trp_british_infantry_ai"
multiplayer_ai_troops_end = multiplayer_troops_begin

multiplayer_ai_british_infantry_begin = "trp_british_infantry_ai"
multiplayer_ai_british_infantry_end = "trp_british_hussar_ai"

multiplayer_ai_french_infantry_begin = "trp_french_infantry_ai"
multiplayer_ai_french_infantry_end = "trp_french_hussar_ai"

multiplayer_ai_prussian_infantry_begin = "trp_prussian_infantry_ai"
multiplayer_ai_prussian_infantry_end = "trp_prussian_dragoon_ai"

multiplayer_ai_russian_infantry_begin = "trp_russian_foot_guard_ai"
multiplayer_ai_russian_infantry_end = "trp_russian_hussar_ai"

multiplayer_ai_austrian_infantry_begin = "trp_austrian_infantry_ai"
multiplayer_ai_austrian_infantry_end = "trp_austrian_hussar_ai"

multiplayer_ai_rhine_infantry_begin = "trp_rhine_infantry_bavaria_ai"
multiplayer_ai_rhine_infantry_end = "trp_rhine_mounted_jaeger_ai"
[close]

So my code looks like this now

Code
      (call_script, "script_multiplayer_find_bot_troop_and_group_for_spawn", ":selected_team", ":look_only_actives"),
      (assign, ":selected_troop", reg0),
      (assign, ":selected_group", reg1),

      (team_get_faction, ":team_faction", ":selected_team"),
      (assign, ":num_ai_troops", 0),
  (store_current_scene, ":cur_scene"),
      (try_begin),
   (eq, ":cur_scene", "scn_assault_on_malakoff_test"),
   (eq, "$g_multiplayer_game_type", multiplayer_game_type_team_deathmatch),
           (try_for_range, ":cur_ai_troop", multiplayer_ai_british_infantry_begin, multiplayer_ai_british_infantry_end),
           (try_for_range, ":cur_ai_troop", multiplayer_ai_french_infantry_begin, multiplayer_ai_french_infantry_end),
           (try_for_range, ":cur_ai_troop", multiplayer_ai_russian_infantry_begin, multiplayer_ai_russian_infantry_end),
           (try_for_range, ":cur_ai_troop", multiplayer_ai_prussian_infantry_begin, multiplayer_ai_prussian_infantry_end),
           (try_for_range, ":cur_ai_troop", multiplayer_ai_austrian_infantry_begin, multiplayer_ai_austrian_infantry_end),
           (try_for_range, ":cur_ai_troop", multiplayer_ai_rhine_infantry_begin, multiplayer_ai_rhine_infantry_end),
     (store_troop_faction, ":ai_troop_faction", ":cur_ai_troop"),
             (eq, ":ai_troop_faction", ":team_faction"),
             (val_add, ":num_ai_troops", 1),
  (try_end),
 
      (else_try),
   (try_for_range, ":cur_ai_troop", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
             (store_troop_faction, ":ai_troop_faction", ":cur_ai_troop"),
             (eq, ":ai_troop_faction", ":team_faction"),
             (val_add, ":num_ai_troops", 1),
      (try_end),

But bots are dead when I start team deathmach with bots.
And maybe I wrote something wrong? Maybe overall it's the right way, but I just wrote something wrong?
I really hope someone will help me.

Sorry for doubleposting (I've posted this question in the Scripting thread and created new tyopic), but I've got no answer, so I hope someone here will see this question finally and help me with it. And I think such code for disabling cavalry bots on certain maps will be much needed OSP code for many modders who make mods with infantry maps.
« Last Edit: December 19, 2018, 01:44:56 pm by Ivkolya »

Offline Ivkolya

  • Sergeant Major
  • *
  • Posts: 295
    • View Profile
  • Nick: Ivkolya
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1756 on: December 26, 2018, 06:09:18 am »
Hello all, how to prevent AI musicians and colour bearers from randomizing their hair and beards? I created new faces in the face generator, added them to the list of faces in module_troops and assigned them to AI troops and troops. Infantry bots spawn with correct faces, but musicians and colour bearers (in the commander battle mode) spawn with random face textures, hairstyles and beards.

Offline Woeski The Husky

  • Second Lieutenant
  • *
  • Posts: 129
  • 1B | 2Ch
    • View Profile
    • 1e Brigade
  • Nick: Graaf_Gerard_Leman
  • Side: Union
Re: Have a question about Modding? Ask Here!
« Reply #1757 on: January 03, 2019, 03:15:47 pm »
How to change the reload animation?

I know this is a very simple question, but how do you change an animation to an other (already existing) animation?

Offline Ivkolya

  • Sergeant Major
  • *
  • Posts: 295
    • View Profile
  • Nick: Ivkolya
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1758 on: January 03, 2019, 10:17:09 pm »
Here's one of tutorials.

http://forums.taleworlds.com/index.php/topic,72992.msg1895426.html#msg1895426


Or you can just replace that old animation with new one (downloaded as OSP as example) in OpenBRF, just make sure length and name of new animation is the same as of the old one.

Offline Woeski The Husky

  • Second Lieutenant
  • *
  • Posts: 129
  • 1B | 2Ch
    • View Profile
    • 1e Brigade
  • Nick: Graaf_Gerard_Leman
  • Side: Union
Re: Have a question about Modding? Ask Here!
« Reply #1759 on: January 04, 2019, 12:08:41 pm »
Thanks for your answer.

Though

I they do play the animation now, but it's much shorter. Is there anyway to make the reload time less?

EDIT: fixed this.

Just wondering, how do I change the font colour?
« Last Edit: January 04, 2019, 07:30:43 pm by Woeski The Husky »

Offline habsburg

  • First Sergeant
  • *
  • Posts: 40
    • View Profile
  • Nick: kk_KR_Nr4_ViCpl_Habsburg
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1760 on: March 18, 2019, 04:34:46 pm »
Hello there

Im currently doing sum stuff with the austrian faction, and whenever I edit one of the units names (Both in Morghs and in Notepad) the game doesnt recognize troops.txt and crashes

Thats quite literally the only thing Im changing with the folder at the moment, any ideas whats happening? I used to be able to change names before, tho I havent tried it in a few months.
Maybe the Update made my computer retarded?

Any help would make me happy

Offline Grozni

  • Second Lieutenant
  • *
  • Posts: 264
    • View Profile
  • Nick: Grozni_BloodAndHonor
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1761 on: March 18, 2019, 05:05:55 pm »
Perhaps you are trying to edit the part which start with "trp_", that is a troop identifier so editing it would cause problems.

You can edit everything else. In the example below, French_Artillerist can be edited but is pointless for player troops as this would be the name of the bot troop. The visible part of this individual troop's name in menu is the third string Artillery_Train_Renamed

Code
trp_french_arty_nco French_Artillerist Artillery_Train_Renamed 0 133169152 0 0 18 0 0
  286 0 781 0 620 0 213 0 63 0 932 0 937 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0
  15 15 15 15 20
 80 5 30 5 30 5 30
2586 131072 0 49 204800 0
  34359738369 1315051091194281984 1835136 0 50465891015 7916447985573822463 2031036 0

trp_french_arty_officer French_Artillerist Officer_Renamed 0 133169152 0 0 18 0 0
  254 0 780 0 612 0 867 0 52 0 213 0 216 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0
  15 15 15 15 20
 80 5 30 5 30 5 30
2586 131072 0 49 204800 0
  34359738369 1315051091194281984 1835136 0 50465891015 7916447985573822463 2031036 0

Offline habsburg

  • First Sergeant
  • *
  • Posts: 40
    • View Profile
  • Nick: kk_KR_Nr4_ViCpl_Habsburg
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1762 on: March 18, 2019, 08:31:21 pm »
Nono I made sure Im editing the right part, the error message tells me something along the lines of "There was an unexpected end to troops.txt", especially weird considering a few months back I was still able to edit the names and stuff

I did a test aswell, I can run the mod with the troops.txt I have, so nothing wrong with the stuff Im starting out with. But as soon as I edit either the 2nd or 3rd part of any units name, the game dies.

Offline Grozni

  • Second Lieutenant
  • *
  • Posts: 264
    • View Profile
  • Nick: Grozni_BloodAndHonor
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1763 on: March 18, 2019, 08:46:36 pm »
The file gets messed up when you edit it for sure. Double-check if editing a clean, original troops.txt with just notepad gives you the same error. Uploading the corrupted troops.txt could help.

Offline habsburg

  • First Sergeant
  • *
  • Posts: 40
    • View Profile
  • Nick: kk_KR_Nr4_ViCpl_Habsburg
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1764 on: March 19, 2019, 10:34:02 am »
Alright, Someone helped me find the problem.

In the end it was Windows Notepad being stupid, I now use Notepad++ and it works

Offline Syncmaster667

  • Second Lieutenant
  • *
  • Posts: 104
  • 77y Captain Of Light Infantry
    • View Profile
    • 77y Regiment Website
  • Nick: 77y_Cpt_Syncmaster667
  • Side: Confederacy
Re: Have a question about Modding? Ask Here!
« Reply #1765 on: April 30, 2019, 07:23:09 pm »
Does anyone know how to change the font style in-game? I've tried replacing the font_data.xml and font.dds but shamefully results in no text at all :)

Offline BNS Marko

  • Second Lieutenant
  • *
  • Posts: 186
    • View Profile
    • Bear Force 2
  • Nick: BNS Marko
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1766 on: April 30, 2019, 08:02:46 pm »

Offline Syncmaster667

  • Second Lieutenant
  • *
  • Posts: 104
  • 77y Captain Of Light Infantry
    • View Profile
    • 77y Regiment Website
  • Nick: 77y_Cpt_Syncmaster667
  • Side: Confederacy

Offline Mexican

  • Lieutenant Colonel
  • *
  • Posts: 2788
  • perpetually injected with Imipolex G since 2013
    • View Profile
  • Nick: Meximemer
  • Side: Union
Re: Have a question about Modding? Ask Here!
« Reply #1768 on: May 22, 2019, 07:06:24 am »
where can i get autoblocks :)))))))))))
666x 1v1 Champion | 69x 5v5 Winner | 420x Regimental Champion | 1x Autistic Memer Award

Offline -Nick

  • Colonel
  • *
  • Posts: 10395
  • Baby Braves #1
    • View Profile
  • Nick: Chop House
  • Side: Confederacy
Re: Have a question about Modding? Ask Here!
« Reply #1769 on: May 23, 2019, 06:01:43 am »
where can i get autoblocks :)))))))))))
I got you chief

*snip*
« Last Edit: May 23, 2019, 05:09:20 pm by Von Bergen »