Author Topic: Mount & Blade Mod Makers Q&A Thread  (Read 508180 times)

0 Members and 2 Guests are viewing this topic.

Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&S
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9750 on: February 04, 2012, 08:52:43 PM »
Hey could someone answer me this, is there a limit on how much sounds you can have in mount and blade.
The hard coded limit is probably quite high, but you'll run into a RAM-based limit much sooner. Loading up sounds will quickly spend the RAM assigned for the game and cause RGL errors. See the recent discussion Hm. I think M&B Warband's music system can't handle a certain amount music added and xeno's info in the Tutorial section [Info] Optimization Announcement: Sound and your Mods.

And don't cross-post a new thread when you've already asked here. Your impatience isn't going to win you any points or make anyone more likely to help you. Folks respond here of their free time...you might want to refresh yourself on How to ask for help.

Someone knows how to change weather and time of the day on multiplayer maps?
See Arch3r OS: Random weather for multiplayer gamemodes (fixed) or the FAQ in the first post of Nordous' Sceners Guild

Hey guys, i have a question about a script (Singleplayer) :
Is there a script (or is it possible to make one) for an armor/ weapon that spawns a new troop (at a random or specific spawn point) after the wearer of the armor died? 
I've someone knows such a script(or knows how to make it), would it be possible to post it here?
I need this script for trying to make a sort of a death-match style singleplayer mode (and later maybe for making exploring-scenes for the player with re-spawning monsters and bandits)
Anyone can help me?
Bye, Alrik
______________________________________
sorry for my (maybe) wrong English   

The mission template trigger ti_on_agent_killed_or_wounded will fire every time an agent is killed or wounded.
So you'd want to do something like this:
Code: [Select]
(ti_on_agent_killed_or_wounded, 0, 0, [],
  [
   (store_trigger_param_1, ":dead_agent"),
   #do stuff, like get what the agent is wearing, get its position, set the spawn position to that position, and spawn the items
  ]),

Trying to allow only Cavalry troop class to be able to ride horses in WFaS sieges when entering through the gate or a wall breach.

Removing the override horse flag isn't working since there isn't a way to filter for only cavalry on one of the spawn points.  WFaS does have a script that is called from oim_on_horse_dismount, but everything was commented out and noted as buggy.
...
The code compiles just fine for me, it just doesn't work.  I've tried setting the trigger from the default ti_on_agent_dismount to ti_on_agent_spawn, but no luck.  Recent posts in here indicate that before_mission_start wouldn't work for me either.

Any ideas on what it is that I'm missing?
A number of things here. Good points on removing the flag...though you will need to do so if you want horses to appear at all. However, once an agent has spawned a horse, the spawned horse is no longer 'just' an item and is now an agent in its own right. You cannot "unequip" and agent, so this method is definitely not going to work.

"ti_on_agent_dismount" only fires when an agent dismounts--either the horse dies or it gets off its horse--and you cannot force an agent to dismount, so that isn't a particularly useful trigger. Most likely the oim_ script you mention is tied to this trigger, so it too is not particularly useful (though I haven't looked at it)

