Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Let's add a section for using the ASL Editor.  (Read 25414 times)

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.
Let's add a section for using the ASL Editor.
« on: March 15, 2012, 12:05:33 pm »

I'm new to the forum and like most new users would love to see some tutorials on how to create ASL scripts using the editor. I've only begun to open existing ASL scripts, but it looks quite useful especially the syntax checker functions. Some of the scripts that I've run the checker flagged some warnings, but I don't have a clue what they mean? For example in the cog.a8s script this is displayed. What does it mean?
Code: [Select]
Parsing...
Analyzing...
Warning on line 45: Assigning a value to a member of an unassigned variable "$p"
Error on line 55: int expression expected
Warning on line 57: Use of unassigned variable "$sect"
Warning on line 58: Use of unassigned variable "$sect"
Warning on line 59: Use of unassigned variable "$sect"
Warning on line 60: Use of unassigned variable "$sect"
Completed: 1 error, 5 warnings

As I start working more with the editor I'll start posting FYI and possibly some how to articles as I unravel the mysteries of Anim8or and the tools associated with it. My gratitude goes out to Steve and the many helpful poster who advocate the use of Anim8or. Leroy.

Update: The first thing I've done is to install the ASL Script Editor and associate .ASL files in Windows XP to open all ASL files with the editor rather then Notepad; it's okay but a text editor lacks the Syntax Checker and should be more useful in troubleshooting ASL scripts.
« Last Edit: March 15, 2012, 12:15:03 pm by lppena »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Let's add a section for using the ASL Editor.
« Reply #1 on: March 15, 2012, 02:20:32 pm »

Ok, I just looked at the script. The warnings are just warnings which shouldn't actually stop the script execution. The line 57 error I think is mostly due to the Syntax Checker not being smart enough to realize that $div will be an integer value set by the parametric script once it's run. When it's run in Anim8or there won't be any problems.

The warnings are mostly due to there not being any data assigned to the variables before they are used. There is a for loop that runs through $sect and eventually populates that variable. If before the for loop there was a line $sect=0; then that warning would go away.
« Last Edit: March 15, 2012, 02:22:41 pm by Raxx »
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.
Re: Let's add a section for using the ASL Editor.
« Reply #2 on: March 15, 2012, 02:53:19 pm »

I've been checking all the scripts that I have installed; not to correct them but as a learning aid.

Are error messages more serious then warnings?
Some of the parametric scripts yield errors but seem to function normally otherwise.

How useful in the script editor to actually helping script writers fixed problems in their scripts?
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Let's add a section for using the ASL Editor.
« Reply #3 on: March 15, 2012, 03:47:20 pm »

Usually warnings in programming/scripting languages serve as just a caution that something isn't quite according to standard and that it "might" cause problems later on depending on certain circumstances.

Errors = failure in script execution. In the case of the Cog script, however, the script editor didn't differentiate between what kind of script it was, hence causing the error. Anim8or itself gives out error messages in its debug output window when compiling and executing scripts, and is the final say-so on what's an error and what's not.

The ASL Script Editor is a program written by a third party (Kubajzz), and not officially supported by Anim8or, nor has there been any contributions to it by Steve (though I'm sure he answered some of Kubajzz's questions). It's not a completely polished product so there are bound to be some bugs in it. I use it as my primary script editing tool, though I don't do much ASL work myself. There are a few quirks in there that irritates me, but it's a lot nicer than using Notepad. Basically, in my opinion, it's the best tool we have for ASL Script editing.

