OSP Code Combat [WIP] Auto-Firing weapons mod

Users who are viewing this thread

downloaded 1.171 module system everything ren fine but it didn't make changes in-game or in any files.

can you help me with this or point to the 1.174 module system couldn't find it
 
lashatatu said:
downloaded 1.171 module system everything ren fine but it didn't make changes in-game or in any files.

can you help me with this or point to the 1.174 module system couldn't find it
The 1.171 module system is the last version, the update to 1.174 only included some steam fix which didn't affect the game itself.
 
Sorry to disturb you. Is there a mod with those machine gun crossbows? I can't even install python on my computer. got the files python 2.7.3 but i do not know how to make it work in environment variables. when i get to module system it does not recognise my python. I am really desperate the auto crossbow looks fun. Help Pleeeaaasee!!!!
 
Madundwa said:
Sorry to disturb you. Is there a mod with those machine gun crossbows? I can't even install python on my computer. got the files python 2.7.3 but i do not know how to make it work in environment variables. when i get to module system it does not recognise my python. I am really desperate the auto crossbow looks fun. Help Pleeeaaasee!!!!
Here is a very well written guide for how to get Python to work:
https://forums.taleworlds.com/index.php/topic,240255.0.html
If you fail at one step, make a comment there with a description of what is happening ^^
 
I have been working with this WIP OSP auto-firing weapons code for such a long time, using Warband 1.174, newest module_system but I still haven't finished because of some problems I have encountered and still hasn't solved.

I have also found some mods:
- The Reckoning,
- The Red Wars,
- SWC: The New Order,
- Turmoil Across Stars,

which are also using Auto-Firing Weapons feature.

Now, going straight to my questions (working with this script on my first Single Player Mod):


1) The Script IS working, my hero is shooting auto-fire but it is VERY HARD AND DIFFICULT to hit any AI enemy. What should I do to reduce spreading of bullets? I mean, I would like to achieve the same effect to this video on site:

moddb (.) com/mods/turmoil-across-the-stars/videos/autofire-testing - as you can see at 00:38, when player is shooting, his projectiles are going STRAIGHT FORWARD.

2) The bullets I am using are cartridges from Native module. When I am shooting auto-fire, the bullets ARE NOT VISIBLE. I would like to make them more visible. What is the best way to achieve it and HOW to achieve it?

Thank you all, who are still reading this topic and I hope someone will be able to help me in 2019. I would paste the link to the video but the site says I am not allowed to :smile:
 
I am not very smart when it comes to coding, but I'm a little confused on where to actually add these. I know the file but in terms of where to put it, does it go at the beginning or the end or somewhere else?

Edit: I saw an answer for this; however, I am not entirely sure if i have to run the module again after implementing these changes so I did. I get syntax errors for both Scripts and Mission_Templates. Reading through, I have seen others have an issue with these two, but no answers. How exactly do I implement these into their respective files on notepad?
 
hello im a newbie and i have an obsession with try to make a crossbow auto fire(purely for fun) since i saw a video on youtube a guy shooting a crossbow with fully auto and no recoil in native. it got me couple of day try to mod it out(im not a modder or anything), i did everything in this post said but my crossbow only shoot semi_auto. i even download other mod that have auto weapon to see where they put the code in but doesnt work. please help!!!
 
For everyone who wants the auto fire the easy way (without editing code), here's what you do:
1. Using Morgh's add new item and set the flag to crossbow
2. Set ammo to whatever you wish, speed to 999, accuracy to 999 (gives a straight stream of bolts, decrease to 600-800 for realistic recoil)
3. Download autoclicker software
4. Profit

If autoclicker won't work, run it as admin or try another one. Increase shot speed (sets projectile speed) if you want bullet-like ballistics. Import meshes from other mods using openBRF if you want gun textures. Replace release_crossbow sound file to your liking.
 
1) The Script IS working, my hero is shooting auto-fire but it is VERY HARD AND DIFFICULT to hit any AI enemy. What should I do to reduce spreading of bullets? I mean, I would like to achieve the same effect to this video on site:

