Page 1 of 1
Where are object components defined
Posted: 2016-04-23 19:10
by Piipu
I'm trying to understand how AA missile homing works. I loaded up the editor, and see that all homing missiles have a Seek component, as well as some other possible places where the actual homing code might take place. However I can't find where these components are defined. Are they scripts in some folder where I can edit them, and is there some way to locate them easily without knowing where they are beforehand? Or are they just predetermined parts of the engine that can't be accessed in any way?
Re: Where are object components defined
Posted: 2016-04-23 20:49
by Mats391
That is somewhere in the dlls and exe. We only have access to the code that defines the behavior like the stuff you found.
The SeekComponent defines what the missile follows. There you have these settings:
Code: Select all
objectTemplate.seek.directionBonus float -> float
objectTemplate.seek.maxAngleLock float -> float
objectTemplate.seek.maxDistLock float -> float
objectTemplate.seek.reLockTime float -> float
objectTemplate.seek.targetType TargetType -> TargetType
objectTemplate.seek.targetType TargetType -> TargetType
objectTemplate.seek.trackingDelay float -> float
objectTemplate.seek.trackingDelay float -> float
The other part is the FollowComp this defines how far the missile can turn and how well it does it:
Code: Select all
objectTemplate.follow.changePitch float -> float
objectTemplate.follow.changeYaw float -> float
objectTemplate.follow.maxPitch float -> float
objectTemplate.follow.maxYaw float -> float
objectTemplate.follow.minDist float -> float
Re: Where are object components defined
Posted: 2016-04-23 21:26
by Piipu
Well that's disappointing to hear. I was hoping there would've been some way of making sure how they work, as nobody seems to know what the directionBonus variable means exactly. I don't suppose there's any way of adding customized script components to objects either? It might be interesting to see if I can come up with a better homing system than the current one.
Re: Where are object components defined
Posted: 2016-04-23 21:43
by Mats391
Piipu wrote:Well that's disappointing to hear. I was hoping there would've been some way of making sure how they work, as nobody seems to know what the directionBonus variable means exactly. I don't suppose there's any way of adding customized script components to objects either? It might be interesting to see if I can come up with a better homing system than the current one.
BadSanta has some success with injecting into DLLs to change Bf2 drastically. But these things are mostly done for single player only.
Another way is to use CheatEngine or something similar to find out which code access the values defined in .tweak. However that will require to go through assembly etc. Also not really a nice way to do things.
The most reasonable way sadly is trial and error

One issue with that is having things to test with. Bots are not really ideal as they react weirdly to AA (e.g. they instantly flare on lock).
Re: Where are object components defined
Posted: 2016-04-24 18:58
by Danesh_italiano
ops, sorry, wrong post.