Jump to content
Sign in to follow this  
AlexVestin

Rifle in launcher slot. Possible?

Recommended Posts

I haven't seen anything about it, so I'm guessing there's some restrictions somewhere. Can a rifle by config be made to equip in the launcher slot?

Here's an example of rifle from ArmA.

	class Rifle: RifleCore
{
	autoFire = 1;
	reloadAction = ManActReloadMagazine;
	soundContinuous=false;
	optics = false;

	scope = protected;
	cursor = RifleCursor;
	cursorAim = \ca\Weapons\Data\w_weapon_S;
	value = 4;
	displayName=$STR_DN_RIFLE;
	nameSound="rifle";
	reloadTime=0.15;
	modelOptics="-";
	sound[]={""};
	drySound[]={\ca\Weapons\Data\Sound\M16_cock_v1,db-70,1};
	reloadSound[]={,1,1};
	reloadMagazineSound[]={\ca\Weapons\Data\Sound\m4_reload,db-30,1};
	opticsFlare = false;
	autoReload = false;
	aiDispersionCoefX=2.0;
	aiDispersionCoefY=2.0;
	opticsZoomMin=0.22;
	opticsZoomMax=0.95;
	opticsZoomInit=0.42;
	distanceZoomMin=300;
	distanceZoomMax=300;
	maxLeadSpeed=23; // max estimated speed km/h
	canLock=LockNo;
	flash=gunfire;
	flashSize=0.5;
	dispersion=0.0001;
	recoil=assaultRifleBase;
	recoilProne=assaultRifleBase;

	ffMagnitude=0.5;
	ffFrequency=11;
	ffCount=3;
};

Here's an example of the m24 from ArmA.

	class M24 : Rifle
{
	scope = public;

	model="\ca\weapons\M24_green";
	picture="\CA\weapons\data\equip\w_m24_green_ca.paa";
	UiPicture="\CA\weapons\data\Ico\i_sniper_CA.paa";

	dexterity = 1.35;

	displayName = $STR_DN_M24;

	modelOptics = "\ca\weapons\optika_sniperw";
	opticsFlare = true;
	opticsDisablePeripherialVision = true;
	opticsZoomMin=0.025;
	opticsZoomMax=0.025;
	distanceZoomMin=300;
	distanceZoomMax=300;

	soundContinuous=false;

	sound[]={\ca\Weapons\Data\Sound\M24_single_shot_v1_A,db20,1};
	drySound[]={\ca\Weapons\Data\Sound\M21_dry_v1,db-70,1};
	reloadMagazineSound[]={\ca\Weapons\Data\Sound\M24_reload_v5a,db-50,1};

	minRange=2;minRangeProbab=0.10;
	midRange=400;midRangeProbab=0.7;
	maxRange=700;maxRangeProbab=0.05;
	dispersion=0.0001;

	magazines[]={5Rnd_762x51_M24};

	reloadTime=2;
	backgroundReload = true;
	recoil=assaultRifleBase;
	recoilProne=assaultRifleBase;

	value = NEVER_DESTROY;

	aiRateOfFire=10.0;
	aiRateOfFireDistance=800;

	class Library {libTextDesc = $STR_LIB_M24;};
};

I can't find anything about the weapons preferred slot in these, or could it be in Riflecore? I can't find that one.

Share this post


Link to post
Share on other sites
I haven't seen anything about it, so I'm guessing there's some restrictions somewhere. Can a rifle by config be made to equip in the launcher slot?

I can't find anything about the weapons preferred slot in these, or could it be in Riflecore? I can't find that one.

It would be the illogical for the system to be configured that way, The Weapon Slots are configured to only allow specific weapon types to be placed into them. In order to allow rifles to be placed into the launcher slot, the rifle would need to be created from a launcher base class and not the rifle base class, or the launcher slot will need to be reconfigured to allow rifles.

Share this post


Link to post
Share on other sites
I can't find anything about the weapons preferred slot in these, or could it be in Riflecore? I can't find that one.

Yes, it's held in class RifleCore. The parameter that defines which type of weapon the object is held as is the type = N; parameter, where N is a number.

type = 0; is for invisible throw/put type weapons

type = 1; is the primaryWeapon slot, for rifles, MGs etc

type = 2; is the Handgun slot

type = 4; is the secondaryWeapon slot, for launchers

type = 65536; are "hardmounted" vehicle weapons

type = "1 + 4"; will fill both the primary and secondary weapon slots - it used to be used for medium machineguns (hefty M60/GPMG/PKM type ones) but it's pretty superfluous now we have an improved, weight-based inventory and fatigue system.

