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

Neodrako and 1 Guest are viewing this topic.

Bad Idea

  • Knight
  • *
    • View Profile
  • Faction: Sarranid
  • MP nick: Bad Idea
  • M&BWBWF&SNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10200 on: March 18, 2012, 03:13:14 AM »
Poison script I've been working on. (borrowing animation from a dismemberment mod) It works except that it doesn't go away like it's supposed to.
The slots 'poisoned' and 'poison_wear_off' become the same value and I don't know why.

All of the code goes into mission_templates:
(click to show/hide)

animation
(click to show/hide)

Here's a testing item to poison yourself with:
(click to show/hide)


Azrooh

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Nord
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10201 on: March 18, 2012, 03:43:36 AM »
Still wrong, you can't check if a key is clicked or get the player id on the server (unless it's a listen server and you're the hosting player, but I doubt that's what you want).
Exactly. Right now, the priority is to get it to work on dedicated server. How would I do the check?

You need to do the key press detection on the client side, send a message to the server and then send a message to all players. For general events that is. I heard (read) someone say that you can use (agent_play_sound, ":sound"), and it will automatically get synchronized between all players, but I haven't tested this myself yet.

It gets synchronized, but it works the same way particles are synchronized - it's cut off at a point. It's good for roleplaying mods with big maps, or more quiet sounds, but for gunshots and explosions that should be heard across the map the old way of sending it to all the players is better.

CutContent

  • Sergeant
  • *
  • words cannot do her justice, friend Khajiit!
    • View Profile
  • Faction: Rhodok
  • MP nick: WoH_Veteran_Firestar
  • M&B
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10202 on: March 18, 2012, 06:59:22 PM »
Could someone send me a script that makes people fight you when you use a certain dialog option?
I have tried this for 2 weeks! so I'm not 'lazy'


del

  • Master Knight
  • *
    • View Profile
    • warsword
  • Faction: Sarranid
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10203 on: March 18, 2012, 07:12:09 PM »
Hi all, I'm trying to add Village Faction Recruitment to my Warsword conquest mod using this code below , it compiles with no errors but I get a CTD at loading the mod  saying "Unexpected End of File while reading file: Modules\Warsword Conquest\menus.txt"

 I have added it in correctly with module systems but cannot see why its not working  :?
Can any one help me to get this working please  :D

Thanks all
Del



Well the reason you don't see it is because you have to create a menu that goes to that (sorry I didn't post that little bit!) Now since your using the Module system this shall be easier. I added this

(click to show/hide)

To the bottom of game_menus along with this

(click to show/hide)

Which I acually added with the rest of the camp actions but you could add it anywhere.

Now assuming you have an unmodded version of the module system (which I'm sure you don't) you have to add these to module_scripts and I'm sure you can mess around with them a bit to get them to work with your modded stuff.

(click to show/hide)

And the last little part I'll post again,

(click to show/hide)

Just cut out that stuff in the red and your done! yay

Now for everyone just tuning in,
What this does is forces factions to recruit their own troops, it also changes the culture of troops you recruit based on what faction owns it. (Example: Swadians capture a Nordic town, you then recruit Swadians from the once Nordic villages.)
Also the big menu part comes ONLY into play when you make your become a King for your own country. What it does is add a menu to the camp actions which allows for you to set the "culture" you AND your vassals recruit, whether you want Nord troops or Sarranids, or perhaps Rhodoks one day and Vaegirs the next.

For you creating your own troop trees and what not, I'm sure there is a way to make one of these,

(click to show/hide)

For the troops you created and then have both you and your vassals recruit these men from the villages YOU own.

Note: These menus DO NOT appear if YOU are currently not a King of your own country.

So follow those steps and thats what they do, sorry the steps I've posted was never quite clear in the past. I hope this sums it up and it really is a great little tweak imo.


New: These codes are the same thing as the stuff above but only how they appear in the .txt files with the numbers. So this will help you all that don't use the module system which I still recommend you getting into if your going to do any modding.

So first of all locate "cf_reinforce_party -1" in scripts.txt and replace the entire line with

(click to show/hide)

Then find "update_volunteer_troops_in_village -1" in scripts.txt and replace the entire line with

(click to show/hide)