2) The bullets I am using are cartridges from Native module. When I am shooting auto-fire, the bullets ARE NOT VISIBLE. I would like to make them more visible. What is the best way to achieve it and HOW to achieve it?
1) The general idea, I think is that the more you shoot, the bigger the spread. So instead of spraying and praying, you should fire in short bursts.
2) You need to replace the default "missile" mesh with something more visible. For this you need to go to module_items, find the 'cartridges' item:
["cartridges","Cartridges", [("cartridge_a",0)], itp_type_bullets|itp_merchandise|itp_can_penetrate_shield|itp_default_ammo, 0, 41,weight(2.25)|abundance(90)|weapon_length(3)|thrust_damage(1,pierce)|max_ammo(50),imodbits_missile],
Here "cartridges" is the internal (for the game's engine) name of the item, "Cartridges" is the displayed name of the item that you see in menus, and "[(cartidge_a",0)]" is what the mesh (3D model) the game is using to display the item. The "0" determines what function the mesh will have, in this case meaning that it's default function. By default, "cartridges" uses a very hard to see "missile" in scenes, I think it's a sprite used for convenience, more than anything. Arrows and bolts on the other hand, use an actual mesh to tell the player where it is exactly that arrows\ bolts are flying. For this, the have an additional entry that determines what kind of mesh will be used when they are shot, like here:
["bolts","Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),
"ixmesh_flying_ammo" tells the game what kind of mesh the "missile" should appear as when shot. So if you replace "flying_missile" with, say, "long_sword", when you shoot an arrow from a bow, it will (at least theoretically), turn into a sword when flying through the air. If you want cartidges to be visible when shot, the easiest way to do it is to add "("flying_missile",ixmesh_flying_ammo)" to the "cartridges" entry, like so:
["cartridges","Cartridges", [("cartridge_a",0),("flying_missile",ixmesh_flying_ammo),
This way, when shooting a weapon that uses cartidges for ammo, you'll have a very visible "arrow"-like mesh flying out of your gun. You can replace "flying_missile" with "cartridge_a", and it will turn into that weird beige item that cartridges are displayed in the menu as (fun fact: it's actually supposed to be a paper envelope holding a bullet and the gunpowder needed to be loaded into a gun to effectively fire it, but this is entirely unrelated to the game). Keep in mind that the "cartridge_a" mesh was not supposed to be seen by the player in real-time, so it might be oversized or might fly sideways when shot from your gun.
But if you want to have actual visible bullets, you'll need to find a bullet mesh, import it into the game, and replace "flying_missile" with it.
Additionally, if you want your character to "wear" a pack of cartridges on their belt or back, you'll need to add the following:
["cartridges","Cartridges", [("cartridge_a",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag_b", ixmesh_carry)],
"ixmesh_carry" tells the game that the item has a functional quiver. "bolt_bag_b" is the quiver used in the game to hold crossbow bolts. "Cartrdiges" doesn't have a quiver, because it doesn't need one. Nevertheless, it's convenient in case you accidentally drop your gun, because the game drops all of the gun's ammo with it automatically, and if there's no "ixmesh_carry" entry, the ammo becomes invisible and hard to pick up again. You can replace "bolt_bag_b" with "cartridge_a", as it would make more sense, but again, keep in mind that the mesh might look wonky.
To add to this, you'll also need to add an additional condition for the game to actually display the "holster" on your character. If we look at the crossbow bolts entry:
["bolts","Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts|itp_merchandise|itp_default_ammo|itp_can_penetrate_shield, itcf_carry_quiver_right_vertical, 64,weight(2.25)|abundance(90)|weapon_length(63)|thrust_damage(1,pierce)|max_ammo(29),imodbits_missile],
Here we are looking for...
itcf_carry_quiver_right_vertical,
This tells the game where the quiver is to appear on your character. "quiver_right_vertical" means that it's a quiver, and that it's to be worn on your character's right side, and be upright. So it will appear on your character's right hip. If you take a look at arrows, you'll see entries like:
itcf_carry_quiver_back
...and...
itcf_carry_quiver_back_right
The first one tells the game that the quiver is to be worn on the back, and be upright (regular arrows use this). The second one tells the game it should be titled to the right (bodkin, khergit, and barbed arrows use this). Swords, axes, daggers, maces, spears, and others all have their own entries for this. You can experiment as you like, but keep in mind that your chosen "ixmesh_carry" mesh might not be appropriate to be worn on the hip, or on the lower back, etc. It won't break your game (at least, normally), but it will look wonky, having clipping or flying beside your character.
Returning to the cartidges, the "cartridges" item doesn't have such an entry, because it doesn't have an "ixmesh_carry" entry, and is not meant to be seen by the player. Again, you'll need to add the corresponding conditions to the entry.
TLDR, here's the modified "cartridges" entry containing the things I've mentioned above:
["cartridges","Cartridges", [("cartridge_a",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag_b", ixmesh_carry)], itp_type_bullets|itp_merchandise|itp_can_penetrate_shield|itp_default_ammo, itcf_carry_quiver_right_vertical, 41,weight(2.25)|abundance(90)|weapon_length(3)|thrust_damage(1,pierce)|max_ammo(50),imodbits_missile],
Now the cartridges should (at least if I didn't make any mistakes, since I didn't test it as I'm writing this) do two things: 1) have a clearly visible "missile" mesh when shot, and 2) have a quiver on your right hip when equipped, or on the ground, when dropped.
Enjoy.
 
Back
Top Bottom