Jump to content
Sign in to follow this  
Guest

Vanishing Act...... Objects....

Recommended Posts

Guest

hi guysThis may seem remenisant of previous requests for help on a similar subject, but I fear this is not soI can load my scenery and after some time, not straight away, fairly close too, in spot view, the objects disappear.As one hanger disappears, the other appears adjacent to it and then the office, this is all associated with panning movements and the aircraft even disappears that is the centre of the spot view.I have had a report from a beta tester that this problem occurs ocassionally on his system which would seem to suggest that this is neither a system problem or a Fs2002 instal problem.I had thought this was occuring when frame rates are low, but this has happened today when frame rates were goodWere this a v1/v2 problem, would this not be a constant problem?This is the type of initial code I use, I have rem'd out the ShadowCall() command and it's respective label thinking this may be causing the problems. Although the Perspective command is not necessary might his be causing problems? Area( 5 52:37:54.769532 -03:09:4.205014 35 ) IfVarRange( : 346 2 32767 ) PerspectiveCall( :PCall ); ShadowCall( :PCall2 ) Jump( : ) :PCall Perspective ;:PCall2 RefPoint( rel :nodisplay 0.0200 52:37:54.699532 -03:09:3.925014 v1= 3000 V2= 500 ) RotatedCall( :Part1 0 0 306 ) ; rotate object to user preset RotatedCall( :Part0 0 0 306 ) ; rotate object to user preset Jump( : )Being an intermitant problem, this is such a difficult problem to resolve, that any thoughts would be appreciatedRegardsDave

Share this post


Link to post
Share on other sites

Code looks correct. As you write only the Perspective command is not needed, I don't think it will make a difference, but you can try a piece of code like this:[tt]Area( 5 52:37:54.769532 -03:09:4.205014 35 )IfVarRange( : 346 2 32767 )PerspectiveCall( :PCall )ShadowCall( :PCall )Jump( : ) :PCallRefPoint( rel :nodisplay 0.0200 52:37:54.699532 -03:09:3.925014 v1= 3000 V2= 500 ) RotatedCall( :Part1 0 0 306 )RotatedCall( :Part0 0 0 306 )Jump( : )[/tt]Also are you sure that all Return at the end of :Part1 and :Part0 are set correct and that :nodisplay aslo refers to a Return command?


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 ArnoThanks for your reply, I did check the 'Retuns' and they are in place, however, will the following code need returns after the RotatedCall's and TransformCall's;------------------------------------------------------------------------------------------------------------------------------------------------------------; NDB FENCE;----------------------------------------------------------------------------Area( 5 52:37:51.000000 -03:09:12.000000 3 ) ; Start of library call IfVarRange( : 346 4 32767 ) PerspectiveCall( :Fence1 ) Jump( : ) :Fence1 RefPoint( 7 :Fence2 0.125 52:37:47.531352 -03:09:13.967183 V1= 2500 V2= 500 ) ;E= 71.98 ) RotatedCall( :objcall 0 0 216 ); rotate object to user preset :Fence2;------------------------------------------------------------------------- RefPoint( rel :Fence3 0.125 52:37:47.531352 -03:09:13.967183 V1= 2500 V2= 1000 ) RotatedCall( :Trans_01 0 0 216 ) ; rotate object to user preset :Trans_01 TransformCall( :objcall 48 0 0 0 0000 0 0000 0 0000 ) :Fence3;-------------------------------------------------------------------------- RefPoint( 7 :Fence4 0.125 52:37:47.531352 -03:09:13.967183 V1= 2500 V2= 500 ) ;E= 71.98 ) RotatedCall( :Trans_02 0 0 216 ); rotate object to user preset:Trans_02 TransformCall( :objcall 0 0 -97 0 0000 0 0000 0 0000 ):Fence4;------------------------------------------------------------------------- RefPoint( rel :Fence5 0.125 52:37:47.531352 -03:09:13.967183 V1= 2500 V2= 1000 ) RotatedCall( :Trans_03 0 0 216 ) ; rotate object to user preset :Trans_03 TransformCall( :objcall 48 0 -97 0 0000 0 0000 0 0000 ) ;-------Front-&-Rear--Fences-------------------------------------------------:Fence5;------------------------------------------------------------------------- RefPoint( 7 :Fence6 0.125 52:37:47.531352 -03:09:13.967183 V1= 2500 V2= 500 ) ;E= 71.98 ) RotatedCall( :Trans_04 0 0 306 ); rotate object to user preset:Trans_04 TransformCall( :objcall 0 0 0 0 0000 0 0000 0 0000 ):Fence6;------------------------------------------------------------------------- RefPoint( rel :Fence7 0.125 52:37:47.531352 -03:09:13.967183 V1= 2500 V2= 1000 ) RotatedCall( :Trans_05 0 0 306 ) ; rotate object to user preset :Trans_05 TransformCall( :objcal2 48 0 0 0 0000 0 0000 0 0000 ) :Fence7;------------------------------------------------------------------------- RefPoint( 7 :Fence8 0.125 52:37:47.531352 -03:09:13.967183 V1= 2500 V2= 500 ) ;E= 71.98 ) RotatedCall( :Trans_06 0 0 306 ); rotate object to user preset:Trans_06 TransformCall( :objcall 0 0 97 0 0000 0 0000 0 0000 ):Fence8;------------------------------------------------------------------------- RefPoint( rel :EndV 0.125 52:37:47.531352 -03:09:13.967183 V1= 2500 V2= 1000 ) RotatedCall( :Trans_07 0 0 306 ) ; rotate object to user preset :Trans_07 TransformCall( :objcall 48 0 97 0 0000 0 0000 0 0000 ):EndV Return :objcall CallLibObj( 0 0413CC71 0012CD6d 00627325 4c435323 ) Return:objcal2 CallLibObj( 0 0413CC71 0002CD6d 00607325 4c435303 ) Return EndA----------------------------------------------------------------I do have a few Area's like this for fencing/PylonsIs the problem likely to be bad coding, can V1/V2 be eliminated?I guess removing the 'Perspective' isn't likely to alter this intermitant faultI do appreciate the helpRegardsDave

