Where are object components defined
-
Piipu
- Posts: 50
- Joined: 2009-06-20 19:59
Where are object components defined
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?
MY STRONG PC SPECTS
- Mats391
- PR:BF2 Lead Developer
- Posts: 7643
- Joined: 2010-08-06 18:06
Re: Where are object components defined
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:
The other part is the FollowComp this defines how far the missile can turn and how well it does it:
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 -> floatCode: 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
Mineral: TIL that Wire-guided missiles actually use wire
-
Piipu
- Posts: 50
- Joined: 2009-06-20 19:59
Re: Where are object components defined
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.
MY STRONG PC SPECTS
- Mats391
- PR:BF2 Lead Developer
- Posts: 7643
- Joined: 2010-08-06 18:06
Re: Where are object components defined
BadSanta has some success with injecting into DLLs to change Bf2 drastically. But these things are mostly done for single player only.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.
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

Mineral: TIL that Wire-guided missiles actually use wire
-
Danesh_italiano
- Posts: 576
- Joined: 2012-07-23 03:25
Re: Where are object components defined
ops, sorry, wrong post.
Last edited by Danesh_italiano on 2016-04-24 19:03, edited 1 time in total.
I only know that I know nothing. Só sei que nada sei. Sólo sé que no sé nada. So solo di non sapere nulla. Tantum scio me nihil scire. Je sais seulement que je ne sais rien. Tiedän vain, etten tiedä mitään. Ich weiss nur dass ich nichts weiss. Ek weet net dat ek niks weet nie. Wiem tylko, ?e nic nie wiem. Heoi ko ahau anake e mohio ana kahore au e mohio. Ngiyazi kuphela ukuthi angazi lutho.
