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

0 Members and 1 Guest are viewing this topic.

Bad Idea

  • Squire
  • *
  • asian coder
    • View Profile
  • Faction: Sarranid
  • MP nick: Bad Idea
  • M&BWBWF&SNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10215 on: March 19, 2012, 09:06:37 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?
:/nope. And yet I call myself a scripter
EDIT: works like a charm now
« Last Edit: March 19, 2012, 09:51:09 PM by Bad Idea »


Kendoman

  • Squire
  • *
  • En Ferro Veritas...The pen is mightier than the sw
    • View Profile
  • Faction: Neutral
  • M&BWBWF&SNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10216 on: March 19, 2012, 10:35:16 PM »
Hello:

Are there OSP maps?  I'm looking for a map of Great Britain.

Cheers


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 #10217 on: March 19, 2012, 10:40:14 PM »
Hello:

Are there OSP maps?  I'm looking for a map of Great Britain.

Cheers
There are. They'd be in the OSP Resources section, with the tag [Map] (for a world/area map) and [Scene] (for what you think of as an MP map...or any place you walk around in SP)

Maps on Request - including one of Great Britain



Kinsume

  • Knight
  • *
  • There can be only one.
    • View Profile
  • Faction: Nord
  • MP nick: Kinsume
  • WB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10218 on: March 20, 2012, 03:43:13 PM »
So I played Native Expansion's mod and fell in love with the new Looting system, among several other changes in the mod I am currently playing I was hoping to implement this. Issue is I couldn't get in touch with NE's modders and I am not familiar with the looting system. Essentially rather than Looting being a party skill that affects raiding villages and such, it was changed to a Personal skill and directly affects the amount of random loot plus its quality at the end of battles. Naturally 0 Looting would be bad/few gears and 10 Looting would be good/many gears.

As this is currently the only thing that has me stuck, and I kind of need it to move forward with my next mini-update, I was wondering if anyone was familiar with changing skills.
The Internet - A place where everyone who is better than you has no life, and everyone worse than you is a noob.

I came into this world kicking, screaming and covered in someone else's blood. I have no problem leaving the same way.

Lav

  • Knight
  • *
    • View Profile
  • Faction: Vaegir
  • MP nick: Lav
  • M&BWB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10219 on: March 20, 2012, 04:00:10 PM »
As this is currently the only thing that has me stuck, and I kind of need it to move forward with my next mini-update, I was wondering if anyone was familiar with changing skills.
NE emulates Looting skill through scripting, so you need your mod's sources to implement it. If you have them, then just search for instances of (troop_loot_troop, ...) operation, there should only be a few of them, and replace those instances with whatever custom code you wish. Changing Looting skill from party to personal will only have a visual effect in this case.

Cozur

  • Sergeant Knight
  • *
  • Censored.
    • View Profile
  • Faction: Neutral
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10220 on: March 20, 2012, 10:58:56 PM »
Which texture contains the loading bar?

As in, which .dds file has the loading bar thingie in it, been trying to find it, and either I'm blind, or it's cleverly hidden somewhere.

Also, I'm looking for a way to change the loading screen text, so instead of saying "Loading Textures..." it says "Prepare for running out of memory..." or something like that.

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 #10221 on: March 21, 2012, 12:45:04 AM »
Which texture contains the loading bar?

As in, which .dds file has the loading bar thingie in it, been trying to find it, and either I'm blind, or it's cleverly hidden somewhere.
interface.dds
It is colored from the tan in the texture file by vertex coloration on the mesh, which is found in core_ui_meshes.brf as progressbar_handle

Also, I'm looking for a way to change the loading screen text, so instead of saying "Loading Textures..." it says "Prepare for running out of memory..." or something like that.
This you'll find in the .csv language files, specifically ui.csv and the lines begin with ui_loading_*



phlpp

  • Sergeant at Arms
  • *
    • View Profile
    • Gekokujo Mod Page
  • Faction: Bandit
  • WBWF&S
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10222 on: March 21, 2012, 02:21:04 AM »
I'm making new troop types and I was wondering about the faction field (fac_commoners, fac_neutral, fac_kingdom_# and the like). For non-hero troop types, that's mostly used to determine party morale effects, right? In my mod, I'm doing village and town recruitment where the unit types you can get from them are common to all factions, with recruits from castles the ones that are faction-specific. I just need to make sure it's "safe" to put recruitable units under fac_commoners and that nothing weird happens to them when I do so (like them somehow getting the increased wages of mercenaries, etc etc)

Like my work? Buy me a drink!*

*Just as likely to be used for buying nerdy history books

Muffin Raider

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10223 on: March 21, 2012, 05:52:05 AM »
Alright, I read this under the intro to module system syntax and usage:

(click to show/hide)


global variables are by default assigned the value 0. So, are newly made local variables, by default, also assigned the value 0?



Edit:

I also have a couple of questions regarding the header operations file.

Lets look at this example (from the updated header operations file, posted on the forum):

store_faction_of_party                = 2204  # (store_faction_of_party, <destination>, <party_id>),
                                                          # Retrieves current faction allegiance of the party.