(Ippena, I'm curious to know if the .x script I posted in the other topic works, so that I can go ahead and put it in the database and then forget about it ;))
« Last Edit: March 15, 2012, 03:50:48 pm by Raxx »
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.
Re: Let's add a section for using the ASL Editor.
« Reply #4 on: March 15, 2012, 04:28:41 pm »

I made a cube and applied a BMP texture and exported it with the modified BZII X exporter, but when I view it in 3D Exploration 1.5.5. the errors in the screen grab display in 3DEX. I'm hoping you can give me a clue on what to change to get rid of the errors in the X model outputed by the script. Leroy.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Let's add a section for using the ASL Editor.
« Reply #5 on: March 15, 2012, 04:36:05 pm »

Ok, fixed that up. Original .x script exported with commas instead of semicolons. Those error messages should go away now.

Attached below

[edit]
(by the way, to explain how I found how to fix it, I exported a cube, opened it up in notepad, went to line 139-142, cross-checked it with the truespace version, went into the .a8s script, and replaced the commas with semicolons in the proper $output.print lines)
« Last Edit: March 15, 2012, 04:44:48 pm by Raxx »
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.
Re: Let's add a section for using the ASL Editor.
« Reply #6 on: March 15, 2012, 04:49:25 pm »

Ok, fixed that up. Original .x script exported with commas instead of semicolons. Those error messages should go away now.

Attached below

Wow...thank you Raxx I'm totally grateful for your assistance. I'll get the new script and replace the previous version. Thanks again and I'll post the results. With your knowledge you should really post some ASL editing tutorials for us to learn from. I'm totally hooked on Anim8or now and look forward to eventually making some contributions to the forum as I learn more about A8. I've never come across a modeling software with the features found in A8. Thanks again for taking the time to help out a total noob like me. Leroy.

Update: That did the trick and got rid of any errors in 3DEX. Thanks Raxx you're quite a talented person and I'll begin working on linking the objects in Truespace as BZII needs the model parts linked together a certain way using hierarchal structure. However, I can use Anim8or to create the geoemtry for the models and import those in to Truespace to  link objects the way the BZII game engine needs to have parts connected together.

How do feel about writing an XSI exporter for Anim8or? I have some sample XSI cube models that like use the same basic X format uses a text based layout. I think your modified BZII X script might work for an XSI version.  Here's a sample of a cube convert from your BZII X exporter to XSI using 3D Exploration to convert it to BZII XSI.
Code: [Select]
xsi 0101txt 0032

SI_CoordinateSystem coord {
  1;
  0;
  1;
  0;
  2;
  5;
  }

Frame cube01 {
     FrameTransformMatrix {
  1.000000,0.000000,0.000000,0.000000,
  0.000000,1.000000,0.000000,0.000000,
  0.000000,0.000000,1.000000,0.000000,
  -0.642227,-0.270071,0.550837,1.000000;;
   }
  Mesh cube01_mesh {
     8;
    -10.187110;-16.632017;10.187110;,
    10.187110;-16.632017;10.187110;,
    10.187110;16.632017;10.187110;,
    -10.187110;16.632017;10.187110;,
    -10.187110;-16.632017;-10.187110;,
    -10.187110;16.632017;-10.187110;,
    10.187110;16.632017;-10.187110;,
    10.187110;-16.632017;-10.187110;;
   
     12;
    3;1,2,0;,
    3;2,3,0;,
    3;5,6,4;,
    3;6,7,4;,
    3;3,5,0;,
    3;5,4,0;,
    3;7,6,1;,
    3;6,2,1;,
    3;2,6,3;,
    3;6,5,3;,
    3;4,7,0;,
    3;7,1,0;;
   
    MeshMaterialList {
      1;
      12;
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0;
      SI_Material {
        0.878431;0.878431;0.878431;1.000000;;
        0.200000;
        1.000000;1.000000;1.000000;;
        0.000000;0.000000;0.000000;;
        1;
        0.000000;0.000000;0.000000;;
        TextureFilename {
          "Raxxcube_0.bmp";
        }
      }
    }
   
    SI_MeshNormals {
      6;
      0.000000;0.000000;1.000000;,
      0.000000;0.000000;-1.000000;,
      -1.000000;0.000000;0.000000;,
      1.000000;0.000000;0.000000;,
      0.000000;1.000000;0.000000;,
      0.000000;-1.000000;0.000000;;
     
      12;
      0;3;0,0,0;,
      1;3;0,0,0;,
      2;3;1,1,1;,
      3;3;1,1,1;,
      4;3;2,2,2;,
      5;3;2,2,2;,
      6;3;3,3,3;,
      7;3;3,3,3;,
      8;3;4,4,4;,
      9;3;4,4,4;,
      10;3;5,5,5;,
      11;3;5,5,5;;
    }
   
    SI_MeshTextureCoords {
       4;
      1.000000;-1.000000;,
      1.000000;0.000000;,
      0.000000;-1.000000;,
      0.000000;0.000000;;
     
      12;
      0;3;0,1,2;,
      1;3;1,3,2;,
      2;3;3,1,2;,
      3;3;1,0,2;,
      4;3;3,3,2;,
      5;3;3,2,2;,
      6;3;2,3,2;,
      7;3;3,3,2;,
      8;3;1,1,3;,
      9;3;1,3,3;,
      10;3;3,1,3;,
      11;3;1,1,3;;
    }
   }
}
« Last Edit: March 15, 2012, 05:41:42 pm by lppena »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Let's add a section for using the ASL Editor.
« Reply #7 on: March 15, 2012, 05:34:28 pm »

You're welcome. I'm sorry if it seemed I was rushing you, it's just because I've got a lot to do in very little time so I try to wrap things up that can be wrapped up ;)

