Mount & Blade: Warband

Mount & Blade: Warband

Prophesy of Pendor v3.9.5
DwronScar 18 May, 2019 @ 3:49pm
Help adding new Rifles to the game
This may not get an answer but i will ask anyway after exposing my situation.

I usually like to tweak every mod i get and PoP is no exception.

Since we just got the first rifle, i wanted to go wild and make a sort of WWII CKO with guns, added from other mods. I have added assets to mods from other mods before but i never added guns in particular. They work quite differently because they are not natively supported in Warband.

For instance, i first wanted to make my own version of Arquebus, so (using Morghs) i used it as a template and went from there, all was working fine and dandy until i went to test it in-game... it had no sound, no projectile came out of it and made no smoke when fired, however it did function properly since it delivered damage and it even killed enemies i pointed it at.

It would appear the item type "musket", unlike the crossbow type, does not get automatically linked to its proper effects. Then i went and looked how With fire and Sword does it... but that didn't help because, at least in Morghs, the rifles had nothing special in particular.

So then i figured, since the Arquebus works just fine, i should take a look and see how it does it for Warband. It turns out its doing it through some kind of script that is visible at the bottom of the GUI titled "Trigger". Unfortunately there is no way for me to figure out the structure of the commands in that script since python likes to do it through an ID system and i can't find the ID of the actual commands used without the developer Module System.

So here is where i would like some help. If anyone can explain to me what is the structure used for Arquebus in details, like which number in that string is the ID of the script, which refers to the gun length so the particles can spawn at the right coordinates etc...

Basically i need to understand the script if i want to add my own guns (unless i don't care whether or not they make any sound, or fire any visible projectiles)

So far i deduced 2 things from Arquebus's Trigger which is the following:

-51.000000 4 600 1 1152921504606847614 720 2 1 0 721 2 1 101 1969 3 1008806316530991135 1 15

1152921504606847614-> is the ID of the actual sound the gun makes upon being fired
1008806316530991135-> is the ID of the smoke generated upon being fired

If there is any software that can help make this easier, feel free to suggest, if anyone knows how to figure these numbers out, please let me know. If the developers themselves wanna tune in, even better xD.

Thanks!
Last edited by DwronScar; 18 May, 2019 @ 3:51pm
< >
Showing 1-4 of 4 comments
Wimpypumpkin 18 May, 2019 @ 4:20pm 
Sorry that i cant help to much with the adding of guns and figuring out the sound locations BUT you can already get a KO with rifles if you have some trained high enough in firearms. Straight from the wiki.

"You may come across a companion who wields one, but you will need to search for the bag of Bullets which he had haplessly lost in his journey (see bottom of page). If a proficient arquebusier was to advance through the ranks of knighthood, he will be presented with the opportunity to establish a supply chain for procuring these new weapons for their order, in the same fashion as one would procure Mettenheim Arbalests; what is more, if you have seized the Snake Cult stronghold, Quartermaster Kailin will also sell the gun and the bullets to you directly, with a very limited stock that periodically replenishes."

Again, not exactly what you want but at least it avoids the whole having to add more rifles to units since its already somewhat available.
DwronScar 18 May, 2019 @ 4:36pm 
Yeah, i know that but... its a singular rifle... just one... in the entire mod, that ain't gonna cut it xD.
Besides, i want a rifle unique to myself or just guns in general, guns that are not found on any other unit. I also don't want to remove the Arquebus from Barcaly troops.
Last edited by DwronScar; 18 May, 2019 @ 4:38pm
DwronScar 19 May, 2019 @ 4:31am 
Welp, for the most part, i managed to answer my own question by installing python and using the header_operations.py from the Module_Systems provided by taleworld. In case anyone happens to want the same thing as me, here's what i found so far.

So -51.000000 is an ID that calls for a trigger function to happen. That ID is followed by a number which represent how many parameters/arguments the trigger function will have, in this instance, there will be 4.

Next is another ID for a function call (a function within a function xD), 600 -> play a sound function, and like with the trigger function, is followed by a number that says how many parameters/arguments this function will have, which is 1 and then the actual parameter which is the ID of the sound and that is: 1152921504606847614. This one is still a mystery to me as i don't know how or where do you get this ID.

Next is number 720 with 2 arguments, 720 is a function that moves a "pointer" on the X axis from position to destination, i don't know why position is 1 and destination 0.

Next is 721 with 2 arguments, does the same thing as 720 but it moves on the Y axis. Again i don't know what position is 1 and destination 101.

Last is 1969 with 3 arguments and is a function that tells the game to draw on screen a particle effect in a high-priority and fast manner. The long number "1008806316530991135: is the ID of the smoke, again i don't know how it gets generated, 1 is position and 15 is something that was called strength in the Python File.

Anyway, that about raps up my findings, hopefully i can later find out the missing details or someone can shine some light on the matte for mer.

Thanks!
DwronScar 19 May, 2019 @ 4:38am 
Forgot to add, here is how the code fore the trigger looks like for the native Flintlock Pistol:
[(ti_on_weapon_attack, [(play_sound,"snd_pistol_shot"),(position_move_x, pos1,27),(position_move_y, pos1,36),(particle_system_burst, "psys_pistol_smoke", pos1, 15)])]]

And here is how the trigger looks like in the generated txt file:
-51.000000 4 600 1 1152921504606847102 720 2 1 27 721 2 1 36 1969 3 1008806316530991133 1 15

Once again, i have no idea how "snd_pistol_shot" translates to 1152921504606847102 or likewise, "psys_pistol_smoke" to 1008806316530991133.
< >
Showing 1-4 of 4 comments
Per page: 1530 50