Tutorial 36: Battle Scripting



I need to take a break before I tackle this. And you should too, this will take awhile.

Ever played Final fantasy or any other console style RPG?

Anox is just like one of those games. But there are a couple of differences, Mostly that Console Rpgs sell bundles of copies where Anox did Not.

But in those ‘other’ console style games, when a battle takes place, the camera will cut away to an area where all the cameras are prescripted. But NOT with Anox, battles can take place anywhere. The reason Anox can do this is Planet has a ‘relative’ scripting system. Where ANY relative script can change dynamically based off the locations of the attacker & the Attackee. Awesome Stuff.

Lets load up map joey

Click on the ‘draw cyl’ button on the left. Notice the 3 cylinders in the middle of map Joey. The blue cylinder is the attacker cylinder, the red cylinder is the attackee cylinder, the big white cylinder is the area in between.

NOTE: ALL BATTLE AREAS IN ANOX MUST BE CYLINDRICAL IN NATURE.

I put the attacker on path 1 with the focus on path 2. THERE MUST be a focus node AND IT MUST BE OPEN FOCUS.

Drop a 3D node in the middle of the blue cylinder. Have cubic 1 focus at path 2
Have the cmd at 0.0
Newent=character_pal_com;floor=1

(ALL the main characters switch to a combat model, character_boots_com etc., except democratus. Combat Character models have a whole slew of combat animations)

for cubic 2 drop a 3d node in the red cylinder. This is Pal’s OPEN focus. Drag it out to 1.0.

For cubic 3 drop a 3d node in the red cylinder. This will be the enemy. Have it focus on path 4.
Newent=monster_noxgad;floor=1

For cubic 4 drop a 3d node in the blue cylinder. This is the enemy’s OPEN focus. Drag it out to 1.0.

put a camera on cubic track 10 with focus on path 11

all battle scripts began with an OPEN NODE & OPEN FOCUS. You don’t necessarily have to this, it was the style that we wanted. So the first camera would move smoothly to the action and THEN start cutting.

NOTE: In My Opinion, action is better expressed with a moving focus, not necessarily a moving camera. But hey…

You may want to examine all the battle animations Pal has to choose what type of attack you want to do. But lets do something simple, cuz my fingers are getting tired.

On path 6 Place a 3dnode in front of pal with a cmd node
Newent=mys_whitephere;floor=0;hidden=1;lighting=0=1=1=1

At 4.0
Hidden=0
(scale down the sphere)
And move the sphere so that it makescontact with the enemy at 5.0 secs. MAKE SURE THERE IS A NODE AT the enemy at exactly 5.0 secs. For reasons which I’ll explain later. BE SURE TO GIVE THIS NODE SOME FORWARD VELOCITY. And then drop another 3d node Past the enemy.

Play the script. It’s not the flashiest…. But lets continue. When the whitesphere hits the target at 5.0 we need to have the monster respond.

So on cubic 3 drop a cmd node at 5.0
Soundpain;animonce=26,a,1

This will do 2 things:
Play the monster’s hurt sound
Play the monster’s hurt animation
NOTE: You can play these multiple times if you wish
Drop a MASTER COMMAND node at 6.0
Displaydamage

This will bring up the amount of damage inflicted. Since we are not in battle mode it will say damage:XXX for now. Only 1 is needed.

This is essentially what a finished battle script looks like.

Assigning relativity.
Now we need to make this normal script a relative script.
Click on the first button ‘relative mode’
A bunch of question marks appear over your nodes. They need to be assigned to cylinders.

Select the only 3D node on cubic 1, Pal’s node. Hit ‘5’. now hit the up arrow. Scroll through all the relative cylinders that you can choose from. The short squat ones are preferred, they do not scale script nodes dependent on height. Choose the short squat cylinder that is in the blue cylinder.
Assign the node in cubic 4 to the same node.
Assign the nodes in cubic 2 & 3 to the short squat red cylinder.
Assign the first node in cubic 6 to the same node. When that path reaches the monster at exactly 5.0, assign that node to the short squat node in the red cylinder.
The camera you will have to judge for yourself.

Now hopefully you shouldn’t see ANY QUESTION MARKS. If you do, assign em cylinders.

It’s VERY important that the first and last attacker & attackee nodes be CENTERED IN THEIR CYLINDERS. If not, the characters will skip around in battle mode. To fix this, select the first node in cubic 1 and hit ‘9’. This will Center the node for you. Do the same for cubic 3.

Play the script. It should look exactly the same.

Now lets cycle through some possible battle cylinder scenarios. Cycle through cylinder positions by hitting the [ & ] keys. See how the script changes!
You may notice how some nodes may not have gone where you wanted them, so go back to your original cylinder configuration and re assign those nodes.

Configure the cylinders so that they are right next to each other. Play the script. Notice that the white sphere goes backward and hits PAL (THIS HAPPENS IF YOU GAVE THE NODE AT 5.0 SOME VELOCITY). Try to adjust so that it looks decent. Now change to the far spaced cylinder configuration. Play the script. This is why battle scripting can be difficult, YOU MUST MAKE SURE THAT YOUR SCRIPT WORKS AT ANY CONFIGURATION. The reason why you dropped a node exactly at 5.0 ON the monster is so that it is in sync with the soundpains and Hit animations for the monster at 5.0.

Here are some RULES that MUST be Followed

RULES:
ALWAYS return model to FLOOR=1
If you ever pick up an attacker OR attackee using floor=0, you must return it to floor=1

ALWAYS return models to the CENTER of the cylinder
If you ever MOVE an attacker or attackee, you MUST return them to the center of their appropriate cylinder

EVERY NODE MUST have a relativity

PLAY every script in all cylinder nodes

CAMERA should RARELY go out side the big cylinder.
If you don’t the camera can go out of world in some battles

ALWAYS return FLASHSTYLE to ‘0’

ALWAYS RETURN FLASH VALUES to 00000000
Any flash effects you try, just be sure to return them all to zero by the end of it.

You are almost done with your battle script

Replace the cmd with ‘newent=character_pal_com;’
RELENT=SOURCE,1,2;
The attacker

Replace the cmd with ‘newent=monster_noxgad;’
RELENT=TARGET,1,4;
The attackee

When you play this script you wont see the attacker or attackee models.

So use these commands
A3_relsource
A3_reltarget
To assign temporary models, You can also see how the cylinders will change.
Cylinder sizes are determined by Bounding boxes.

A3_relsource character_pal_com
A3_reltarget monster_noxgad

Now play the script

You are done with a battle script.