Where are object components defined

Making or wanting help making your own asset? Check in here
Post Reply
Piipu
Posts: 50
Joined: 2009-06-20 19:59

Where are object components defined

Post 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?
Image
MY STRONG PC SPECTS
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Where are object components defined

Post 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
Image

Mineral: TIL that Wire-guided missiles actually use wire
Piipu
Posts: 50
Joined: 2009-06-20 19:59

Re: Where are object components defined

Post 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.
Image
MY STRONG PC SPECTS
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Where are object components defined

Post 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).
Image

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

Post by Danesh_italiano »

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.
Post Reply

Return to “PR:BF2 Community Modding”