Jump to content
Sign in to follow this  
scottieo333

Weapon not firing or facing right direction

Recommended Posts

Hey guys, got myself into a little bit of a pickle here. I followed a tutorial for creating a weapon and getting it into O2 then in game but I'm having an issue making my gun shoot as it won't and also it is facing the wrong direction and is not placed in the players hands. I have created a shotgun just a simple little thing for now set up the config.cpp and model.cfg files and for the hand animation I'm using the rifle for the time being. Does anyone have any advise as to where i may have gone wrong or what areas focus on these set things I'm having issues with? Thanks for any help in advance.

Here is a link to my personal site to show 2 pics one being ingame to show what i mean with it facing wrong direction and the other is the .p3d file in O2 to show all the LODs http://www.blastgaming.org/problems.html

Share this post


Link to post
Share on other sites

Yeah sorry did not notice that they allowed the post as i did not get an email from the reply and here is my config.cpp. Sorry for pasting it all don't see a code option.

class CfgPatches

{

class Shotgun ////Every spot i say Weapon, you must enter the same info ie, alwyas enter "scarh" or "m16a3_mod1"

{

requiredaddons[] = {};

requiredversion = 0.1;

units[] = {};

weapons[] = {"BG_Shotgun"};

magazines[] = {"8Rnd_B_Beneli_Pellets"};

};

};

/*external*/ class Mode_SemiAuto;