Really the only thing you can try is to edit the troop template of the non-cavalry class troop and be sure there isn't a horse equipped (though, for these non-cav troops that sometimes get horses, I'm really not sure how that works in the first place). You can do a try_for_range through the troop stacks at ti_before_mission_start and remove horses from the appropriate troops. You probably want to mark those troops with a troop slot so you can add their horses back after the battle. You can capture battle end with a simple trigger (and setting a variable to make it fire) or by adding code where you see (finish_mission) or  (set_trigger_result, 1), in the mission template triggers as those end the battle.
« Last Edit: February 04, 2012, 09:38:06 PM by Caba`drin »



Somebody

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Bandit
  • WBWF&S
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9751 on: February 04, 2012, 09:47:32 PM »
Trying to allow only Cavalry troop class to be able to ride horses in WFaS sieges when entering through the gate or a wall breach.
The problem with your code is that horses are not equipment once inside a scene, they are individual agents. It becomes more difficult to work with at that level. The easiest way is either via troop inventory manipulation (in the breach menu) and restoration in the victory menu, or use a loop in the mission template calling team_give_order with rordr_dismount for all classes except grc_cavalry. The player can easily circumvent this by setting his troop classes from the party menu to all cavalry or just tell them to mount again, but it's much safer than playing with the inventory.

bobross419

  • Sergeant
  • *
    • View Profile
  • Faction: Vaegir
  • M&BWBWF&S
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9752 on: February 04, 2012, 09:56:01 PM »

Trying to allow only Cavalry troop class to be able to ride horses in WFaS sieges when entering through the gate or a wall breach.

Removing the override horse flag isn't working since there isn't a way to filter for only cavalry on one of the spawn points.  WFaS does have a script that is called from oim_on_horse_dismount, but everything was commented out and noted as buggy.
...
The code compiles just fine for me, it just doesn't work.  I've tried setting the trigger from the default ti_on_agent_dismount to ti_on_agent_spawn, but no luck.  Recent posts in here indicate that before_mission_start wouldn't work for me either.

Any ideas on what it is that I'm missing?
A number of things here. Good points on removing the flag...though you will need to do so if you want horses to appear at all. However, once an agent has spawned a horse, the spawned horse is no longer 'just' an item and is now an agent in its own right. You cannot "unequip" and agent, so this method is definitely not going to work.

"ti_on_agent_dismount" only fires when an agent dismounts--either the horse dies or it gets off its horse--and you cannot force an agent to dismount, so that isn't a particularly useful trigger. Most likely the oim_ script you mention is tied to this trigger, so it too is not particularly useful (though I haven't looked at it)

Really the only thing you can try is to edit the troop template of the non-cavalry class troop and be sure there isn't a horse equipped (though, for these non-cav troops that sometimes get horses, I'm really not sure how that works in the first place). You can do a try_for_range through the troop stacks at ti_before_mission_start and remove horses from the appropriate troops. You probably want to mark those troops with a troop slot so you can add their horses back after the battle. You can capture battle end with a simple trigger (and setting a variable to make it fire) or by adding code where you see (finish_mission) or  (set_trigger_result, 1), in the mission template triggers as those end the battle.

Unfortunately, that all makes sense.  Will definitely tinker around with this later.  Thanks caba and Somebody.
Nationalism. Almost as serious a business as the internet. Some of these diatribes feel like necroposts from the 19th century... *sigh*

xPearse

  • Squire
  • *
  • H.O.T.D. Check It Out
    • View Profile
  • Faction: Neutral
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9753 on: February 04, 2012, 10:58:47 PM »
Ok so from what I read in both tpics there is a hard coded limit of around 256 (I have 383 in my sounds txt) and using wav makes it easier to load or is better. Ok so do you think I should convert my sound files and change them to 16-bit 22kHz mono WAV and then see what happens.

celestialred

  • Knight at Arms
  • *
  • At night we're conspiring by candlelight
    • View Profile
    • My Facebook Profile
  • Faction: Vaegir
  • M&BWBWF&SNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9754 on: February 05, 2012, 07:41:12 AM »
Hey everyone,

Anyone have an idea what this error code could be point towards?

Code: [Select]
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Traceback (most recent call last):
  File "process_troops.py", line 107, in <module>
    save_troops()
  File "process_troops.py", line 34, in save_troops
    file.write("\ntrp_%s %s %s %s %d %d %d %d %d %d\n  "%(convert_to_identifier(
troop[0]),replace_spaces(troop[1]),replace_spaces(troop[2]), replace_spaces(str(
troop[13])), troop[3],troop[4],troop[5], troop[6], troop[14], troop[15]))
  File "D:\NMC Source Files\process_common.py", line 30, in replace_spaces
    return string.replace(string.replace(s0,"\t","_")," ","_")
  File "D:\ApplicationsPython27\lib\string.py", line 519, in replace
    return s.replace(old, new, maxreplace)
AttributeError: 'int' object has no attribute 'replace'
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: g_jq_Back_to_shop
WARNING: Global variable never used: jq_nr
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

The warning, I know about. But the error isn't one I can figure out for the life of me.

Thanks.

<3

CR

Lav

  • Knight
  • *
    • View Profile
  • Faction: Vaegir
  • MP nick: Lav
  • M&BWB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9755 on: February 05, 2012, 07:58:07 AM »
Anyone have an idea what this error code could be point towards?
Check the syntax in your module_troops.py file. Apparently one of your troop tuples has a number where the MS expects to see a string. In troops, this is either name or plural name I think.

CTCCoco

  • Sergeant at Arms
  • *
    • View Profile
  • Faction: Neutral
  • WB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9756 on: February 05, 2012, 09:48:02 AM »
I have two problems  :roll:

Why this:

Code: [Select]
(store_skill_level, reg0, skl_power_draw, ":player_no"),
(display_message, "@PRUEBADESKILL1ANTERIOR22:{reg0}"),
(troop_raise_skill, ":player_no", skl_power_draw, -reg0),
(store_skill_level, reg0, skl_power_draw, ":player_no"),
(display_message, "@PRUEBADESKILL1AHORA22:{reg0}"),
or this:

Code: [Select]
(store_proficiency_level, reg0, ":player_no", wpt_one_handed_weapon),
(display_message, "@PRUEBADESKILL1ANTERIOR:{reg0}"),
(troop_raise_proficiency, ":player_no", wpt_one_handed_weapon, -reg0),
(store_proficiency_level, reg0, ":player_no", wpt_one_handed_weapon),
(display_message, "@PRUEBADESKILL1AHORA:{reg0}"),

doesn't work? I just want to subtract to set it to 0, both for proficiency, skill and attribute. Somebody can help me, please?

__________

The other problem is one potion (as throwing weapon) that I need to implement to the game, but this is what you really see in-game:

(click to show/hide)

Somebody can help me, please?
« Last Edit: February 05, 2012, 09:50:58 AM by CTCCoco »
Pawn, LUA, PHP, MySQL programmer ( Squirrel coming soon ) ( SA-MP, MTA, IV-MP ). Learning Python (Warband module system) at the moment.


Vornne

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Vornne
  • M&BWBNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9757 on: February 05, 2012, 09:57:56 AM »
Code: [Select]
(troop_raise_skill, ":player_no", skl_power_draw, -reg0),
You can't negate an identifier like reg0, only actual number constants; you would need to use (val_mul, reg0, -1) and then plain reg0.

CTCCoco

  • Sergeant at Arms
  • *
    • View Profile
  • Faction: Neutral
  • WB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9758 on: February 05, 2012, 10:01:14 AM »
Code: [Select]
(troop_raise_skill, ":player_no", skl_power_draw, -reg0),
You can't negate an identifier like reg0, only actual number constants; you would need to use (val_mul, reg0, -1) and then plain reg0.

Oh, so if I use (val_mul, reg0, -1), it will be like "-reg0" in the function?

Ok, thanks! Let's try.

EDIT: I see maths here. I'm a retard at maths, sorry lol (I'm studying history lol).
« Last Edit: February 05, 2012, 10:07:13 AM by CTCCoco »
Pawn, LUA, PHP, MySQL programmer ( Squirrel coming soon ) ( SA-MP, MTA, IV-MP ). Learning Python (Warband module system) at the moment.


Sayd Ûthman

  • Modification Area Moderator
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Sayd_uth
  • WB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9759 on: February 05, 2012, 03:54:11 PM »
Hello i'm having some troubles understanding the native script get_closest3_distance_of_enemies_at_pos1, the problem is that at the first lines there is this :

Code: [Select]
(assign, ":min_distance_1", 100000),
(assign, ":min_distance_2", 100000),
(assign, ":min_distance_3", 100000),

Then some lines below is this :

Code: [Select]
        (try_begin),
          (lt, ":cur_dist", ":min_distance_1"),
          (assign, ":min_distance_3", ":min_distance_2"),
          (assign, ":min_distance_2", ":min_distance_1"),
          (assign, ":min_distance_1", ":cur_dist"),
        (else_try),
          (lt, ":cur_dist", ":min_distance_2"),
          (assign, ":min_distance_3", ":min_distance_2"),
          (assign, ":min_distance_2", ":cur_dist"),
        (else_try),
          (lt, ":cur_dist", ":min_distance_3"),
          (assign, ":min_distance_3", ":cur_dist"),
        (try_end),
      (try_end),

I don't understand why there is an else_try when we know that min_distance_1 and min_distance_2 and min_distance_3 have the same value, will that second part make the script randomly choose one of the else_try,

EDIT: i tried executing it mentally and it looks like a loop
« Last Edit: February 05, 2012, 03:56:36 PM by Sayd Ûthman »

Waldzios

  • Grandmaster Knight
  • *
  • "Policzym ich, jak ich pobijem"
    • View Profile
  • Faction: Neutral
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9760 on: February 05, 2012, 04:21:09 PM »
You missed the (try_for_agents,":cur_agent"), part:
(click to show/hide)
It's simple loop finding 3 lowest values:
(click to show/hide)
« Last Edit: February 05, 2012, 04:25:05 PM by Waldzios »

Sayd Ûthman

  • Modification Area Moderator
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Sayd_uth
  • WB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9761 on: February 05, 2012, 05:42:51 PM »
thank's it made it clearer in my mind,so if i understand correctly, the first block will run for the first agent, the second block for the second agent and so on ?? but it is supposed to take only 3 and you said 5 agents :P

NewBie-BR

  • Veteran
  • *
  • Mod game like a game
    • View Profile
  • Faction: Swadian
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9762 on: February 05, 2012, 06:00:14 PM »
hi all. I have some animations, i want to add to my mod but i dont know how, can you help me?

Waldzios

  • Grandmaster Knight
  • *
  • "Policzym ich, jak ich pobijem"
    • View Profile
  • Faction: Neutral
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9763 on: February 05, 2012, 06:26:51 PM »
thank's it made it clearer in my mind,so if i understand correctly, the first block will run for the first agent, the second block for the second agent and so on ?? but it is supposed to take only 3 and you said 5 agents :P
Nope :D , all blocks run for all agents, the 5 agents were only example (short one), there may be as well 1000 agents or more.
There are 3 blocks for 3 lowest values (the start value is 100000  to assure that every tested value will be lower).
In most cases the start values will be replaced after first three runs/agents (because all distance values will be lower than start values), it may take longer if the distances will be equal values.
Generally after three runs the min_distance values are changed.
(click to show/hide)

Sayd Ûthman

  • Modification Area Moderator
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Sayd_uth
  • WB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #9764 on: February 05, 2012, 06:34:04 PM »
Oh this is great, thanks it was that try_for_agents that made me run into this trouble.i get it perfectly now thank you