I don't really have much knowledge of ASL itself (or any language, for that matter). It's mostly just my dabbling in a dozen or so languages in the past that helps me pick up, use, and discard whatever scripting language I have to deal with to get whatever results I need at the moment. I'm currently working on a spur gears script in my free time (I love gears), and then I probably won't touch ASL for another year or so :P

But I'm glad you like Anim8or, and I look forward to seeing some contributions either in scripts or art!
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.
Re: Let's add a section for using the ASL Editor.
« Reply #8 on: March 15, 2012, 05:45:19 pm »

You're welcome. I'm sorry if it seemed I was rushing you, it's just because I've got a lot to do in very little time so I try to wrap things up that can be wrapped up ;)

I don't really have much knowledge of ASL itself (or any language, for that matter). It's mostly just my dabbling in a dozen or so languages in the past that helps me pick up, use, and discard whatever scripting language I have to deal with to get whatever results I need at the moment. I'm currently working on a spur gears script in my free time (I love gears), and then I probably won't touch ASL for another year or so :P

But I'm glad you like Anim8or, and I look forward to seeing some contributions either in scripts or art!

Now that Anim8or makes some sense to me I plan on using for a very long time. To me the simpler modeling software is the better. I'm a total idiot when it come to more complicated modeling software. I really appreciate your help with the X exporter. Leroy.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Let's add a section for using the ASL Editor.
« Reply #9 on: March 15, 2012, 06:13:35 pm »

Ok, so I think I was in error in assuming BZII used the .x file. It uses a specific type of .xsi instead, correct? All I did was make a stable .x exporter that 3DEX and Truespace can use?

Looking at the sample code you posted, it shouldn't be too hard for me to turn around and build an all-in-one .xsi exporter so that you don't have to use any program except Anim8or to get the models into BZII. You can't export animations but at least static models are possible. If that's all you need then give me a day or so and I'll have the solution for you. In the meantime I'll put the .x exporter in the ASL database and advertise it as a better version with fixes :P
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.
Re: Let's add a section for using the ASL Editor.
« Reply #10 on: March 15, 2012, 06:41:01 pm »

Ok, so I think I was in error in assuming BZII used the .x file. It uses a specific type of .xsi instead, correct? All I did was make a stable .x exporter that 3DEX and Truespace can use?

Looking at the sample code you posted, it shouldn't be too hard for me to turn around and build an all-in-one .xsi exporter so that you don't have to use any program except Anim8or to get the models into BZII. You can't export animations but at least static models are possible. If that's all you need then give me a day or so and I'll have the solution for you. In the meantime I'll put the .x exporter in the ASL database and advertise it as a better version with fixes :P

Thanks Raxx's, that would be totally cool. BTW, I hope you don't mind, but I setup an Anim8or forum on my own modeling forum, and uploaded your BZII X exporter plugin for other members to download. If you have time and BZII XSI exporter would be awesomely useful to BZII model makers, but I don't want to impose on your good naature too much. I plan to add some A8 tutorials in the future and thanks again for your kind offer. Leroy.
Logged