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

0 Members and 1 Guest are viewing this topic.

Offline Kaasovic

  • Donator
  • *
  • Posts: 8718
  • * and Obelix
    • View Profile
  • Nick: Anonymous
  • Side: Confederacy
Re: Have a question about Modding? Ask Here!
« Reply #1725 on: August 20, 2018, 09:38:26 pm »
How is your script being called? And from where?
Developer of NordInvasion. Hi mum.

Offline Ivkolya

  • Sergeant Major
  • *
  • Posts: 333
    • View Profile
  • Nick: Ivkolya
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1726 on: August 20, 2018, 11:00:56 pm »
How is your script being called? And from where?

If I understood right, my script is called "cf_replace_weapon_while_anim_is_active" and I wrote it myself, based on other scripts in module_scripts.py (again, I learned how to script all by myself and this script can be dumb, but on building module there are no errors. Here it is again.

Code
  ("cf_replace_weapon_while_anim_is_active",
  [
    (store_script_param, ":agent_id", 1),

    (agent_is_active,":agent_id"),   
    (agent_get_animation,":cur_anim",":agent_id",1),                  #if current animation is:
    (this_or_next|eq,":cur_anim","anim_stand_staff"),                 # When player stands
    (this_or_next|eq,":cur_anim","anim_turn_right_staff"),           # When player turns right
    (this_or_next|eq,":cur_anim","anim_turn_left_staff"),             # When player turns left
    (this_or_next|eq,":cur_anim","anim_walk_forward_staff"),          # When player walks forward
                 (eq,":cur_anim","anim_walk_backward_staff"),          # When player walks backward

    (try_begin),
       (agent_get_wielded_item,":item_id",":agent_id",0),                      #if agent has item
       (this_or_next|is_between,":item_id","itm_french_mousquiton","itm_cannon_ball_dummy"),     #item is a carbine or
                    (is_between,":item_id","itm_french_charleville","itm_french_art_off_sword"),     #item is a musket
       (agent_equip_item,":item_id","itm_flag_france_45e"),                                          #give to the agent other item (flag for testing purposes)
    (try_end)   
  ]),
 

In theory, it must replace current weapon (if it is musket or carbine) to french flag, so I can distinctively see that weapon was indeed changed to something while one of selected animations is active, so later I can make the same mesh of musket with other coordinates.

Of course, the much better way is just rotate and move wielded weapon so it will be in needed position, but first of all in that case weapon must be attached to left hand to avoid bugs in animations, and it seems that flag "arf_stick_item_to_left_hand" doesn't work, and also I don't know how to specify in MBScript "move item/weapon", not just move something.

Offline Kaasovic

  • Donator
  • *
  • Posts: 8718
  • * and Obelix
    • View Profile
  • Nick: Anonymous
  • Side: Confederacy
Re: Have a question about Modding? Ask Here!
« Reply #1727 on: August 20, 2018, 11:24:04 pm »
How is your script being called? And from where?

If I understood right, my script is called "cf_replace_weapon_while_anim_is_active" and I wrote it myself, based on other scripts in module_scripts.py (again, I learned how to script all by myself and this script can be dumb, but on building module there are no errors. Here it is again.

Code
  ("cf_replace_weapon_while_anim_is_active",
  [
    (store_script_param, ":agent_id", 1),

    (agent_is_active,":agent_id"),   
    (agent_get_animation,":cur_anim",":agent_id",1),                  #if current animation is:
    (this_or_next|eq,":cur_anim","anim_stand_staff"),                 # When player stands
    (this_or_next|eq,":cur_anim","anim_turn_right_staff"),           # When player turns right
    (this_or_next|eq,":cur_anim","anim_turn_left_staff"),             # When player turns left
    (this_or_next|eq,":cur_anim","anim_walk_forward_staff"),          # When player walks forward
                 (eq,":cur_anim","anim_walk_backward_staff"),          # When player walks backward

    (try_begin),
       (agent_get_wielded_item,":item_id",":agent_id",0),                      #if agent has item
       (this_or_next|is_between,":item_id","itm_french_mousquiton","itm_cannon_ball_dummy"),     #item is a carbine or
                    (is_between,":item_id","itm_french_charleville","itm_french_art_off_sword"),     #item is a musket
       (agent_equip_item,":item_id","itm_flag_france_45e"),                                          #give to the agent other item (flag for testing purposes)
    (try_end)   
  ]),
 

In theory, it must replace current weapon (if it is musket or carbine) to french flag, so I can distinctively see that weapon was indeed changed to something while one of selected animations is active, so later I can make the same mesh of musket with other coordinates.

Of course, the much better way is just rotate and move wielded weapon so it will be in needed position, but first of all in that case weapon must be attached to left hand to avoid bugs in animations, and it seems that flag "arf_stick_item_to_left_hand" doesn't work, and also I don't know how to specify in MBScript "move item/weapon", not just move something.

What I ment was the call to the script.
Code
(call_script, <script_id>, [<script_param>...]),

For example you can create a new trigger that will call this script every frame:
Code
(0,0,0, [
    (multiplayer_is_server), #run only on the server
],[
    (try_for_agents, ":agent_id"),
        (agent_is_active, ":agent_id"),
        (agent_is_alive, ":agent_id"),
        (call_script, "script_cf_replace_weapon_while_anim_is_active", ":agent_id"),
    (try_end),
])

You'll have to place it in every multiplayer mission template to make it work on all game modes
Developer of NordInvasion. Hi mum.

Offline Ivkolya

  • Sergeant Major
  • *
  • Posts: 333
    • View Profile
  • Nick: Ivkolya
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1728 on: August 21, 2018, 11:36:18 am »
Ah, ok, thank you very much, I will try it :)

And again - why can't I make flag "arf_stick_item_to_left_hand" working? I think I made no mistakes when addingh it to animations, but it doesn't work at all. I guess it is restricted to reloading animations, or is it?
« Last Edit: August 21, 2018, 11:42:44 am by Ivkolya »

Offline Kaasovic

  • Donator
  • *
  • Posts: 8718
  • * and Obelix
    • View Profile
  • Nick: Anonymous
  • Side: Confederacy
Re: Have a question about Modding? Ask Here!
« Reply #1729 on: August 21, 2018, 11:45:50 am »
Ah, ok, thank you very much, I will try it :)