class CfgWeapons {

class Shotgun {

access = 3;

afmax = 0;

aidispersioncoefx = 4;

aidispersioncoefy = 5;

airateoffire = 0.5;

airateoffiredistance = 500;

ammo = "";

autofire = 1;

autoreload = 0;

backgroundreload = 0;

ballisticscomputer = 0;

bullet1[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_01.wav", 0.1, 1, 15};

bullet10[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_02.wav", 0.01, 1, 15};

bullet11[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_03.wav", 0.01, 1, 15};

bullet12[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_04.wav", 0.01, 1, 15};

bullet2[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_02.wav", 0.1, 1, 15};

bullet3[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_03.wav", 0.177828, 1, 15};

bullet4[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_04.wav", 0.177828, 1, 15};

bullet5[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_01.wav", 0.1, 1, 15};

bullet6[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_02.wav", 0.1, 1, 15};

bullet7[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_03.wav", 0.1, 1, 15};

bullet8[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_04.wav", 0.1, 1, 15};

bullet9[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_01.wav", 0.01, 1, 15};

candrop = 1;

canlock = 0;

canshootinwater = 0;

cartridgepos = "nabojnicestart";

cartridgevel = "nabojniceend";

count = 0;

cursor = "arifle";

cursoraim = "CursorAim";

cursoraimon = "";

cursorsize = 1;

cmimmunity = 1;

descriptionshort = "WEAPON <br />Caliber: ";

detectrange = 0;

dexterity = 1.64;

discretedistance[] = {100, 300, 400, 600, 800};

discretedistanceinitindex = 1;

dispersion = 0.0001;

displayname = "WEAPON";

disposableweapon = 0;

distancezoommax = 300;

distancezoommin = 300;

drysound[] = {"A3\sounds_f\weapons\other\dry7.wav", 0.01, 1};

emptysound[] = {"", 1, 1};

enableattack = 1;

ffcount = 3;

fffrequency = 11;

ffmagnitude = 0.5;

fireanims[] = {};

firelightduration = 0.05;

firelightintensity = 0.012;

firespreadangle = "3.0f";

flash = "gunfire";

flashsize = 0.5;

forceoptics = 0;

handanim[] = {"OFP2_ManSkeleton","Shotgun\anim\handanim_WEAPON.rtm"}; //hand animation lcation

hiddenselections[] = {};

hiddenselectionstextures[] = {};

hiddenunderwaterselections[] = {};

hiddenunderwaterselectionstextures[] = {};

htmax = 600;

htmin = 1;

initspeed = 0;

irdistance = 0;

irdotintensity = 0.001;

irlaserend = "laser dir";

irlaserpos = "laser pos";

laser = 0;

lockacquire = 1;

lockedtargetsound[] = {"\A3\sounds_f\dummysound", 0.000316228, 6};

lockingtargetsound[] = {"\A3\sounds_f\dummysound", 0.000316228, 2};

magazinereloadtime = 0;

magazines[] = {""}; //magazines used

maxleadspeed = 23;

maxrange = 500;

maxrangeprobab = 0.04;

maxrecoilsway = 0.008;

memorypointcamera = "eye";

mfact = 1;

mfmax = 0;

midrange = 150;

midrangeprobab = 0.58;

minrange = 1;

minrangeprobab = 0.3;

model = "Shotgun\Shotgun"; //weapon location of p3d...(dont add .p3d at the end)

modelmagazine = "";

modeloptics = "-";

modelspecial = "";

modes[] = {"Single", "Burst"};

multiplier = 1;

muzzleend = "konec hlavne";

muzzlepos = "usti hlavne";

muzzles[] = {"this"};

namesound = "rifle";

optics = 0;

opticsdisableperipherialvision = 0.67;

opticsflare = 0;

opticsid = 0;

opticsppeffects[] = {};

opticszoominit = 0.75;

opticszoommax = 1.1;

opticszoommin = 0.375;

picture = "\Shotgun\UI\Shot_pic_ca";

primary = 10;

recoil = "assaultRifleBase";

recoilprone = "assaultRifleBase";

reloadaction = "GestureReloadMX"; //reload gesture

reloadmagazinesound[] = {"A3\sounds_f\weapons\reloads\new_trg.wav", 0.1, 1, 30};

reloadsound[] = {"", 1, 1};

reloadtime = 0.15;

scope = 0;

selectionfireanim = "zasleh";

showaimcursorinternal = 1;

showempty = 1;

shownunderwaterselections[] = {};

showswitchaction = 0;

showtoplayer = 1;

simulation = "Weapon";

sound[] = {};

soundbegin[] = {"sound", 1};

soundbeginwater[] = {"sound", 1};

soundbullet[] = {"bullet1", 0.083, "bullet2", 0.083, "bullet3", 0.083, "bullet4", 0.083, "bullet5", 0.083, "bullet6", 0.083, "bullet7", 0.083, "bullet8", 0.083, "bullet9", 0.083, "bullet10", 0.083, "bullet11", 0.083, "bullet12", 0.083};

soundburst = 1;

soundclosure[] = {"sound", 1};

soundcontinuous = 0;

soundend[] = {"sound", 1};

soundloop[] = {"sound", 1};

swaydecayspeed = 2;

tbody = 100;

texturetype = "default";

type = 1;

uipicture = "\A3\weapons_f\data\UI\icon_regular_CA.paa";

useaction = 0;

useactiontitle = "";

useasbinocular = 0;

usemodeloptics = 1;

value = 4;

weaponinfotype = "RscWeaponZeroing";

weaponlockdelay = 0;

weaponlocksystem = 0;

weaponpoolavailable = 1;

weaponsoundeffect = "";

weight = 0;

class Library {

libtextdesc = "LONG DETAILED WEAPON DESCRIPTION HERE";

};

class GunClouds {

access = 0;

cloudletaccy = 0;

cloudletalpha = 0.3;

cloudletanimperiod = 1;

cloudletcolor[] = {1, 1, 1, 0};

cloudletduration = 0.05;

cloudletfadein = 0;

cloudletfadeout = 0.1;

cloudletgrowup = 0.05;

cloudletmaxyspeed = 100;

cloudletminyspeed = -100;

cloudletshape = "cloudletClouds";

cloudletsize = 1;

deltat = 0;

initt = 0;

interval = -0.02;

size = 0.3;

sourcesize = 0.02;

timetolive = 0;

class Table {

class T0 {

color[] = {1, 1, 1, 0};

maxt = 0;

};

};

};

class WeaponSlotsInfo {

allowedslots[] = {901};

mass = 4;

class MuzzleSlot {};

class CowsSlot {};

class PointerSlot {};

};

class GunParticles {

class FirstEffect {

directionname = "Konec hlavne";

effectname = "RifleAssaultCloud";

positionname = "Usti hlavne";

};

};

class Single: Mode_SemiAuto {

aidispersioncoefx = 1.4;

aidispersioncoefy = 1.7;

airateoffire = 2;

airateoffiredistance = 500;

artillerycharge = 1;

artillerydispersion = 1;

autofire = 0;

begin1[] = {"A3\sounds_f\weapons\Trg20\trg_single_1.wav", 2.51189, 1, 1200};

begin2[] = {"A3\sounds_f\weapons\Trg20\trg_single_2.wav", 2.51189, 1, 1200};

begin3[] = {"A3\sounds_f\weapons\Trg20\trg_single_3.wav", 2.51189, 1, 1200};

burst = 1;

canshootinwater = 0;

closure1[] = {"A3\sounds_f\weapons\closure\closure_rifle_2.wav", 3.16228, 1, 500};

closure2[] = {"A3\sounds_f\weapons\closure\closure_rifle_3.wav", 3.16228, 1, 500};

dispersion = 0.00093;

displayname = "Semi";

ffcount = 1;

fffrequency = 11;

ffmagnitude = 0.5;

flash = "gunfire";

flashsize = 0.1;

maxrange = 500;

maxrangeprobab = 0.2;

midrange = 250;

midrangeprobab = 0.7;

minrange = 2;

minrangeprobab = 0.3;

multiplier = 1;

recoil = "recoil_single_trg";

recoilprone = "recoil_single_prone_trg";

reloadtime = 0.065;

requiredoptictype = -1;

showtoplayer = 1;

sound[] = {"", 10, 1};

soundbegin[] = {"begin1", 0.333, "begin2", 0.333, "begin3", 0.333};

soundbeginwater[] = {"sound", 1};

soundburst = 0;

soundclosure[] = {"closure1", 0.5, "closure2", 0.5};

soundcontinuous = 0;

soundend[] = {};

soundloop[] = {};

texturetype = "semi";

useaction = 0;

useactiontitle = "";

weaponsoundeffect = "DefaultRifle";

};

};

class BG_Shotgun : Shotgun {

scope = 2;

};

};

class CfgMagazines {

/*external*/ class 8Rnd_B_Beneli_Pellets; //Ill keep all this info here for you

class BG_Pellets : 8Rnd_B_Beneli_Pellets {

ammo = "8Rnd_B_Beneli_Pellets";

count = 8;

descriptionshort = "Shotgun Pellets";

displayname = "8Rnd Beneli Pellets";

initspeed = 930;

lastroundstracer = 0;

picture = "\Shotgun\textures\Pellets_CA.paa"; //Mag UI images are 256x256

model = "\Shotgun\models\pellets.p3d";

scope = 2;

tracersevery = 0;

};

};

class CfgAmmo {

/*external*/ class CA_Magazine;

class BG_Pellets : CA_Magazine {

airfriction = -0.001425;

caliber = 0.5; //1 = 7.76.......or something like that

cost = 1;

deflecting = 20;

hit = 10; //damage?

indirecthit = 0;

indirecthitrange = 0;

model = "\Shotgun\models\pellets.p3d"; //keep this

nvgonly = 1;

tracerendtime = 1;

tracerscale = 1;

tracerstarttime = 0.05;

};

};

Share this post


Link to post
Share on other sites

SOOO, I'm guessing you followed my tutorial, judging by the crappy Config XD. (Either that or that person followed mine) As far as the weapon not facing the right direction. You should just be able to rotate it in O2. When you open O2 it should be facing the left I believe. Also does your gun actually have the ammo working? or will it just not shoot Period.

Share this post


Link to post
Share on other sites

Yeah i followed your whole tutorial Zach it's the easiest and best i have seen. The gun just won't fire at all, I have it now facing the right direction even though it's still not placed correctly in my hands but thats my end i need to configure. I have the ammo showing up and also reload the gun with it but it just will not shoot. Could it be something with the ammo that stops it firing? I also get a "no entry firelightdiffuse" in my config blah blah but i don't see anything like that in any config.cpp file even in the arma files so god only knows what that is about. I really want to get this first weapon working as I'm modeling a fair amount of old weapons.

Share this post


Link to post
Share on other sites

Do you have all proper memory points? You have a lot of stuff in your config that you really shouldn't need. Zach's tutorials are awesome, so you shouldn't of had any problems, very easy to overlook small stuff ;). More than welcome to PM me and ill help you

Share this post


Link to post
Share on other sites
Hmmm I've never had any if these issues. Do you have your moment LODs named right for the barrel?

Yeah i have the memory LODs on the barrel the konec hlavne and the usti hlavne are on the barrel i have even tried moving them to the end of it with the usti hlavne just out of the barrel but still no joy.

---------- Post added at 10:36 ---------- Previous post was at 10:33 ----------

Do you have all proper memory points? You have a lot of stuff in your config that you really shouldn't need. Zach's tutorials are awesome, so you shouldn't of had any problems, very easy to overlook small stuff ;). More than welcome to PM me and ill help you

Yeah i know it must be something my end that is stopping this from working correctly as i have not seen anyone with these sort of problems but i have checked and double checked my work to see if i missed anything from the tutorial but have yet to see anything. I would upload my .p3d file if i could but i don't have the permissions as of yet to upload. I will gladly PM you and see if anything can be done to get this to work in game what info do you want Warlord554?

Share this post


Link to post
Share on other sites

Is there anything specific i need to know when moddeling the weapon? Such as how many objects and whats the maximum poly's that the game will allow ect. I make the models in blender and apply the textures but export them all as one object to .p3d as i have the addon for it. Just needing to know to make sure i did not mess up with the model before hand also does the weapon itself need any animation doing to it before hand?

Share this post


Link to post
Share on other sites
Do you have all proper memory points? You have a lot of stuff in your config that you really shouldn't need. Zach's tutorials are awesome, so you shouldn't of had any problems, very easy to overlook small stuff ;). More than welcome to PM me and ill help you

Yeah this config sucks lol. It what I have in my tutorial, but it was when I very first learned. I really need to upload better ways for configs...

And the polys shouldn't be an issue with this. But I think the max is like 15000. But if you do use that many you should make a smaller LOD too in my opinion.

Share this post


Link to post
Share on other sites

@scottieo33

If you can put everything in a folder, privately pm me the upload and ill fix it for you, along with detailed info on your errors so that you can learn from it :)

@zachgibson22

Your config is great buddy, helped me a lot. I like it because it gives you more options than a standard config. I just think it might be overwhelming for what he is trying to do. You keep on being a rock star brother!!! :)

Share this post


Link to post
Share on other sites

Hey bud, no i never got it figured out but Warlord made some changes and sent me a working version of mine but i have had no further luck with getting any to fire at all lol. What do you mean about the magazine and ammo parameter? any chance you could give me a look at a none working then working code snippet? I have just been creating different models ready for when i get something working for them. It's not as easy as you would think to get a gun to fire.

Share this post


Link to post
Share on other sites

@scottieo333 did you open my working pbo version and look at the working config?

Share this post


Link to post
Share on other sites

Yeah i did mate but the config.cpp in there was different to the config.cpp in the source files you sent but still pretty easy to get to terms with but there was nothing in the ammo selection part in either files so i just thought that's how it was meant to be. But just tested inputing the magazine into the ammo and got it to use the bullet and fire with sound but there was no bullet hole in the ground or any surface i have tried ( this is a separate model from the shotgun ) also i seems to have the muzzle flash constantly on the weapon. What in O2 or the config would cause that to happen? if you have any idea that is.

Share this post


Link to post
Share on other sites

Yea buddy I made custom ammo for you. But glad you figured it out. The bullet holes depend on the ammo your using, if its standard A3 mags then it should show up, if its your custom ammo then you need to inherit the base ammo classes for those calibers, which inturn inherits the hitEffects. The muzzleflash is simple, in your config look for selectionFireAnim = "muzzleFlash". I bet yours still has zasleh. Also in your model lod it should have a muzzleFlash selection that's directly connected to your muzzle_flash proxy. If it still says zasleh then rename it to muzzleFlash also.

Open the folder I sent you, look at the cfgAmmo, and cfgMagazines and you will see what I mean with your ammo inherits.

Easy fix for muzzleflash would be open the A3 sample weapon model, click the muzzle_flash proxy selection, ctrl+c, then crtl+v(paste) it into your model. Move it where you want it and check your config like I described. :)

Edited by WarLord554

Share this post


Link to post
Share on other sites

If you keep having issue with the ammo:gun not shooting add me on steam zachgibson222 and I can walk you through it.

Also I'll try and upload what I have so far of the videos of me putting a gun ingame. It has basically everything so far exactly the hand animation

Share this post


Link to post
Share on other sites

@Zachgibson: I added you on steam just in case i ever needed you.

I now have a new question if anyone can help me out it's about adding a scope/attachments to my weapons. How do i go about making them work correctly i have created a basic scope looking attachment but what sort of things would i need to do in O2 and the config files to make it actually work? Would i also need to create a rail on the top of my weapon so that i may add other scopes to it? and if i do then how would i go about doing that also?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×