Anim8orToBZW - Now in lightweight Python script

Discussion, updates, modifications, etc for the various map editors...
Post Reply
User avatar
Zehra
Private First Class
Private First Class
Posts: 921
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

Anim8orToBZW - Now in lightweight Python script

Post by Zehra »

This is a port of Anim8or to BZW Converter by Evanejk to the Python scripting language.

I did a previous port of it, but since I've looked over my previous work and found it lacking as well as having some bugs, it was rewritten entirely.
Anim8orToBZW.zip
updated version
(15.55 KiB) Downloaded 36 times
Instructions on making map:
Make the map in anim8or.
While making the map, only use cubes. To change what type of object the cubes are, change the cube's names.
**To make a pyramid:**
Put “pyr” (no quotes needed) anywhere in the name.
**To make a teleporter:**
Put “tel” (no quotes needed) anywhere in the name. The teleporter’s X size will be set to .125 in the BZW file, so you should set it to .125 in anim8or. (The teleporter will go along bzflag’s Y axis, if you want to change this, rotate it.)
To Rotate:
Rotate the object in anim8or only around the height axis. (This is the only rotation that bzflag supports.) (Edit>Rotation)
Info/Tips:
  • It’s helpful to color code the cubes in anim8or, so you can see which ones are boxes, pyramids, and teleporters.
  • Do not name any cubes over 50 characters long.
  • Do not make any object sizes/positions super long.
  • It will work more perfectly if you use round numbers to size/position your objects.
To Convert:
  • Put an anim8or file named "map.an8" in the same directory as the converter.
  • Run `Anim8orToBZW.py`
  • The output file will be called map.bzw, and will be in the same directory.
The license is: GPLv3

-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
User avatar
Zehra
Private First Class
Private First Class
Posts: 921
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

Re: Anim8orToBZW - Now in lightweight Python script

Post by Zehra »

Upon searching for possible improvements to this script, I did find some mistakes to it.
  • Rotational values were only applied when they were at zero.
  • Displaying unneeded/incorrect messages from time to time.

These are now fixed among the following changes which are listed below:
  • Cleanup: Reduced amount of duplicated logic
  • Cleanup: Reduced total lines of code by 2 lines.
  • Enhancement: Rounded up numbers. (We get 45 degree angles vs 44.9923738789625 and so on.)
  • Enhancement: Formulas easier to understand/adapt.
  • Bug fix: Fixed where only zero degree angles were added.
  • Bug fix: Fixed display of messages to proper handling.
Updated script:
Anim8orToBZW.txt
Updated script
(7.59 KiB) Downloaded 8 times
-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
Post Reply