Jump to content
Sign in to follow this  
rhumbaflappy

Please help a beginner!

Recommended Posts

Guest MB

Hi. I've read the beginner's guide and am somewhat overwhelemed by information! I wonder if you could help me with a (hopefully) simple task.I have some buildings which I want to make landable by helicopter. They're not my scenery, however, so I don't have access to the source files.Is there any way that I can create (for example) an invisible platform and place it at the same height as the building so I can land on it? Or is there another way that I can make the objects landable?By the way, I'm using FS2002If anyone could possibly point me in the right direction, I'd be extremely gratefulMany thanksMike

Share this post


Link to post
Share on other sites
Guest sapper42

Gday Mike, im not sure if your familiar with scasm but this is the code for advanced buildings that will give you a hard surface that you want.**** start of source code *****;SCASM source file created by FS Design Studio v2; Hard Surface for Heli Pads;;Header( 1 S38:31:41.5613 S38:31:56.0565 E147:16:11.0320 E147:15:42.7427 )LatRange( S38:31:56.0565 S38:31:41.5613 ); hard roofArea( 5 S38:29:48.9381 E147:22:57.0084 12 ) PerspectiveCall( :lblPerspective ) ShadowCall( :lblDraw ) Jump( : ):lblPerspective Perspective:lblDraw RefPoint( 2 :lblReturn 1.00 S38:29:48.9381 E147:22:57.0084 E= 22 V1= 100 V2= %14 ) AdvBldg( NORMAL 6 4 ROOF 0x4 256 256 ):lblReturn ReturnEndA****end of source code*****Only use the code between the start and end source code lines !This will give you a 6 x 4 meter helipad that is invisible for FS2K2 that you wont fall thruYou will need Scasm.exe from www.scasm.de MS Notepad is what you use to edit the code and save the files a *.sca instead of *.txtRefPoint( 2 :lblReturn 1.00 S38:29:48.9381 E147:22:57.0084 E= 22 V1= 100 V2= %14 ) THIS IS THE LAT LON OF THE CENTRE OF THE BUILDING.To get this value correct !Header( 1 S38:31:41.5613 S38:31:56.0565 E147:16:11.0320 E147:15:42.7427 )LatRange( S38:31:56.0565 S38:31:41.5613 )for your Lat Lon you need to be in SLew mode, Topdown View and press Shift Z to display the Lat Lon values. Press the space bar to point you North and then slew to your Top ( Nth ) Left, record the measurements, Next slew to your Bottom ( South ) right and record the Lat Lon again.The order for your Lat Lon input is :Top Left, Bottom Right, Bottom Right, Top leftfor the next set:Bottom right, Top Left.Once you have finished and saved your new ( you can edit the above to suit ) *.sca file, drag the file over the scasm.exe file and it will compile your BGL.You can allso create a Batch file to automate this process once your sca file is created and allso generate an error file incase you mess up the code.Open up notepad and copy the above and save as create.bat ( remember to change the name of the SCA file to suit the name of the helipad your building.example of batch file :*************************scasm.exe YOUR_FILE_NAME.SCA -Lnotepad scaerror.log**************************with scasm.exe, create.bat and the sca file you make, just run the bat file and it will compile your BGL and generate a report for you.rgds Jeff

Share this post


Link to post
Share on other sites
Guest sapper42

I forgot to add !!!E= 22 is the elevation in METERS and as per this example, it is 22 meters above ground.rgds Jeff

Share this post


Link to post
Share on other sites
Guest Firestriker

It can be done. You will need a program like Airport For Windows. Then collect the information for the lat., long., alt., heading and dimension of the pad. You may also need to do some tweeking of the code as sometimes the ground below gets raised to the level of the pad. Here is and example of a finished pads code that I tweeked from AFW then recompiled with SCASM.exe:;start of W0-30-0-S0-30-0-hpad.scaSet( FSVERS 0x800 ) Set( BUF 1024 )Set( areamx 1024 )Set( LINBUF 2048 )Header( 1 N0:0:0.0000 S1:0:0.0000 E0:0:0.0000 W1:0:0.0000 )LatRange( S1:0:0.0000 N0:0:0.0000 )Area16N Elevation ( 0 -0.499866836673333 -0.500133064260808 ;1 -0.500125879857011 -0.500133064260808 ;2 -0.500130900279707 -0.499863741973456 ;3 -0.499865270846279 -0.499863741973456 ;4 )END16; Helipad Area( 5 -00:30.000000 -000:30.000000 30 ) LayerCall( :rwy 24 ) Jump( : ):rwy Smoothing ( 1 ) Runway( -0:30.000000 -0:30.000000 Altitude 30.5000 Heading 0.0 Length 98 Width 98 Id 01 Surface -1 Markers 0 THRESHOLD 0 Lights 0 ThrLightsN 00 ThrLightsF 00 ) Smoothing ( 0 ) PerspectiveCall( :D0 ) Return:D0 Perspective RefPoint( 2 :Lights 1 -00:30.000000 -000:30.000000 E= 30 V1= 10000 V2= 1000 ) RotatedCall( :D2 0 0 0 ) Return:D2;RGBSColor( e0 0 0 0 )Dwx( 2d ) ; color commandDbd( 0 ) ; redDbx( e0 ) ; flag/transparencyDbd( 0 ) ; greenDbd( 0 ) ; blue Smoothing( 1 ) Points( 1 -15 0 15 15 0 15 15 0 -15 -15 0 -15 ) ShadedTexPoly( m 0 -32767 0 0 1 0 255 2 255 255 3 255 0 4 0 0 ) Smoothing (0):Lights:Strobes:D4 ReturnEndA; Polygon with Surface Smoothing 1Area( b -00:30.000000 -000:30.000000 30 ) LayerCall( :Taglayer 8 ) Jump( : ):Taglayer RefPoint( 7 :TagPoly 1 -00:30.000000 -000:30.000000 V1= 40000 V2= 1605 ) SurfaceColor( 0 F0 ) Points( 1 -15 0 15 -15 0 -15 15 0 -15 15 0 15 ) StartSurface MoveToPt( 1 ) DrawToPt( 2 3 4 ) EndSurface:TagPoly ReturnEndA;Invisible Runway to harden polygonArea( 5 -00:30.000000 -000:30.000000 10 ) Runway( -00:30.0000 -000:30.000000 Altitude 0.0 Heading 0 Length 98 Width 98 Surface -1 Markers 0 Lights 0 )EndA;end of W0-30-0-S0-30-0-hpad.scaLou

Share this post


Link to post
Share on other sites
Guest MB

Thanks very much for your help - it's very much appreciated.I'm not familiar with SCASM but I intend to learn very quickly tomorrow! Do I need to know much to do what's listed above?Once again, thanks for your helpMike

Share this post


Link to post
Share on other sites
Guest MB

Jeff,I started dabbling with scasm today and followed your instructions. Just as a practice I thought I'd compile your code first. I got the following error:Error in line 18 -> RefPoint( 2 :lblReturn 1.00 S38:29:48.9381 E147:22:57.0084 E= 22 -> in expression .. %14 ) ..Scasm compilation status: error(s) 1What's the problem?I also have a couple of other questionsI see that in the code it states that the object created is 6x4 metres. Does that mean that the co-ordinates of the corners have to be at the corners of a precise 6x4 metre box? If so, how do I tell how big a 6x4 metre box is in flightsim? Also, does the co-ordinate for the centre of the platform have to be exactly at the centre?Finally, wht do the 5 and 12 refer to in this line? Area( 5 S38:29:48.9381 E147:22:57.0084 12 )Do I need to change these?Many, many thanks for your helpMike

Share this post


Link to post
Share on other sites

Hi Mike,>Error in line 18> -> RefPoint( 2 :lblReturn 1.00 S38:29:48.9381>E147:22:57.0084 E= 22 > -> in expression .. %14 ) ..>Scasm compilation status: error(s) 1In the code of Jeff it says: v2= %14Try to replace that with: %13 %14I think it should work then.>Finally, wht do the 5 and 12 refer to in this line? >Area( 5 S38:29:48.9381 E147:22:57.0084 12 )>Do I need to change these?The 5 is the type of Area you want to create. These different types mainly differ in the maximum size (memory space) they can use. Type 5 is the most often used one.The 22 determines when the Area should be loaded. This value is again an often used one.


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 MB

Arno,thanks for your input. I tried changing the value as you said but still got errors. I tried just taking the % sign out after the 14 and it compiled ok but when i installed the bgl is fs, nothing happened. I went to the coordinates in the code and there was no solid surface there. I know I wouldn't be able to see it (!) but I slewed to just above the height it should be and then slewed down expecting my descent to be arrested and I went straight down to the ground - so clearly something wasn't right!

Share this post


Link to post
Share on other sites

You need to keep the % there. All parameters with the % sign, like %1, %2, ..., %13 and %14 are replaced with numbers when the macro is placed in the scenery. So the program placing the macro replaces them with the values needed for these paramters.Which program are you using to place your macro? I guess it is not passing the v2 value correctly.


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 sapper42

gday mate, sorry for the delay.as Arno pointed out, My error !! the section in question about % should read V2 = %13 %14As for the 6x4 meters i cant explain that, either you can visualise the size or you cant but if you know the body size of the Helo, it should give you an idea !as regards to seeing the landing surface ! you wont as its invisible, best way to find it is in Slew mode. Slew to just over the landing area and you will then see a shadow from your Helo and 6 x 4 is a small target to land on ! if your a tad off to one side you will fall through.change the pad size to 15 x 15 to get the hang of it and ensure your elevation height is correct.The advanced building code i showed you only creates a surface but no visible polygons.rgds Jeff

Share this post


Link to post
Share on other sites
Guest MB

Sorry to keep bothering you, maybe I'm just doing something wrong Even after adjusting the code, I'm still getting the error:Error in line 18 -> RefPoint( 2 :lblReturn 1.00 S38:29:48.9381 E147:22:57.0084 E= 22 -> in expression .. %13 %14 ) ..Scasm compilation status: error(s) 1I'm using Scasm version 2.50 and doing exactly as described above. I'm finding this all rather confusing. I'm not trying to pretend I know more about this than all you experts but I notice in the code kindly provided by Lou the similar line appears as follows:RefPoint( 2 :Lights 1 -00:30.000000 -000:30.000000 E= 30 V1= 10000 V2= 1000 )Does the fact that V2 is a number in this instance mean anything? Or am I, in my novice lack of knowledge, barking up the wrong tree?Once again, many thanks for your persistenceMike

Share this post


Link to post
Share on other sites
Guest Firestriker

I think there is a miscommunication here. The lines that have % signs are for the input of user info when the code is used as a macro in a program like Airport For Windows. The code that I gave you is stand alone, NOT a macro and uses no program to place it, only SCASM.exe to compile it to a bgl file. You should be able to replace the % signs in Jeff's routine with values similar to the ones in mine and is should compile.Something like this:;start of Jeff's codeHeader( 1 S38:31:41.5613 S38:31:56.0565 E147:16:11.0320 E147:15:42.7427 )LatRange( S38:31:56.0565 S38:31:41.5613 ); hard roofArea( 5 S38:29:48.9381 E147:22:57.0084 12 ) PerspectiveCall( :lblPerspective ) ShadowCall( :lblDraw ) Jump( : ):lblPerspective Perspective:lblDraw RefPoint( 2 :lblReturn 1.00 S38:29:48.9381 E147:22:57.0084 E= 22 V1=10000 V2=1000 );v1=## is the visibility of the object in meters and must be an;integer. v2=## is the radius of this object in design units and;an integer also. This is in meters if the scale factor is 1, as;it is here indicated by the 1.00 after the lblReturn AdvBldg( NORMAL 6 4 ROOF 0x4 256 256 ):lblReturn ReturnEndA;end of Jeff's codeYou also might want to get a later version of SCASM. Your version 2.50 is fairly old and I believe the latest is v2.98. and as I recall, it takes something like 2.88 for some of the newer commands of which the AdvBldg may be one of them.Lou

Share this post


Link to post
Share on other sites
Guest sapper42

Hi,As Lou Stated, the V1 and V2 can be changed from a % to a whole number ( integer ) and it should still compile OK !V1 is the distance in meters that the scenery will start to draw in FS regardless if you could see it or not.V2 is an imaginary bubble around the object where, once you move out of this bubble, the object is no longer drawn.This is so that when you taxi or fly past and it is nolonger in your view, the object is no longer drawn and releases memory.If the V2 is to small and the Ref point of your model is off center ( the V2 distance is smaller than your object ), you will find your object poping in and out of view ( the annoying vanishing object trick ), if it is to large however, your wasting memory resources as its still being drawn by the Sim even though its behind you and you cant see it. Can you supply a Lat Lon ( location ) as to where you want this hard surface ?If so, id be happy to create the code for you so you can see how it works.rgds Jeff

Share this post


Link to post
Share on other sites

To prevent confusion, the object is only no longer drawn when you are outside of the v2 bubble, when the reference point is behind you. So if you set it too small, part of the object will still be on screen, while the scenery engine already thinks it is totally behind you.


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 MB

HiThanks again for all your detailed explanations of how this code worksIn the light of my previous troubles, I decided to download Airport For Windows and have a go at making a pad that way. I'm pleased to report that this, combined with the help I've received here enabled me to tweak the code AFW generated to give me a helipad that I'm satisfied with.I now have a slightly different problem. I created the helipad for the back of a frigate. The surface of the frigate's helpad is 20 feet above sea level. When I load the scenery with a helicopter already sat on the frigate or in the immediate vicinity, everything's fine. The frigate is at sea level and the helicopter sits perfectly on the frigate's helipad. If, however, I fly from somewhere else quite far away to the frigate when I get there the frigate itself is sat on a 20 foot high lump of water. I assume this because as I approach, the pad is loading before the frigate. When the frigate loads, it sits on the pad. Would reducing the V1 and V2 numbers solve this problem?Once again, thanks for your helpMike

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