And again - why can't I make flag "arf_stick_item_to_left_hand" working? I think I made no mistakes when addingh it to animations, but it doesn't work at all. I guess it is restricted to reloading animations, or is it?

I don't know much about animation modding. Perhaps someone on the taleworlds forum can help you out; https://forums.taleworlds.com/index.php/topic,6575.0.html
Developer of NordInvasion. Hi mum.

Offline Ivkolya

  • Sergeant Major
  • *
  • Posts: 333
    • View Profile
  • Nick: Ivkolya
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1730 on: August 21, 2018, 12:44:18 pm »
Thanks! I've made a topic there, but no positive results yet :(

Offline Coldstreamer

  • First Lieutenant
  • *
  • Posts: 1661
  • Leader of 1er Suisse, Ski Instructor, Paintballer
    • View Profile
    • My Youtube Channel
  • Nick: J-Man11
  • Side: Union
Re: Have a question about Modding? Ask Here!
« Reply #1731 on: August 30, 2018, 10:36:04 pm »
So.. I made this:

Spoiler

[close]

But, I want to copy it to make another one for the Gardes Suisses I'm making, but I don't know how to give them a different plume.. so can someone help?

So.. I'm pretty much asking, is there a way to add another plume? There are a few when I open it in photoshop, but I don't want to have other units have the same plume as this regiment..
« Last Edit: August 30, 2018, 10:37:47 pm by Coldstreamer »

Offline Armis

  • Corporal
  • *
  • Posts: 22
    • View Profile
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1732 on: August 31, 2018, 06:39:06 am »
Hi so I have figured out how to add factions to Mount & Blade Napoleonic Wars and I am able to add an additional 4 without any problems.......(the kingdoms 6-10 in modules factions) but if I add any more factions then that then all of the ranks for all of the units in the game disappear however any new units i add still show up and function but I cannot go officer, eagle bearer, drummer etc and whenever I remove the one faction I instantly get all of the ranks back could someone with potential knowledge or ideas on what could be causing this please help me.

Offline Coldstreamer

  • First Lieutenant
  • *
  • Posts: 1661
  • Leader of 1er Suisse, Ski Instructor, Paintballer
    • View Profile
    • My Youtube Channel
  • Nick: J-Man11
  • Side: Union
