Sign in to follow this  
ShezA

SCASM gurus again, need help

Recommended Posts

Below is a code generated for a CallLibObj by FSRegen. I adjusted it by including a section after the mif(11) for density settings. Initially everything was fine and the density settings worked well. All of a sudden yesterday things began to go wrong with the 3d objects! The objects started to disappear at certain angles when one rotated around them (why this did not happen earlier I do not understand). Interestingly this happens when the density setting is set at Dense or lower. Only one object is at Very Dense setting and when Very Dense setting is set in FS then all is well and no object disappearances...Even stranger is that my own aircraft also disappears at certain angles!and even stranger, one of the Beta Testers reports no issues. Could it be that my FS is corrupted...???Here is the code,; --- Created by FsRegen v0.31bmif (0)Area( 5 %1 %2 1 )RotatedCall( :symbol 0 0 %5 )Jump( :endsymbl ):symbolRefPoint( 7 : 0.5 %1 %2 )Points( 0-44 0 -50-44 0 532240 0 532240 0 -501098 0 2)Poly( a 0 1 2 3 )Poly( a 0 4 3 )Return:endsymblEndAmifendArea( 5 %1 %2 22 )perspectivecall( :OBJ )shadowcall( :OBJ )jump( : ):OBJmif( %11 )refpoint( 2 :END %4 %1 %2 E= %11 v1= %10 %13 %14 V2= 4589 )melserefpoint( 7 :END %4 %1 %2 v1= %10 %13 %14 V2= 4589 )mifendmif( %12 )IfVarRange( : 0346 %12 2 ) mifendrotatedcall( :ROT 0 0 %5 )return:ROTcallLibobj( 0 B8902082 4F960B67 1DF0BE98 E2742DB9 ):ENDreturnEndAThanksShez

Share this post


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

I had weird problems with disappearing scenery. I increased the V2= value and it fixed the problem.

Share this post


Link to post
Share on other sites

Most of the times increasing the v2 value should work.But I also noticed an error in your source. From the density check you jump right away to the end of file ( : ), while you should jump to the Return command first ( :END ), SCASM doesn't complain about this, but it can cause FS the lock up.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi Arn,You mean in the IfVar variable?eg. mif( %12 )IfVarRange( :END 0346 %12 2 ) mifendShez

Share this post


Link to post
Share on other sites

Unfortunately, tried to increase the value of V2 to 50,000 but no joy.Very strange...it is almost like my FS is corrupted or something.Shez

Share this post


Link to post
Share on other sites

I don't know if FS likes such big v2 values :), have you also tried increasing it but 100 or so?Also, you must change it in the api I think, because I think the v2 is hard coded in FsRegen api's (not sure about that btw).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Yeah that was an extreme case :( Actually I did change the V2 in the API. I see one interesting parameter %13 %14 seem to be coded as V2.Let's try this again...Shez

Share this post


Link to post
Share on other sites

No that does not work. :-( I am really at a loss here. If I reduce the density settings of a couple of objects to Normal so that all objects are either Normal or below, the scenery works fine. As soon as I introduce an object with a higher density then things go wrong. I actually don't think that this is V2 issue.Thanks Arno for your help.Shez

Share this post


Link to post
Share on other sites

>I am really at a loss here. If I reduce the density settings >of a couple of objects to Normal so that all objects are >Hi Shez,Please use IfVarRange( : 346 %12 5 ) just after the Area(). Firstly you will skip both the object and its shadow in one go. Secondly there is a typo (2 instead of 5) which causes your objects not to appear. Think about it and you will see that FS is doing precisely what you are telling it to do!Kind Regards,Luis

Share this post


Link to post
Share on other sites

Hey Hey thanks Luis, it appears to work! Whew! I will do some more testing to confirm too. :7Thanks again all for your help.Shez

Share this post


Link to post
Share on other sites

Hi ShezYup, Luis has put you on the right lines with the main problem - it was the syntax of your IfVarRange() command.But there is also an error in the RefPoint()'s and the v2 value is probably too large, not too small. v2 is meant to represent the radius of a sphere that encloses the object, measured from the RefPoint() location, and it prevents the object being culled too soon as it moves off screen. But if the value is too large, FS will waste time trying to display the object when it really is off screen! And you have duplicated the v2 parameter by using '%13 %14' as well as 'v2= ...'. So make v2 smaller (about 1.5 x the actual 'radius' seems to work well) and delete the references to '%13 %14'.Kind RegardsGerrish

Share this post


Link to post
Share on other sites

Thanks GG,What would the actual radius be? I was using 4259?Shez

Share this post


Link to post
Share on other sites

Hi ShezThe radius depends on the size and shape of the object ...Looking at your original calling code, the 'Airport symbol' section suggests that the radius might be as high as 2250 scale units (1125 meters), but this looks odd. Is there a big ground polygon or something that causes this, or is it just a mistake?If the true radius really is this big, then the v2 value you have been using may not be too large after all, although you might get away with half the value.CheersGerrish

Share this post


Link to post
Share on other sites

Actually the object is a GMAX scene consisting of many buildings which is consistent with your comment on the size.Shez

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