Then right below that at "update_npc_volunteer_troops_in_village -1" replace the entire line with

(click to show/hide)

Now exit scripts.txt and find menus.txt.

Here you need to add two things. You can add them at the bottom or perhaps with the other camp menu stuff or what ever you want to do.

Here is the camp_action, I added it with the other camp_actions

(click to show/hide)

and the last part where it selects the faction

(click to show/hide)


Just follow the steps at the bottom with the codes if your not using the module system and you will get what you want  :wink: Be sure to create a new folder which you want this stuff to be in don't use your Native folder.

MadVader

  • Grandmaster Knight
  • *
  • White cat cavalry to the rescue!
    • View Profile
    • Prophesy of Pendor
  • Faction: Neutral
  • M&BWB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10204 on: March 18, 2012, 10:24:48 PM »
Could someone send me a script that makes people fight you when you use a certain dialog option?
I have tried this for 2 weeks! so I'm not 'lazy'

Code: [Select]
[trp_cut_content,"start", [], "Could someone send me a script that makes people fight you when you use a certain dialog option? I have tried this for 2 weeks! so I'm not 'lazy'", "ur_lazy",[]],

[trp_cut_content|plyr,"ur_lazy", [], "You got all the help you needed, yet failed? You suck, dude.", "lazy_sod_fights_back",[]],

[trp_cut_content,"lazy_sod_fights_back", [], "NO U!", "close_window",
   [(set_party_battle_mode),
    (get_player_agent_no, ":player_agent"),
    (try_for_agents, ":cur_agent"),
      (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
      (try_begin),
        (eq, ":cur_agent_troop", "$g_talk_troop"),
        (agent_set_team, ":cur_agent", 3),
      (else_try),
        (eq, ":cur_agent", ":player_agent"),
        (agent_set_team, ":cur_agent", 2),
      (try_end),
    (try_end),
    (team_set_relation, 2, 3, -1),
    (team_set_relation, 2, 0, 0),
    (team_set_relation, 3, 0, 0)]],

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 #10205 on: March 19, 2012, 12:19:01 AM »
Hey everyone,

After reviewing some of the reinforcement templates, one of the things I'm wanting to do for our mod is to make AI Lord parties be constituted by only certain types of soldiers, instead of the mishmash that often appears.

Specifically, I'm looking to find a way to for some AI lord parties to be purely cavalry, with a chance of other types of units, some AI lord parties to be purely infantry, with a small change of other units. I would also like to alter the way castles and towns are garrisoned.

My question(s):

What are the specific scripts that deal with this? Has anyone else attempted to do this? Are there pitfalls or things I should avoid and not do? Tips? I know most of the scripts, but I want to make sure I know the entire scope of it before I begin to dismantle how these things are made up.

I greatly appreciate it.

<3

CR

MadVader

  • Grandmaster Knight
  • *
  • White cat cavalry to the rescue!
    • View Profile
    • Prophesy of Pendor
  • Faction: Neutral
  • M&BWB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10206 on: March 19, 2012, 01:28:59 AM »
You would probably want to expand script_cf_reinforce_party to work with individual lords, and not just factions and party types.
That means you can define reinf templates at lord level if you wish, create those templates and put them in lord's slots (e.g. slot_troop_lord_reinf) at game init; use them in script_cf_reinforce_party later. You want to make this work for only particular lords, so you don't bother with templates for EVERY lord in the game (e.g. check if their slot_troop_lord_reinf is non-zero) - for the rest, the faction templates should be good enough.

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 #10207 on: March 19, 2012, 01:56:29 AM »
You would probably want to expand script_cf_reinforce_party to work with individual lords, and not just factions and party types.
That means you can define reinf templates at lord level if you wish, create those templates and put them in lord's slots (e.g. slot_troop_lord_reinf) at game init; use them in script_cf_reinforce_party later. You want to make this work for only particular lords, so you don't bother with templates for EVERY lord in the game (e.g. check if their slot_troop_lord_reinf is non-zero) - for the rest, the faction templates should be good enough.

Thank you muchly :)

I shall check out those scripts. Appreciated :)

<3

CR

