Jump to content
Sign in to follow this  
Guest

IfVarRange.... Strange behaviour....

Recommended Posts

Guest

Hi AllAs I near the compleation of my scenery, I have been trying to arrange the detail at different levelsA lot of my scasm file as a IfVarRange() command for a given Area() section, however if I try to add an additional IfVarRange() for example, showing a building and may be the steps at a different complexity level, the programming falls over!!! However, when I delete the modifications I made, the complexity settings seem to be permanantly affected, even after recompiling.It is almost as if the previous (higher up the file) IfVarRange() command is now controlling the display complexity.Obviously it may be my programming that may be the problem, as I am still striving to command the language and I have cut and paste a section here, although I must tress this file is quite large.(See Below)I have previously overcome this problem, by including one section of a Area() to endA() section within another Area()endA, which seemed to be controlling the one below!!!I hope someone can understand, or has had similar problems and even put me straight on my programming, loops and etc!!!!RegardsDave;------------------------------------------------------------------------; Office;------------------------------------------------------------------------ Area( 5 52:37:55.598862 -03:09:1.368915 5 ) ; Start of library call IfVarRange( :Ramp 346 2 32767 ) Call( :Office ) Call( :Ramp ) Jump( : ):Office;------------------------------------------------------------------------ RefPoint( rel :Ramp 0.1 52:37:55.269862 -03:09:2.147705 V1= 6000 V2= 1200 ) RotatedCall( :objcall 0 0 307.214998 ) Return:Ramp;Steps;------------------------------------------------------------------------ IfVarRange( : 346 3 32767 ) RefPoint( rel :EndV 0.1 52:37:55.277868 -03:09:2.143288 V1= 6000 V2= 1200 ) RotatedCall( :Ramp1 0 0 307.614998 ) Return:objcall CallLibObj( 0 0224CC01 0215C36E 00D17096 4C61C320 ) Return:Ramp1 CallLibObj( 0 0214CC71 0215CC6E 00D17096 4C416320 ) Return:EndV Jump( : ) EndA

Share this post


Link to post
Share on other sites

Hi Dave.1)The IfVarRange checks the scenery density. This should only be in a range of between 0-5 ( I think ). So you should probably change that to IfVarRange( :Ramp 346 2 5 ). 2)The Area structure should probably only have one object. That would uncomplicate the whole thing... then the separate objects could easily have their own scenery density ranges.;-------------------------------------------------------------------; Office;-------------------------------------------------------------------Area( 5 52:37:55.598862 -03:09:1.368915 5 ) IfVarRange( : 346 2 5 )Call( :Office )Jump( : ):Office;-------------------------------------------------------------------RefPoint( rel :EndV 0.1 52:37:55.269862 -03:09:2.147705V1= 6000 V2= 1200 ) RotatedCall( :objcall 0 0 307.214998 )Return;-------------------------------------------------------------------:objcallCallLibObj( 0 0224CC01 0215C36E 00D17096 4C61C320 ) Return:EndVReturn EndA;===================================================================;;-------------------------------------------------------------------; Office Ramp;--------------------------------------------------------------------Area( 5 52:37:55.598862 -03:09:1.368915 5 ) IfVarRange( : 346 3 5 )Call( :OfficeRamp )Jump( : ):OfficeRamp;-------------------------------------------------------------------RefPoint( rel :EndV 0.1 52:37:55.277868 -03:09:2.143288V1= 6000 V2= 1200 ) RotatedCall( :Ramp1 0 0 307.614998 ) Return;--------------------------------------------------------------------:Ramp1CallLibObj( 0 0214CC71 0215CC6E 00D17096 4C416320 ) Return:EndVReturnEndA;--------------------------------------------------------------------Dick

Share this post


Link to post
Share on other sites

Hi again, Dave.You could try this, if you want to keep the office and ramp in the same Area structure. I'm assuming you want the office displayed if density is between 2-5 and also the ramp if between 3-5:;------------------------------------------------------------------------; Office Building & Ramp;------------------------------------------------------------------------Area( 5 52:37:55.598862 -03:09:1.368915 5 ) IfVarRange( :_OfficeOnly 346 3 5 ) ; tests ramp range first Call( :Ramp ) Call( :Office ) Jump( : ):_OfficeOnlyIfVarRange( : 346 2 5 ) ; then tests office only range Call( :Office ) Jump( : );------------------------------------------------------------------------;------------------------------------------------------------------------:Ramp;------------------------------------------------------------------------ RefPoint( rel :RampFail 0.1 52:37:55.277868 -03:09:2.143288V1= 6000 V2= 1200 ) RotatedCall( :Ramp1 0 0 307.614998 ) Return:RampFailReturn;------------------------------------------------------------------------:Office;------------------------------------------------------------------------RefPoint( rel :OfficeFail 0.1 52:37:55.269862 -03:09:2.147705V1= 6000 V2= 1200 ) RotatedCall( :objcall 0 0 307.214998 )Return:OfficeFailReturn;------------------------------------------------------------------------:objcallCallLibObj( 0 0224CC01 0215C36E 00D17096 4C61C320 ) Return:Ramp1CallLibObj( 0 0214CC71 0215CC6E 00D17096 4C416320 ) Return;------------------------------------------------------------------------EndA;------------------------------------------------------------------------Dick

