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:
...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.