Jump to content
Sign in to follow this  
Fortran

Affect irTarget

Recommended Posts

Hi guys,

Is there any way of manipulating the config setting "irTarget" via script? I currently have it set to "false" for the F-117A which prevents missile lock and it showing on enemy radar, however I want to switch it to "true" when the weapon bay doors are open or the gear is down. I have a nice setup with the RCS light illuminating on the eyebrow switches when the doors or gear are open but without actually changing the RCS of the plane when those two things occur its no more than a nice visual effect.

If it is not possible to switch this value, perhaps an alternative might be to attach an invisible vehicle with irTarget = true; to the F-117A when the doors/gear are open ? Is that a viable option failing the first choice ?

Thanks for any help (yet again! :) )

Edited by Fortran

Share this post


Link to post
Share on other sites

The alternative sounds very doable.

How are the doors opened - gear status is not possible to truck I think.

Might be wrong though on this one.

Share this post


Link to post
Share on other sites

I think your right, because trying to track the gear itself usually results in a non-working script, however I have a secondary animation also using "gear" as an animationsource which animates the internal cockpit lever when the gears go up/down so I am using that in any scripts I need to track changes to the landinggear. I have this short script tracking changes to the landing gear and weapon bay doors which in-turn illuminates or turns off the relative eyebrow switch:

_plane = _this select 0;
while {(alive _plane)} do
{
_Bayphase = _plane animationPhase "WeaponBayDoorLeft";
_Gearphase = _plane animationPhase "GearIndicator";


//eyebrow
_OnOff = isEngineOn _plane;   

if (_OnOff) then {

if ((_Bayphase > 0.01) || (_Gearphase < 0.99)) then {_plane setobjecttexture [8,"\f117a_nighthawk\TESTTEXTURES\EYEBROW_RCS_ON.paa"];
} else {
_plane setobjecttexture [8,"\f117a_nighthawk\TESTTEXTURES\EYEBROW_ALLOFF.paa"];
}; 
} else {
_plane setobjecttexture [8,"\f117a_nighthawk\TESTTEXTURES\EYEBROW_ALLOFF.paa"];
}; 

sleep 0.5;
};

So its all in-place, all I need to do is switch "on" the ability for the vehicle to be targeted when those are true.

Do you think attaching a secondary vehicle with irTarget = true when those conditions are met is my only option for enabling it ? Alternatively, even simpler, I suppose I could just create and attach a laserTarget via script.

Thanks for replying Kju.

Edited by Fortran

Share this post


Link to post
Share on other sites

Unfortunately we cannot change config-variables on the fly for specific objects. I just hope that we'll get the option to do so eventually, since the game has to create an instance of a class anyway when an object is created with pointers to the class. Shouldn't be too hard to let one redefine variables, but oh well.

Whether you attach create an irTarget or laserTarget object it is the only workable universal solution(s) at the moment.

Share this post


Link to post
Share on other sites

Ok thanks very much Inkompetent, will go with the separate attached vehicle approach I think. Thanks to both of you for your help with this, much appreciated.

Edit: Just as a follow-up does anybody have an outlline for an "empty-vehicle" config that I could use? Or could I simply replicate the majority of a normal plane class and just create an empty or invisible p3d? Also how to prevent that new empty vehicle from showing up in the editor?

Edited by Fortran

Share this post


Link to post
Share on other sites

Even though it isn't optimal in the end you can do a proof-of-concept test with the deleteCollection command, I think. Not entirely sure, but I think it effectively deletes the visual lods, geometry lod, fire lod, and maybe even more.

Share this post


Link to post
Share on other sites

Ahh yeah, just gave it a test and it does indeed delete everything in the model itself but still utilizes the config so it is still targetable. Many thanks this will do for testing for now!

---------- Post added at 09:03 PM ---------- Previous post was at 08:30 PM ----------

Ok well have just run some tests. Created an empty vehicle (just a simple white box for visual testing) with its irTarget setting set to true. Placed it in the editor and yes, its lockable. Tried attaching it to the F117A with attachto and it unfortunately inherits itself from the F117A and becomes un-lockable again. Attaching the F117A to the Target makes it lockable again, but then obviously the plane cannot move as its anchored to an unmoving object. Looks like I am going to have to go with spawning a laserTarget (or 2 maybe one for OpFor one for Civ ?) and attaching that instead.

---------- Post added at 09:39 PM ---------- Previous post was at 09:03 PM ----------

