Sign in to follow this  
arno

Conditional display of attached objects

Recommended Posts

With gmax you can attach effects or library objects to an object.I would like to display that object depending on a condition check with IFIN, just like you can control display of gmax objects where you can just skip the DRAW_TRI commands (like described in the 'Conditional display' tip on SceneryDesign.org).However there is no code for attached objects. All there is is this:effect_crate_MasterScale_1 label BGLCODE;THIS IS MY GMAX OBJECT: MATERIAL 1,0 ; <255,255,255,255> CRATE_SIDES.BMP;;; DRAW_TRI_BEGIN 0, 8 DRAW_TRI 7, 5, 2 ; poly=2 part=1 ... DRAW_TRI 6, 9, 2 ; poly=6 part=1 DRAW_TRI_END;THESE CALLS SEEM TO BE FOR THE ATTACHED OBJECT: ; Node 3 - RotateAroundX transform: BGL_SET_MATRIX_INDIRECT 0 ; Node 5 - attachpt_LibObject transform: MATERIAL 0 ; <6,134,58,255> BGL_RETURNThe only thing that was added is that MATERIAL 0 call. If I skip any of this the attached object is still being drawn.Any ideas would be appreciated.I tried a workaround by messing with the animations as described in the "Frequency controlled animations" tutorial and just animate the object to infinity, but I can't get that to work at all. There is a BGL_ANIMATE_INDIRECT call now instead of the BGL_ANIMATE as described and if I start using IFIN to jump around it won't work at all.Matthias

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Yes, I am still working on getting the conditional animation code to work with the new ASM format :D.I understand 50% of the effect code as well, but I have no clue yet if I can add a condition to that as well. You could of course always add the conditions to the effect or the library object you are attaching (although that might not always do the job).

Share this post


Link to post
Share on other sites

Hi Arno,glad to hear you are still working on that as well. I thought there is something wrong with me since I just didn't get it to work at all.But how would you suggest adding conditions to effects or library objects ? I guess I can extract the MDL from the library object now but I would have to patch the code with a hex editor which sounds very painful. I don't think I know of any way to add a condition to an effect. If you are referring to the conditions applicable in gmax, they seem to be only for certain time events (day/night/time/date), which doesn't give enough control.Matthias

Share this post


Link to post
Share on other sites

Are you working with default objects or with objects you designed yourself? I was more talking about the last case, you can then save the ASM source form GMax and do the changes there.For effects files I am not really an expert, but if I remember correct you can code sort of conditions in there.But I will still continue learning the new source format, so I will try if it is possible to add a condition to the attachpoint.

Share this post


Link to post
Share on other sites

Yes, it is no problem with my own objects and I think I can get it to work with library objects, too, if needed.But I really want to get effects conditionalized.This has been driving me up the wall all weekend. I have tried everything. Added conditions, matrix calls, tried to attach the effect only to a certain LOD etc., but nothing works.The conclusion is that the effect and its paramteres are stored in its MDL data that is embedded in the ASM file as code and only contains a reference to the effect.It seems effects are triggered one time at bgl file load and then can be no longer messed with except for the time dependent parameters which must be hardcoded in FS and are not conditions in the bgl data.At this point I see 3 possibilities that may make this possible after more research:1) Getting the new animations working with conditions. This seems to be the most promising possibility.2) Exporting it in the FS2002 ASM format and mess with the animations as it used to work. But for that attach points have to work too and, unless I am mistaken, that was not possible with the 2002 SDK.3) Mess with the time variables internally and fake the effect into thinking it is the time frame at which it is supposed to be off.Well, I leave this alone for now but I keep trying when I come up with new ideas and workarounds.Matthias

Share this post


Link to post
Share on other sites

I have tried to add a condition to the new platform code, but there I also came to the conclusion that it is not possible to do so. It might be that for the effect files the same is true. When I continue studying that code I will have a look at it.>1) Getting the new animations working with conditions. This>seems to be the most promising possibility.I am sure that is possible. I have already done it on small scale. I need to get a better understand of the code first, because I can update my CAT tool though.>2) Exporting it in the FS2002 ASM format and mess with the>animations as it used to work. But for that attach points have>to work too and, unless I am mistaken, that was not possible>with the 2002 SDK.Nope, these are new with the new SDK and BGL format. So this option is no longer an option for you I guess :).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this