Jump to content
Sign in to follow this  
JDog

lock-on bullets possible?

Recommended Posts

So I been toying with configs most of today playing around with stuff, then I tried seeing if this was possible.

I tried creating my own weapon/magazine/ammo classes. They're able to lock on to IR, air, and laser targets.

I made the inherited classes on the M107 stuff... not sure its even possible to create "guided bullets" even with config editing, or at least I can't figure out how to give them "thrust" (which I guess is just reserved for missiles?) or at least make them frictionless so they don't drop lol. Changing their maneuvrability doesn't seem to do anything either.

Before I go on to my next idea later on of trying to make it fire a missile-class weapon with the model of a bullet... someone please stop me if its not possible.

Any thoughts or suggestions are much appreciated :)

Edited by JDog

Share this post


Link to post
Share on other sites

you can make the M107 with guided ammo. its possible from what i understand., what you need to do is,

rewrite the config for the M107 model. make it inherited its class from Missilecore instead of Guncore or whatever the names are.

now just make your custom Ammo cfg with Hellfire as base or any other guided ones.

set the M107's ammo as the model for your ""guided ammo"".

make a Magazine cfg and it should work..

for missiles there is also thise you need to set in your ammo config

initTime = 0.15; // time before engine starts. in sec

thrustTime = 10; // how long engine is on in sec

thrust = 75; // Thrust force.

timeToLive=20; // how long the missile lives "tracks" before it explodes. in sec

hope this helps a bit,,

Share this post


Link to post
Share on other sites

Thanks. Once I had tried making the new weapon inherited from MaverickLauncher and just making it use the M107 model, but it stayed on the characters back and he brought up his hands as if holding a missile launcher. I added those variables to the bullet class also hoping it might work but yea it doesnt. Would like to know why it works for missiles but not bullets, but not really possible to tell with just looking at configs.

_______________________

And yea it's M107 : Rifle : RifleCore : Default

and *** : MissileLauncher : LauncherCore : Default

___________________________________

I'll try this again some tomorrow probably. Making child classes of preexisting launcher/missile classes and just changing damage/model would seem easiest, but like I said that whole animation stance is the issue. Who knows, maybe I did somethin wrong and will get lucky next time.

Also just off-topic real quick, out of curiosity... where is all the nuts-and-bolts code of the game? Like what if you wanted to define a new kind of lockable target (like irLock, laserLock, etc) and make canLock able to recognize it? Is that stuff accessible/moddable?

Thx again Nux

Share this post


Link to post
Share on other sites

Okay so... progress:

I *think* it totally works... I got the ammo off a missile base, changed the model, all sounds and effects back to that of the M107 round, keeping the essential missile parts of course. I know the thrust is working, because when I fire it, it doesn't lose altitude, however... I have to face the ground to fire it.

The weapon is on my back. If I set simulation = "shotBullet", my character holds the gun appropriately in his hands and you can see what you're locking on to, however then the projectile doesn't take on the thrust values (and im supposing neither the flight-correction stuff either). If I set simulation = "shotMissile" then the thrust works, and probably the tracking also if I could aim at something.

So right now... I'm trying to figure out how to keep simulation at shotMissile and make the character hold the weapon correctly.

---------- Post added at 09:32 PM ---------- Previous post was at 08:56 PM ----------

Yup, set type = 0; so I can actually aim it and fire... the bullets correct flight path and track, works fine.

However it still has to be set to the missile simulation, and so the m107 is on the back and he's holding an invisible weapon. Sorry if I'm repeating myself, just confirming it works and that is the problem.

Any ideas on how to get him to hold it correctly?

Share this post


Link to post
Share on other sites

Just out of curiosity, which missile did you use?

And I'm sure you know, but for others

Here are some good reads to help.

Namely CfgAmmo, and CfgWeapons Config References.

Edited by Big_Daddy

Share this post


Link to post
Share on other sites

Hellfire missile as base class. Here's my ammo config for your viewing/testing pleasure:

class CfgAmmo {
class M_Hellfire_AT;

class ProtoAmmo : M_Hellfire_AT {
	hit = 26;
	indirectHit = 3;
	indirectHitRange = 0.01;
	airLock = 1;

	simulation = "shotBullet"; // must be "shotMissile" to be guided
	//simulationStep = 0.05;
	tracerScale = 1.5;
	tracerStartTime = 0.1;
	tracerEndTime = 2.3;
	model = "\ca\Weapons\Data\bullettracer\tracer_red";
	visibleFire = 20;
	audibleFire = 22;
	visibleFireTime = 3;
	muzzleEffect = "BIS_Effects_HeavySniper";
	maneuvrability = 20; // not sure if this changes from default
	maxSpeed = 300; // doesn't seem this changes projectile speed
	timeToLive = 10;

	initTime = 0;
	thrustTime = 3.25;
	thrust = 130;

	proxyshape = "";
	CraterEffects = "";
	explosionEffects = "";
	effectsMissile = "";

              // all bullet sounds here
      };

};

Share this post


Link to post
Share on other sites

yeah, I started tinkering as well.. I got the M107 to lock on to air/ground vehicles. but didn't get the bullet to track.. it's likely that only certain config's are read for different base classes.

Here's what I came up with...

Class CfgPatches
{
class weapon_upgrade
{
units[] = {};
weapons[] = {};
requiredAddons[] = {"CAWeapons","CAWeapons2"};
};
};
class CfgAmmo
{
class BulletCore;
class BulletBase: BulletCore
{
};
class B_127x99_Ball: BulletBase
{
};
class B_127x99_Ball_noTracer: B_127x99_Ball
{
 canLock=2;
 hit = 1000; <- changed to determine hit or not. :)
 indirectHit = 50;
 indirectHitRange = 8;
 maneuvrability = 14;
 simulationStep = 0.002;
 trackOversteer = 0.85;
 trackLead = 0;
 airLock = 1;
 irLock = 1;
 cost = 10000;
 timeToLive = 15;
 sideAirFriction = 0.75;
 maxSpeed = 750;
 initTime = 0.25;
 thrustTime = 2;
 thrust = 1050;
 fuseDistance = 50;
 whistleDist = 16;
 maxControlRange = 4000;
 explosive = 0.4;
 visibleFire = 0.07;
 audibleFire = 0.07;
 airFriction = "";
 muzzleEffect = "BIS_Effects_HeavySniper";
 explosionEffects = "";
};
};
class Mode_SemiAuto;
class Mode_FullAuto;
class Mode_Burst;
class CfgWeapons
{
class RifleCore;
class Rifle: RifleCore
{
};
class m107: Rifle
{
 canLock = 2;
 laser = 1;

};
};

Share this post


Link to post
Share on other sites

lol turning your rifle into a laser as well so you can paint your own targets? :P that's cheating! haha.

but yea, im 99% sure the entire problem revolves around the simulation value. im not sure how simulation works and cant really find any info on it so... at a dead end for the time being.

my last idea was to try forcing the animation whenever the weapon is the current weapon, but then idk if that would keep it on his back or put it in his hands, i'll give it a shot tomorrow.

Share this post


Link to post
Share on other sites

I'm still coming up dry with what the "simulation" value actually does, no real info of it on the wiki that I can find, just what values go to what classes. Anyone have any knowledge with this and care to share? That an simulationStep

Hmm... either I'm goin crazy or my exact code that worked a few days ago, the one posted up there, no longer works. Maybe something from the patch affected it, idk, but now it only works if I take out the "model" argument so it stays as the hellfire. It will track, but won't even show the model lol. Think I need to give this a break and start from scratch again some other time...

Edited by JDog

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  

×