Jump to content

Recommended Posts

I wonder if it is possible to get the initial speed of a bullet before shooting it.

 

I think about writing an aiming help for moving targets where a crosshair is drawn at the point that u have to shoot at to get a hit.

Share this post


Link to post
Share on other sites

Check this out: CfgWeapons Config Reference: initSpeed. So if this value is greater than zero, you simply take it. Otherwise you take value from CfgMagazines' subentry's "initSpeed" and multiply it by initSpee's absolute value.

Also, take any muzzle attachments into account, e.g. check for getNumber(configfile >> "CfgWeapons" >> "muzzle_snds_H" >> "ItemInfo" >> "MagazineCoef" >> "initSpeed") if you have such attachment and multyply your speed by this parameter.

  • Like 1

Share this post


Link to post
Share on other sites

Thx for ur reply. I will crawl all of that information soon.

 

Another related question came to my mind was about wind.

Do we have any wind simulation on bullets implemented in arma 3 or should i use this Bullet-Wind Interaction System in my mission for it?

 

Edit: How can I change name of topic and bound tags in this forum?

Share this post


Link to post
Share on other sites

thats working great pedeathtrian thank u again.

 

now i ve a few more questions.

1. some weapons initSpeed is equal 0. i think taking magazines init speed is correct then, right?

2. the muzzle i tested had initSpeed 1.05 that means the bullet is faster with it. i thought it should get slower with a muzzle. why is it faster? wrong simulation or wrong thoughts in my mind?

3. is it possible to get bullets negative acceleration value to calculate a better value for its flight time?

Share this post


Link to post
Share on other sites

thats working great pedeathtrian thank u again.

 

now i ve a few more questions.

1. some weapons initSpeed is equal 0. i think taking magazines init speed is correct then, right?

2. the muzzle i tested had initSpeed 1.05 that means the bullet is faster with it. i thought it should get slower with a muzzle. why is it faster? wrong simulation or wrong thoughts in my mind?

3. is it possible to get bullets negative acceleration value to calculate a better value for its flight time?

I assume that speed increasing muzzle is a suppressor? Then yeah, that's how they often work. 105% may be a little exaggerated though.

 

There's a 'airFriction' value in the ammo configs, but I don't know the formula behind it. Possibly just m/s2.

  • Like 1

Share this post


Link to post
Share on other sites

There's a 'airFriction' value in the ammo configs, but I don't know the formula behind it. Possibly just m/s2.

 

I dont know but beside arma air frictions unit is usualy Newton.

 

N = kg*m/s²

 

That would mean I could just devide that value by the bullets weight. But I cant find that weight in the config references. Any suggestions about it?

 

EDIT: There is a weight=0 in cfgMagazines but what does it mean? i think i ve to test which values it provides.

Edited by sarogahtyp

Share this post


Link to post
Share on other sites
Guest

Can't you get the speed with event Fired ?

Share this post


Link to post
Share on other sites

Can't you get the speed with event Fired ?

no, i need the speeds b3fore fireing the bullet as u can read in my first post.

Share this post


Link to post
Share on other sites
Guest

And ? You can find speeds in editor before including it in your mission ;)

Share this post


Link to post
Share on other sites

And ? You can find speeds in editor before including it in your mission ;)

 

for every weapon from every addon combined with every Magazin, ammo and muzzles? I dont think so. Crawling configs is the only way here I think.

Share this post


Link to post
Share on other sites

I dont know but beside arma air frictions unit is usualy Newton.

 

N = kg*m/s²

 

That would mean I could just devide that value by the bullets weight. But I cant find that weight in the config references. Any suggestions about it?

CfgAmmo subentries have airFriction, which descriptions looks very much like it's acceleration applied to projectile by air resistance force (so its mass already counted). Not sure about units though. It also could be just coefficient applied to projectile's speed on each simulation step.

Share this post


Link to post
Share on other sites

I use this to get initSpeed of the weapon:

_init_speed_gun = getNumber(configfile >> "CfgWeapons" >> (currentWeapon player) >> "initSpeed");

what is the correct way to do this for the ammo if i want to extract airFriction via cCfgAmmo ?

The problem is that i cant find something like 

currentAmmo player

or

currentAmmo currentWeapon player

Short:

How can I access the airFriction value in CfgAmmo ?

Share this post


Link to post
Share on other sites

 

I saw those commands but I dont have a clue how to crawl cfgAmmo with it because it doesnt provide ammos classname.

Or should I use the magazine classname for it? like this:

_air_fric = getNumber(configfile >> "CfgAmmo" >> (currentMagazine player) >> "airFriction");

cant imagine that this is correct, is it?

Edited by sarogahtyp

Share this post


Link to post
Share on other sites

Seems about right to me... :) But I don't have my PC around to actually test it.

Share this post


Link to post
Share on other sites
_air_fric = getNumber(configfile >> "CfgAmmo" >> (currentMagazine player) >> "airFriction");

thats not working sadly. I tried isNumber  with "airFriction" and "cost" and it returned false. I tried getText with "model" and it returned nothing...

any help how to get values from CfgAmmo would be appreciated.

Share this post


Link to post
Share on other sites

CfgMagazines' subentries have ammo.

_air_fric = getNumber(configfile >> "CfgAmmo" >> (currentMagazine player) >> "airFriction");

should be

_air_fric = getNumber(configFile >> "CfgAmmo" >> getText(configFile >> "CfgMagazines" >> (currentMagazine player) >> "ammo") >> "airFriction");
  • Like 1

Share this post


Link to post
Share on other sites

that was really enlightened, thank u.

 

Is there any tutorial about those config stuff out? 

I d like to learn the basics of it cause its essential I think.

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  

×