Re: Have a question about Modding? Ask Here!
« Reply #1733 on: September 02, 2018, 04:07:26 am »
Well.... I have a bit of an issue, I accidentally deleted the badges for the caps for the french 84e, so how do I undo that?

Offline PelvicThrust

  • First Sergeant
  • *
  • Posts: 514
  • 32nd Regiment of Foot - Light Infantry
    • View Profile
  • Side: Union
Re: Have a question about Modding? Ask Here!
« Reply #1734 on: October 31, 2018, 08:46:43 pm »
Well.... I have a bit of an issue, I accidentally deleted the badges for the caps for the french 84e, so how do I undo that?

one fix for that is rename your current modded NW as anything, but not 'Napoleonic Wars'  un-install NW on steam and re-install it.

You should now have the original NW, and your modded version (called something else) just copy and paste the mesh from the original into the modded brf.

Offline PelvicThrust

  • First Sergeant
  • *
  • Posts: 514
  • 32nd Regiment of Foot - Light Infantry
    • View Profile
  • Side: Union
Re: Have a question about Modding? Ask Here
« Reply #1735 on: November 12, 2018, 06:50:52 pm »
Well I'm hopeful that someone will read this and be able to help me...

Hello! I'm making a skin pack for my reg, however I wish to change the hat for the officer class.

Problems being is the ensign uses the same officer hat in OpenBRF, so what I change to the officer hat will change the ensign (as they use the same shako). I believe I need to go on python and tell the Coldstream ensign to wear a different hat, what I'm asking is -

#1 Am I correct about the Python thing?
#2 if I use Python and tell the Coldstream ensign to wear for example the ranker shako instead of the officer shako, will I be able to play on multiplayer server or will the game have errors and kick me out?

I hope someone knows the answer to this! :)


Edit - there was this I found on this thread, however I'm hoping I can just do it on python as it might be easier?

Hey, I was wondering, is there any way to give the 33rd officer a different hat from the rankers?

Yes

If you want to remove the hats from British_hats.brf and place them in the ummm british_uniforms.brf you will need to roto them likeeeeee   https://i.gyazo.com/6cbdf536f9f09d212b5ef4c15ca6693b.png

you'll have to keep checking but place it/move it to the where you want the hat to be, make sure it's named the same as the unit e.g 33rd_Ranker.1 not just 33rd_shako. GL
« Last Edit: November 12, 2018, 07:00:11 pm by PelvicThrust »

Offline Grozni

  • Second Lieutenant
  • *
  • Posts: 308
    • View Profile
  • Nick: RRA_10thRH_SoH_Grozni
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1736 on: November 12, 2018, 07:49:53 pm »
The problem is you want to change the item worn completely on client side. Servers will not allow this, cosmetic or not, otherwise everyone would be walking around with custom equipment combinations made with changes to client.
In best case server will override item you set by default one, you'll most likely be kicked upon spawning ("kicked for cheating").

Wursti

  • Guest
Re: Have a question about Modding? Ask Here!
« Reply #1737 on: November 12, 2018, 08:55:39 pm »
Do I have to define the Items somewhere else than in ID_Items? It keeps saying one item is undefined even tho I added it there and yes I spelled it correctly.

Offline Grozni

  • Second Lieutenant
  • *
  • Posts: 308
    • View Profile
  • Nick: RRA_10thRH_SoH_Grozni
  • Side: Neutral
Re: Have a question about Modding? Ask Here!
« Reply #1738 on: November 12, 2018, 09:23:19 pm »
Do I have to define the Items somewhere else than in ID_Items? It keeps saying one item is undefined even tho I added it there and yes I spelled it correctly.

There is no point adding anything to ID_Items, it is auto generated using content of module_items.py which is the file you want to edit.
« Last Edit: November 12, 2018, 09:25:29 pm by Grozni »

Wursti

  • Guest
Re: Have a question about Modding? Ask Here!
« Reply #1739 on: November 12, 2018, 10:10:28 pm »
Do I have to define the Items somewhere else than in ID_Items? It keeps saying one item is undefined even tho I added it there and yes I spelled it correctly.

There is no point adding anything to ID_Items, it is auto generated using content of module_items.py which is the file you want to edit.

Yea I've edited that but when I start build_module.bat it keeps showing me errors of items not being declared :c