1)  Reading the header operations file: what does <destination> mean? What code can I write into that field? Is the code you put in the field retrieved from a module or header file?

Also

2)  Reading the header operation <party_id> . The code I am looking at  has “$current_town” as part_id. However ,there is no party_ id under module_parties that is name $current_town.

Thank you in advance for any answers.

« Last Edit: March 21, 2012, 07:22:22 AM by Muffin Raider »

Somebody

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Bandit
  • WBWF&S
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10224 on: March 21, 2012, 07:38:08 AM »
Destinations are always variables or registers, so initialization may not be necessary. $current_town is a common global variable that is set whenever the player encounters a town party and enters its menu.

Lav

  • Knight
  • *
    • View Profile
  • Faction: Vaegir
  • MP nick: Lav
  • M&BWB
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10225 on: March 21, 2012, 08:39:19 AM »
I'm making new troop types and I was wondering about the faction field (fac_commoners, fac_neutral, fac_kingdom_# and the like). For non-hero troop types, that's mostly used to determine party morale effects, right? In my mod, I'm doing village and town recruitment where the unit types you can get from them are common to all factions, with recruits from castles the ones that are faction-specific. I just need to make sure it's "safe" to put recruitable units under fac_commoners and that nothing weird happens to them when I do so (like them somehow getting the increased wages of mercenaries, etc etc)
As far as I know, non-hero troop faction does not play any role in the game at all, it's there just for convenience. You can switch all your Rhodok troops to fac_commoners, and they will recruit, upgrade and fight just as fine. Might cause problems in MP though (unlikely, but possible, I didn't examine MP code thoroughly so cannot give any guarantees here).

Vornne

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Vornne
  • M&BWBNW
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10226 on: March 21, 2012, 09:40:32 AM »
global variables are by default assigned the value 0. So, are newly made local variables, by default, also assigned the value 0?
No: local variables should be assigned something before use.

VN-Killah

  • Guest
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10227 on: March 21, 2012, 09:00:00 PM »
I would like help on how to add a custom troop type to be a recruitable mercenary in the taverns (this is for WFAS). I know this has been asked dozens of times before, but somehow after a search through the forums I am still unable to get it working.

I tried editing the Troops.txt file to add all the code for my new soldier below the 'Watchman' (mercenary halberdier) in the section beginning with 'Farmer' and finishing with 'Mercenaries_End' (which I was told was where all the recruitable mercenary troops should go) but when I started up the game I found that it had completely screwed up all the troop types. Jaques de Clermont was some fellow with a robe and beard, there were Noble Guard looters, and the townsfolk were all random soldiers like pikemen and musketeers.

Is there anyone who could help me figure out how on earth to get this thing to work? I would really like to see this new troop type I created (outfitted with custom items I made) appear as hireable soldiers in various taverns.

Thanks!

Somebody

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Bandit
  • WBWF&S
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10228 on: March 22, 2012, 01:28:08 AM »
You need to realize that the game engine is dumb and doesn't know what trp_watchman and trp_mercenaries end are. When the module system is compiled and the scripts to update the mercenary in each center is written to scripts.txt (update_mercenary_units_of_towns , update_mercen_units_of_castle), it takes the existing offset id of each entity (for example trp_watchman = 27 and trp_mercenaries_end = 33), which ends up being bit-shifted to avoid collision with other objects, and so you'll get 2136 3 1224979098644774913 360287970189639707 360287970189639713 where 2136 corresponds to store_random_in_range, the 3 is the number of parameters, the variable id immediately after that being the destination, and the last 2 are  the troop ranges (27 and 33 shifted).

When you inserted your new unit in between these numbers, it ends up shifting the id of each subsequent troop (trp_mercenaries_end  becomes #34), but the script still references the old offset. Since the entire game is wholly dependent on the offset system, the manual insertion of any troop except at the bottom will screw up all your savegames. What you can do is decrement the range in that script to get 360287970189639706, which will include the townsman troop (which isn't used by the AI in-game at all unless it upgrades from a rescued farmer); or increment 360287970189639714 to get the mercenaries_end placeholder troop itself included in the range and modify those troops accordingly. What you should do, however, is get the module system, which will do most of that for you.

Muffin Raider

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: Mount & Blade Mod Makers Q&A Thread
« Reply #10229 on: March 22, 2012, 02:47:45 AM »
Thanks for the answer to my previous questions. Now I have a few more.

Variables

Is there a list of global variables somewhere? Can I make my own global variables like local variables?

"$current_town" what does this global variable do exactly? I understand it is “set” when a play enters a town party and enters its menu. But, what is "$current_town" set to?

Is "$current_town" just a way to find the party_id of the town the player is currently at?
Then you can use slots to check information about that town; such as its relation with the player?

Slots

I am having trouble understanding slots. I read the intro to the module system syntax and usage tutorial and this is what I get. A slot is a way to look up or set a variable dealing with something such as an item, party, ect.

However where is the variable located? The example from the tutorial says:

(click to show/hide)

Where can I find the 53rd variable of an item? Or in other words where can I find the variable that is an items base price? I looked in the module_items , but I found nothing regarding an items base price.