CutContent

  • Sergeant
  • *
  • words cannot do her justice, friend Khajiit!
    • View Profile
  • Faction: Rhodok
  • MP nick: WoH_Veteran_Firestar
  • M&B
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10208 on: March 19, 2012, 05:49:58 AM »
Code: [Select]
[quote author=MadVader link=topic=6575.msg5300373#msg5300373 date=1332105888]

[trp_cut_content|plyr,"ur_lazy", [], "You got all the help you needed, yet failed? You suck, dude.", "lazy_sod_fights_back",[]],

[trp_cut_content,"lazy_sod_fights_back", [], "NO U!", "close_window",
   [(set_party_battle_mode),
    (get_player_agent_no, ":player_agent"),
    (try_for_agents, ":cur_agent"),
      (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
      (try_begin),
        (eq, ":cur_agent_troop", "$g_talk_troop"),
        (agent_set_team, ":cur_agent", 3),
      (else_try),
        (eq, ":cur_agent", ":player_agent"),
        (agent_set_team, ":cur_agent", 2),
      (try_end),
    (try_end),
    (team_set_relation, 2, 3, -1),
    (team_set_relation, 2, 0, 0),
    (team_set_relation, 3, 0, 0)]],
[/quote]

lol, thanks

CutContent

  • Sergeant
  • *
  • words cannot do her justice, friend Khajiit!
    • View Profile
  • Faction: Rhodok
  • MP nick: WoH_Veteran_Firestar
  • M&B
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10209 on: March 19, 2012, 05:52:11 AM »
Actually I got no errors in the previous MS (the one with the trp_swag thing), but the character trp_swag wouldn't spawn, so yeah

MadVader

  • Grandmaster Knight
  • *
  • White cat cavalry to the rescue!
    • View Profile
    • Prophesy of Pendor
  • Faction: Neutral
  • M&BWB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10210 on: March 19, 2012, 07:54:01 AM »
Actually I got no errors in the previous MS (the one with the trp_swag thing), but the character trp_swag wouldn't spawn, so yeah
Then try to make it spawn. How to do this depends on where your troop spawns (tavern, castle etc.).
Example for spawning in tavern, find this in game menus (line 9184 in Native) and insert the code marked with #NEW CODE:
Code: [Select]
...
(try_begin),
(eq, ":randomize_attacker_placement", 3),
(call_script, "script_setup_tavern_attacker", ":cur_entry"),
(val_add, ":cur_entry", 1),
(try_end),

#NEW CODE
(try_begin),
(eq, "$current_town", "p_only_town_where_we_spawn"),
(set_visitor, ":cur_entry", "trp_cut_content"), (val_add, ":cur_entry", 1),
(try_end),

             (try_begin),
               (neg|check_quest_active, "qst_eliminate_bandits_infesting_village"),
...

Replace p_only_town_where_we_spawn with the real town where you want to spawn, like p_town_6 for Praven.
« Last Edit: March 19, 2012, 08:08:03 AM by MadVader »

Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&SNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10211 on: March 19, 2012, 03:28:01 PM »
Poison script I've been working on. (borrowing animation from a dismemberment mod) It works except that it doesn't go away like it's supposed to.
The slots 'poisoned' and 'poison_wear_off' become the same value and I don't know why.

All of the code goes into mission_templates:
(click to show/hide)

animation
(click to show/hide)

Here's a testing item to poison yourself with:
(click to show/hide)
You assigned the slots different values in module constants?



DatFrog!

  • Grandmaster Knight
  • *
  • Brainy is the new sexy !
    • Steam - TomyLG44
    • View Profile
  • Faction: Neutral
  • WBNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10212 on: March 19, 2012, 08:26:16 PM »
Does someone know the name of .dds where I can find this?

(click to show/hide)

Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&SNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10213 on: March 19, 2012, 08:38:18 PM »
Does someone know the name of .dds where I can find this?

(click to show/hide)
Buttons are in interface.dds
Dropdown/combo button in button_drop.dds
« Last Edit: March 19, 2012, 08:40:59 PM by Caba`drin »



DatFrog!

  • Grandmaster Knight
  • *
  • Brainy is the new sexy !
    • Steam - TomyLG44
    • View Profile
  • Faction: Neutral
  • WBNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10214 on: March 19, 2012, 08:57:11 PM »
Okay thanks :)