DrawTriList( start ;Draw part triangle polygons
v0 v1 v2
.. .. ..
vn1 vn2 vn3
TransformEnd ;End of part transformation
Return ;Finished with this part ...
Before you start tinkering, it helps to have a plan of attack and an understanding of what you're going to do ... so let's get to it.
Open your object source file myairplane.sca in your text editor and take a close look at the code.
Clean up your labels. Rename them if it helps make things more clear.
Add carriage returns after every Return command to help break up the code and isolate parts.
Add comments that briefly explain what's being done. Any line beginning with a semi-colon is treated as a comment and is disregarded when the SCA file is compiled.
Which parts are going to have damage textures applied and under what conditions? You'll need to apply a pre-process condition to every break away part to test part visibility. This is the event trigger you will use to swap part textures.
If you are using the polygon method to apply bullet holes, which parts are going to display the holes? Make sure each bullet hole polygon has the correct parent part so that any transformation of the parent applies to the bullet hole polygon as well.
You'll have to apply a visibility test to every bullet hole polygon on a breaking part to decide whether or not to render the decal for that bullet hole. If you don't and you're going to use texture swapping, you could end up with bullet holes "hanging in space."
Edit the object source code in stages. Make your changes to only one part or one part group at a time. Don't try to edit the entire file in a single session.
The changes you make to myairplane.sca may or may not work the first time. The odds are better than even they won't. That's why I recommend you edit the code in stages, one part at a time. It's much easier to find your mistakes.
For example, work only on the right wingtip. Finish steps 4 - 7 and test your changes. If it works as it should, copy the edited code and save it in myairplane.sca. Come back to step 3 and work on another part or part group.
PROTECT YOUR WORK!
Open the source code file you created in STEP 2 (myairplane.sca) in your text editor. Save it again with the name myairplaneORG.sca. This will always be your original code file. Save it again as myairplaneSCA.sca. This is the file you will edit.|
Once you get the SCASM code to work the way it should, just copy the code from that part of myairplaneSCA.sca and paste it into the same place in myairplane.sca. This way, you'll always have an .sca file containing code you know will work.
Now it's on to STEP 4, where you use the SCASM Compiler to convert your object source code into a scenery object file (.bgl).