Share this post


Link to post
Share on other sites
Guest luissa

Dear Dave,I am not sure if what I will point out is the cause of your problem but the last Jump( : ) should be a Return! In FS98 (may be in FS2000) that Jump( : ) would mean a FS crash!Within the Area() and reading top down every Call must have its Return! When a sequence like this appears:RotatedCall( :call_something 0 0 306 ):not_needed_labelJump( :to_some_place ) :call_something NopReturnthe processor (the "BGL engine") does the following:RotatedCall( :call_something 0 0 306 )a) before executing the Call it adds on a stack of "return addresses" the address following the call, eg :not_needed_label in this present case:( jumps to the call address, eg :call_somethingNopc) does nothing on the NOP instructionReturnd) goes to the stack of "return addresses" and removes the last address that has been added, eg :not_needed_label e) jumps to that addressJump( :to_some_place )f) jumps to :to_some_place When you programme at machine level you even have to define a block of memory for that stack of "return addresses". If the size of this block is small, there is the risk of a crash if you have several Calls without Returns because the stack increases by a fixed ammount every time a Call is performed (and it decreases by the same fixed ammount every time a Return is performed). If you read your code after the Area() the stack increases by one asmmount on your PerspectiveCall( :PCall ). It increases again by another ammount on your RotatedCall( :Part1 0 0 306 ). It should decrease by one ammount on the Retun that terminates your :Part1. It increases again on your RotatedCall( :Part0 0 0 306 ). It decreases again on the last Return of your :Part0! and you reach the Jump( : )!If you followed the counting of the "ammounts" your stack is one "ammount" big at the end! Your Jump will make a jump to the EndA! In previous versions of the sim, that same stack was used in the next Area(). Depending on the frame rate, 15 - 30 times per second your faulty Area() would increase the satck each time it is performed! Which means a CRASH! If you replace the Jump( : ) by a Return you will have a good and correct EndA with the stack having the same size it had on the entry!In FS2002, I think that when EndA is found the sim resets this stack of "return addresses" to make FS more robust to "bad programming".I will comment your response to Arno in another message!regards, Luis

Share this post


Link to post
Share on other sites
Guest luissa

Hi Dave,... following my previous post and now regarding your code with several fences, I would change the code to:Area()IfVarRange()PerspectiveCall( :(_fence1 )PerspectiveCall( :(_fence2 )PerspectiveCall( :(_fence3 )...Jump( : )...B)_fenceNRefPoint()...Return...EndALuis

Share this post


Link to post
Share on other sites
Guest

Hi LuisNicely spotted Luis, I found it myself a couple of hours after the post, almost when I was about to give up!!! I was going to let you all know, that whilst it didn't look good(duplication of jump's), I thought the logic is not good, but it would get there.I had been experiencing lockup's, some 10sec's and restarting, some fatal and unreturnable. It had got to a stage where I couldn't start FS2002 with a saved situation in my scenery location, although I could start Fs at a alternative location and go to my scenery that way.Your explanation of the 'Return Address's' does make me wonder whether Fs2002 does suffer from the adverse reaction that you referred to with Fs98/2k and it is so much help to understand why the path/route if you like, needs to be so more explicit....Thanks for your suggested coding which I will change. I take it that it would be correct within each Perspective() subroutine to place a 'Return' after the TransformCall() which would take me back to the RotatedCall() where placing another 'Return' after the rotatedCall() would take me back to the next subroutine...CallWith regard to the vanishing of objects, I experimented with v1 and v2 settings without achieving any conclusion, However, I did change the PerspectiveCall() to an ordinary Call() and this resolved the problem, except of course, I then inherited drawing order problems that I believe the PerspectiveCall() command carries out. The drawing order problem only occured in objects that were coded in that Bgl, other objects that were vanishing, stopped after I changed to the Call() command and their code was calling objects from a Library Bgl.I'll be interested to view your's and others thoughts on this PerspectiveCall()/Call(), so I can increase my understanding of the workings of the Scasm commandsMany thanks again for your in depth analyis RegrdsDave

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