Ok well after further testing im stuck again. It is not possible to use the attachto command as the vehicle or lasertarget becomes un-lockable when doing so. This only leaves getPos / setPos which works and indeed the invisible target vehicle I created moves with the F117A, however as the invisible vehicle is "empty" ie. it has no pilot/driver, it is still not possible to lock it. I basically need to create an indistructible, invsible pilot to "sit" inside the invisible target vehicle before any Opfor will lock-on to the vehicle. Anybody have any ideas on how to create an invisible un-killable pilot ?

Share this post


Link to post
Share on other sites

Search for Lester's/Mapfact's invisible targets addon.

It contains all different sorts of these helper objects for your purpose.

Share this post


Link to post
Share on other sites

Magic thanks Kju, will take a look and most likely utilize the same technique to create my own. Thanks again.

Share this post


Link to post
Share on other sites

Does that mean that attachto does more than simply position one object on another? Does it actually make one object part of another including the associated config setup? That's pretty cool, I wonder if that could be used somehow to do something interesting.

Share this post


Link to post
Share on other sites

Hi Sakura, I am not %100 sure of the influence one attached object has on another in terms of inheritance but from testing this idea in this thread it became quite obvious quite fast that using the attachto command overrode any values that the vehicle being "attached" to the other vehicle had. I can't tell at this point whether the attached vehicle inherits anything from the vehicle its attached to or whether it rather just becomes nothing more than just a simple "model" with no configuration values while its connected.

As a side note I now have this working quite nicely using the same invisible target method Kju linked me to in the mapfact pack. Albeit a little "different" to having just a single vehicle with irtarget=true, it kind of adds to the "stealth" aspect a little as the lock occasionally drops or stutters making it slightly harder to bring the plane down with G2A or A2A missiles while the doors or gear are open. Although now it is quite possible to do so when either of those two conditions are true. Might now go an extra step and also allow locking while the jet is in high ranges of pitch or bank, which apparently also increases the RCS.

Anyway thanks again for the help guys, really appreciated.

Share this post


Link to post
Share on other sites
Does that mean that attachto does more than simply position one object on another? Does it actually make one object part of another including the associated config setup?

Pretty sure thats - No

I've been doing this ATTACHTO "fake target" trick now for a while on my Subs (ie surfaced vs submerged)

The simple principle is to present AI and players a "real" target that is physically inside the Sub (or plane in Fortran's case) such that any weapon round targeted and shot at the "fake" invisible target actually ends up hitting the main vehicle.

One side effect is you have to manually destroy/delete the fake target if the main vehicle is destroyed. I'm yet to check if the Point Scoring is working ok (but I consider that minor) and the AI re-targeting works ok.

EDIT: btw Fortran, you may want to try the Proxy method I'm playing with myself at the moment (ie. attach a target via proxy instead of attachto). This in theory gets ride of any lag or stutter problems of attachto.

Edited by [APS]Gnat

Share this post


Link to post
Share on other sites
Gnat;1430702']

EDIT: btw Fortran' date=' you may want to try the Proxy method I'm playing with myself at the moment (ie. attach a target via proxy instead of attachto). This in theory gets ride of any lag or stutter problems of attachto.[/quote']

Ahh nice! Thanks for the tip mate, will give that a try next, I take it just simply using a hide animation on the proxy would provide the same system of enabling/disabling the fake target when I need to ? The stutter has actually got a million times better since I changed the fake target to a "Strategic" class instead of "plane" which I was mistakenly using before. However your method sounds much more reliable and obviously requires no continuous script to update the position so I will definitely try that.

Another small thing you might be able to shed some light on is the fake target geometry, at present I am using a copy of the F-117a's geometryLOD so as to mirror the same surface area as the plane but with a very low polygon count, however for the target to actually get picked up and locked it needs to be slightly outside of the main geometry, otherwise no lock will occur. I have also tried several other geometry shapes (only defined in the FireGeometry LOD of the target, main lod is empty obviously) for the fake target but none seem to work as well as the copy of the geomlod. You mentioned that you have your fake target "inside" the submarine, what kind of geometry shape are you using for the target? I have tried everything from a simple small box, large box (around the plane), a matrix of boxes, before finally settling on the copy of the geometrylod of the F117A. The shape and the position outside of the planes geometry seems to be integral to the ability to obtain a lock for me.

Anyway many thanks Gnat, will def. give the proxy method a go as it sounds far superior to the method I am currently using.

Share this post


Link to post
Share on other sites
This in theory gets ride of any lag or stutter problems of attachto.

Yeah, I'm begining to think attachTo isn't the "One size fits all" solution it was professed to be? At least in MP.

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  

×