Share this post


Link to post
Share on other sites
Guest

Hi Dick Thanks for your suggestions, I will try replacing the 32767 with 5I would always have used '5' but Gerrish Grey advised on using this figureI will try both your routines, and let you know what happensAlthough the range check is set to 2, I have to change the density settings to Dense (3) in order to get the buildings and other Area() objects to displayVery strange, many thanks againRegardsDave

Share this post


Link to post
Share on other sites

This code is not correct. When you check for the complexity you have done a Call before and you are not allowed to jump to EndA (:) without doing a Return on that call first. So try something like this:Area( 5 52:37:55.598862 -03:09:1.368915 5 )IfVarRange( : 346 2 32767 )Call( :Office )Call( :Ramp )Jump( : ):OfficeRefPoint( rel :Ramp 0.1 52:37:55.269862 -03:09:2.147705V1= 6000 V2= 1200 ) RotatedCall( :objcall 0 0 307.214998 )Return:RampIfVarRange( :EndV 346 3 32767 )RefPoint( rel :EndV 0.1 52:37:55.277868 -03:09:2.143288V1= 6000 V2= 1200 ) RotatedCall( :Ramp1 0 0 307.614998 ) Return:objcallCallLibObj( 0 0224CC01 0215C36E 00D17096 4C61C320 ) Return:Ramp1CallLibObj( 0 0214CC71 0215CC6E 00D17096 4C416320 ) Return:EndVReturnEndA


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest

Hi GuysI have tried Arno's code and something very strange is going on!!!Even though their are several Area() Objects before it, I have to change settings in FS2002 to Scenery Complexity 'Dense' (3), in order to get objects to displayAll objects have all moved up a level and only since I tried to change thingsI have my suspicsions that this may be strange to this Bgl and not other Bgl's which are in my sceneryMay be I have made this minor programming error that Arno as mentioned else where in the scasm fileAnybody up for looking through the scasm file!!!!Cheers for the help everyoneDave

Share this post


Link to post
Share on other sites

You should be able to see the objects named office also at level 2, that's how it is in your code...


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest

Arno, I kid you not, About 2 ground polys are displayed out of 13 objects, mainly ground poly's, but 4 buildings and a airsock!!!Very weird!!!Dave

Share this post


Link to post
Share on other sites

You mean that also other objects (not in this area block) are not displaying? In that case you must have some wrong code in your SCASM source. Try to analyse the BGL with BGLTST (comes with SCASM as well), that might give an idea on what is wrong.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest

Hi ArnoJust A possible clue, when I change complexity settings, FS2002 reloads the scenery files, where as I have seen previously, the changes happen instaneouslyjust a thought, thats all!!!!If you have an Area block, it should display independantly from any other assumably!!!I will look at what you mentioned though (BGLTST)Given Fs2002 stutters from time to time, i'm wondering whether something in Fs is corrupted and a fresh instal may be needed, although not necessary the solutionThanks for your supportDave

Share this post


Link to post
Share on other sites
Guest

Hi ArnoI did try the BGLTST program and found it very usefulIt detected 16 Type (1) error's; Call a subroutine or exit a subroutine without a Return, which couldn't be good!!!But this hasn't resolved the Normal(2) Complexity settings, which only show at Dense(3)Back laterDave

Share this post


Link to post
Share on other sites
Guest

Hi Dick/ArnoI have simplied the Office/Ramp code into two seperate Area()'s and tried replacing the 32767 with 5 and both these efforts have failedI have set all my IfVarRange settings to 2 in this Bgl and all my objects display on Setting (3)Dense, if I change to Normal(2), only two Ground Polygons display.... Very Strange....I can also change objects to display above Dense(3)This strange phenomenom, is specific to this compiled Bgl and I have another Bgl which handles the trees which is in one Area() comand and has several IfVarRange() commands which function perfectly okThis leads me to think that, reinstalling FS2002 would not necessarilly resolve this issue, am I right?RegardsDave

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...