There are also a bunch of other new types for the various uniform, helmet, goggles, weapon attachment etc. slots.

There's a lot more stuff hardcoded to the "type" simulation than which inventory slot it uses though. A unit holding a rifle configured as a "type 4" item will behave as tough they are carrying a launcher, not a normal rifle. Things like switching to primaryWeapon ("type 1") when you got prone, as happens when carrying the PCML or other launcher type weapons, will still occur.

Edited by da12thMonkey

Share this post


Link to post
Share on other sites

Alright, thank you. I see.

So you'd see some pretty weird results with the animation restrictions if you were to carry, as an example, a breaching-shotgun in the launcher slot? Not able to go prone etc.

You know if a additional "-~~-core" could be made? Like a Riflecore2, modified with an additional "type" that behaves like a rifle in all ways, but uses the launcher slot?

If the weird part mostly are the stance restrictions per type, then it might not be all too bad if you're forced to switch to your primary just because you went prone with a shotgun equipped. It's not game-breaking anyhow. But there oughta be more serious problems.

Share this post


Link to post
Share on other sites

@da12thMonkey

 

what about making a new type and assigning that new type, that consists of rifle/launchers to the weapon class

and reassigning the slot ID (931) to that type?

Share this post


Link to post
Share on other sites

AFAIK you can't make new simulations types, they are hardcoded in the game engine.

 

Assigning the 931 idc/idxc for the inventory to another type, would I imagine just change the UI detection of the object.

It wont affect how it's simulated as a weapon since use of the launcher proxy (where the item in the secondary slot is displayed on the character model) is tied to numerous hardcoded things like the animation states.

Share this post


Link to post
Share on other sites

@da12thMonkey

I have troubles finding the class which defines the type of item, but:
I have troubles believing that something is hardcoded that I ( me as an amateur ) can look into, which effectively means:
Code is only hardcoded defined by its environment, if you change the environment ( dependencies ), they it might be softcoded again.

Let us assume it is really hardcoded:
Where would be the location of this hardcoded area? are these binarized files? In the folder "Engine_core"?

In the years I realized the term "hardcoded" is used as an ultimate-monster-kill argument more often than it actually is.

Would be nice, if you can share what you you know or assume about this, thanks.

Share this post


Link to post
Share on other sites
On 31.08.2017 at 7:31 PM, kOepi (DayZ) said:


Where would be the location of this hardcoded area? are these binarized files? In the folder "Engine_core"?

Arma3.exe ;)

Share this post


Link to post
Share on other sites

@reyhard
So you want to support my theory with this ( as long as I can see it, I can change it (.cpp, .hpp, .sqf files )?
I can make another weapon type that combines rifles and launchers?
I can make another displaytype that takes rifles and launchers?

Share this post


Link to post
Share on other sites

Uhm, I said that hardcoded things are located in Arma3 executable and there is no way for end user to decompile and change it

  • Like 1

Share this post


Link to post
Share on other sites

yea, I understood that.
But you did not directly confirm or deny that the subjects of the thread is a hardcoded one.
That is why I asked two more questions - depending on your own knowledge in this field - that you can answer to confirm or deny the modifiabily of the actual subject of the thread.
That I cannot change things in the arma 3 executable ( or any game exe ) is something I knew 20 years ago ...

Share this post


Link to post
Share on other sites

Is it really so hard to follow what is being said?

 

I told you that the type parameter is processed as reference number to hardcoded simulation types, which reyhard is telling you are set inside the .exe.

So the truth if this is that the game's available simulation types cannot be modified or appended because the simulation code is not in .cpp/.hpp/.sqf/.cfg/.dll etc. etc. format accessible from any .pbo or available to modders.

 

If the .exe does not recognise the number as being one of the already coded simulation types, then it will not be able to simulate the object. As such, simply making up new type numbers like you are suggesting, will not be recognised by the engine at all.

Share this post


Link to post
Share on other sites

Thank for the answer.
I guess I lack some communication skills, understanding you determine the subject to as-far-as-you-know ( indicating that there might be something that you dont know about this ) and saying with your last post, that if I can find the definition types ( which I probably cannot ), that I can redefine them.
If I cannot find the definitions of the types, I will not be able to redefine them.

And reyhards stating generally to where hardcoded things are, but not saying whether or not it is actually hardcoded.

I guess the good old "It is hardcoded, nothing to do or understand here" argument hammered again.

Share this post


Link to post
Share on other sites

Well, I thought suggestion was  rather clear. Anyway, to clear it up -  it's hardcoded

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  

×