[Tutorial] Script Indexes and More Complicated .ANI Coding
+2
Pain(God)
CometStrife
6 posters
Page 1 of 2
Page 1 of 2 • 1, 2
[Tutorial] Script Indexes and More Complicated .ANI Coding
This tutorial is designed to teach you guys the technique to lengthen .ANI scripts without any errors
Before we begin, there are some things that I hope you have a basic foundation in.
Basic Requirements
To find the section you need quickly, press Ctrl+F and search for the string you need from the table of contents
Introduction
When we talk about lengthening Script.ANI, we are talking about lengthening the script indexes. So what are script indexes? They are the each specific part of the script that starts with LONG gibberish and ends before another LONG gibberish/ 0D0A Hex. Sounds gibberish enough?
To illustrate this, I'm going to copy a part of a script
The Cyan parts are the start of each script index, while the Yellow parts represents the ends. If you realised, there are ENDIFs at the end of all of the script indexes. This is actually not compulsory to end the script index, but it is mandatory to end a conditional command which I would talk about soon.
Here are more examples of script indexes. Do NOTE that you HAVE to understand where/how a script index starts and end first, how to identify a script index before moving on. This would serve as your basic foundation to advanced .ANI modding.
Note: The long gibberish sentence somewhere in the middle in the picture below is actually the original author's own notes. They are not important in defining a script index.
Similarly, the gibberish here in the picture below is just the author's notes
Understanding Conditional Statements
The "IF(@int[151] ,==, 0);" and "ENDIF;.." statements that you see in each script index is actually part of a command.
More over here: [Tutorial] Script.ani Conditions and Value Reference (Advanced)
This is a conditional command to the game to ask it to play a certain action if a certain condition is fulfilled.
The main point is, as such: A script index NEED NOT have a "IF(@int[151] ,==, 0);" and "ENDIF;.." statement to work.
For instance,
Will still work fine.
Another example
Will also work.
Most values that starts with HEX 27 (') apostrophe and ends with HEX 0D 0A (paragraph) are just comments. You can delete them and replace with your own string, or notes.
And those comments in the middle of if string represent what the RunProc2 value is. You can just open the file in Notepad++, set the encoding to Japanese, copy the line and translate via Google see what the author is talking about.
In case anyone is curious, the ENDIF is simply End-If, to end off the If(.....); statement.
So basically, what I am trying to show is how script indexes are independent ON THEIR OWN, not on any conditional commands.
How do Script Indexes Work?
Before gameplay, the game would always physically check through a script.ani for any mistakes.
If there are errors/mistakes, it gives a warning when it the script is utilised, such as this
OR this
While allowing the game to still continue. However when the attack used contains the error that the game warns, something will go wrong with the game. Either a forced shutdown of the game or a repeated showcase of the error occurs.
The left one would be a general error, where something is horribly wrong with your script, whereas the right one is a precise error, where the program tells you where the error lies in. In this case, it would be action number 131 and script index number 3.
During gameplay, when an attack is executed, the game machine instantly locates the part of the attack in the script that would be used. It then reads the FIRST script index completely before executing that part of the move.
Here is a visual illustration.
As you can see, even with an error, I am allowed to play the script. However, look at what happens next.
Pardon me for the lack of quality of my videos.
If you listened carefully, 5 shots were fired before the error popped up. A standard KD-05_3 Windom XP SP-3 subattack 3 has 6 shots. This means that an error occured on the script index containing the 6th shot / before the 6th shot, after the 5th shot (If the error occurs after the 5th RunProc2, then the entire attack would not continue at all). Look at the actual script below. The Orange parts are the commands responsible for the shots, while the Red part shows the error that I deliberately added. Numbers are added by the side for easier reference.
.........×#<....'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..Move=(0,STOP,0);..Force=(0,STOP,0);..GvEnable=0;..ShotTurnAng = 20;..LockBodyDownTarget(60,60);..Voice(S_Attack);....ChangeWeapon(GUN);......ENDIF;......ÍÌÌ=¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;.......×£;¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;..........¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 1RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 2RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 3RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 4RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 5RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>s...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50,50,0.4,0,30);..AttackFlag = 10;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 6RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;.......×#=Ð...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(999,999);..AttackDelay(4,600);......ENDIF;..........P...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....LockBodyDownTarget(-1,-1);....ENDIF;..
In summary, the main point of this is just to show how script indexes are processed by the game. First they check the entire script for errors, then ingame, when an attack is executed, each portion of the script index is scrutinised one after the other. If they are all checked at the same time, the moment the Subattack 3 key is pressed, I would have gotten an error, which I did not. Therefore, it allows you to zoom in to your mistakes much more easily as well.
There is however, an exception to this case which you don't need to know now, unless you are using "GoScriptIndex" and related commands. If you are using that command, go to the "Exception" explanation below.[table]
Before we begin, there are some things that I hope you have a basic foundation in.
Basic Requirements
1) Basic .ANI editing knowledge. If you lack it, I strongly suggest that you stop reading this topic and learn about it here first: Simple .ANI Tutorial
2) The basic Hex Editing software
3) A Hex - Dec Programmer's Calculator. The default Windows Calculator works fine. Just change the settings to "Programmer" under the View tab at the top left hand corner
4) Basic common sense, deductive, and comprehension skllls. This is very important to ensure that you know what I am talking about.
5) The .ANI that you want to lengthen. Without it, what is the point of this tutorial?
Numbering | Table of Contents |
1 2 3 4 5 6 7 | Introduction Understanding Conditional Statements How do Script Indexes Work? The Starting of a Script Index Lengthening The .ANI Code Block Changing the Number of Times An Attack Is Used Exceptions |
Introduction
When we talk about lengthening Script.ANI, we are talking about lengthening the script indexes. So what are script indexes? They are the each specific part of the script that starts with LONG gibberish and ends before another LONG gibberish/ 0D0A Hex. Sounds gibberish enough?
To illustrate this, I'm going to copy a part of a script
.........×#<....'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..Move=(0,STOP,0);..Force=(0,STOP,0);..GvEnable=0;..ShotTurnAng = 20;..LockBodyDownTarget(60,60);..Voice(S_Attack);....ChangeWeapon(GUN);......ENDIF;......ÍÌÌ=¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;.......×£;¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;..........¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;..
The Cyan parts are the start of each script index, while the Yellow parts represents the ends. If you realised, there are ENDIFs at the end of all of the script indexes. This is actually not compulsory to end the script index, but it is mandatory to end a conditional command which I would talk about soon.
Here are more examples of script indexes. Do NOTE that you HAVE to understand where/how a script index starts and end first, how to identify a script index before moving on. This would serve as your basic foundation to advanced .ANI modding.
Note: The long gibberish sentence somewhere in the middle in the picture below is actually the original author's own notes. They are not important in defining a script index.
Similarly, the gibberish here in the picture below is just the author's notes
Understanding Conditional Statements
The "IF(@int[151] ,==, 0);" and "ENDIF;.." statements that you see in each script index is actually part of a command.
More over here: [Tutorial] Script.ani Conditions and Value Reference (Advanced)
This is a conditional command to the game to ask it to play a certain action if a certain condition is fulfilled.
The main point is, as such: A script index NEED NOT have a "IF(@int[151] ,==, 0);" and "ENDIF;.." statement to work.
For instance,
.........×#<....'‰º”¼.g‚Ì‚Ý...............................BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..Move=(0,STOP,0);..Force=(0,STOP,0);..GvEnable=0;..ShotTurnAng = 20;..LockBodyDownTarget(60,60);..Voice(S_Attack);....ChangeWeapon(GUN);..............
Will still work fine.
Another example
....ÍÌL>p...'‰º”¼.g‚Ì‚Ý...............................BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);............
Will also work.
Most values that starts with HEX 27 (') apostrophe and ends with HEX 0D 0A (paragraph) are just comments. You can delete them and replace with your own string, or notes.
And those comments in the middle of if string represent what the RunProc2 value is. You can just open the file in Notepad++, set the encoding to Japanese, copy the line and translate via Google see what the author is talking about.
In case anyone is curious, the ENDIF is simply End-If, to end off the If(.....); statement.
So basically, what I am trying to show is how script indexes are independent ON THEIR OWN, not on any conditional commands.
How do Script Indexes Work?
Before gameplay, the game would always physically check through a script.ani for any mistakes.
If there are errors/mistakes, it gives a warning when it the script is utilised, such as this
OR this
While allowing the game to still continue. However when the attack used contains the error that the game warns, something will go wrong with the game. Either a forced shutdown of the game or a repeated showcase of the error occurs.
The left one would be a general error, where something is horribly wrong with your script, whereas the right one is a precise error, where the program tells you where the error lies in. In this case, it would be action number 131 and script index number 3.
During gameplay, when an attack is executed, the game machine instantly locates the part of the attack in the script that would be used. It then reads the FIRST script index completely before executing that part of the move.
Here is a visual illustration.
As you can see, even with an error, I am allowed to play the script. However, look at what happens next.
Pardon me for the lack of quality of my videos.
If you listened carefully, 5 shots were fired before the error popped up. A standard KD-05_3 Windom XP SP-3 subattack 3 has 6 shots. This means that an error occured on the script index containing the 6th shot / before the 6th shot, after the 5th shot (If the error occurs after the 5th RunProc2, then the entire attack would not continue at all). Look at the actual script below. The Orange parts are the commands responsible for the shots, while the Red part shows the error that I deliberately added. Numbers are added by the side for easier reference.
.........×#<....'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..Move=(0,STOP,0);..Force=(0,STOP,0);..GvEnable=0;..ShotTurnAng = 20;..LockBodyDownTarget(60,60);..Voice(S_Attack);....ChangeWeapon(GUN);......ENDIF;......ÍÌÌ=¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;.......×£;¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;..........¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 1RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 2RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 3RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 4RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 5RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>s...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50,50,0.4,0,30);..AttackFlag = 10;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. 6RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;.......×#=Ð...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(999,999);..AttackDelay(4,600);......ENDIF;..........P...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....LockBodyDownTarget(-1,-1);....ENDIF;..
In summary, the main point of this is just to show how script indexes are processed by the game. First they check the entire script for errors, then ingame, when an attack is executed, each portion of the script index is scrutinised one after the other. If they are all checked at the same time, the moment the Subattack 3 key is pressed, I would have gotten an error, which I did not. Therefore, it allows you to zoom in to your mistakes much more easily as well.
There is however, an exception to this case which you don't need to know now, unless you are using "GoScriptIndex" and related commands. If you are using that command, go to the "Exception" explanation below.[table]
Last edited by Aesreal on Sat Dec 14, 2013 3:55 am; edited 43 times in total
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Additional:
For those lost at what action numbers exactly are, here is a list for your convenience.
Oujar from 3DGundam has posted a list of actions. Credits in the table below goes to him. Translation and the sword basic movements were added by me.
Notice anything? They are extremely similar, arranged according to your tail.dat files and attacks. They can also be used as reference to the SwordCancel command.
The Starting of a Script Index
This is a small but important part about script indexes. Take a look at the script of KD-05_3's subattack 3 below.
0.........×#<....'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..Move=(0,STOP,0);..Force=(0,STOP,0);..GvEnable=0;..ShotTurnAng = 20;..LockBodyDownTarget(60,60);..Voice(S_Attack);....ChangeWeapon(GUN);......ENDIF;..1....ÍÌÌ=¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;..2.....×£;¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..
BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;..3........¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;..4....ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;..5....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..6....ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..7....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..8....ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..9....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..10....ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..11....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..12....ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..13....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..14....ÍÌL>s...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.4, 0);..AttackFlag = 10;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..15.....×#=Ð...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(999,999);..AttackDelay(4,600);......ENDIF;..16........P...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....LockBodyDownTarget(-1,-1);....ENDIF;..
Each change in colour represents a change in Script Index. For the game, ALL SCRIPTS starts from script index 0. Followed by 1,2,3, and so on.
The script above is actually your so-called Tail.dat, but I copied it directly from its script.ani with Hex Editor. Each Tail.dat consists of (n+1) script indexes, where n is the last script index in a tail.dat file.
In this case, 17 script indexes are present. However, when you use the GoScriptIndex(...); Command to direct the game to read off, say the 2nd script index, you need to input GoScriptIndex(1);.
Complicated? Here is another example
Say you want the game to direct the script back to the first shot, after executing the sixth shot (In KD-05_3 context), then input GoScriptIndex(4);, which is the 5th script index, where the first shot was first first shot. Hope you don't get confused with this one.
That aside, if you were to use the examples I gave to script an attack, then good luck to you. The example I gave would cause an infinite loop where the mech would continue to fire beams after beams after beams, even firing nothing when the weapon bar is empty.
Lengthening The .ANI Code Block
With enough basics, let's get down to business. The MAJOR MAJOR problem that I'm sure almost all .ANI modders would agree with would be the problem of insufficient space. But thanks to ritcher (Whose account apparently seems to be deleted), the problem is solved!
Do you remember why I emphasised on learning the ability to recognise a script index at the start of the tutorial? Well here is the reason.
The left part represents the HEX values of the right side of the table below. For easier referencing, I have cut down on the amount of data copied from the referenced script KD-05_3 Subattack 3
Oh god.. Do you feel like dying looking at it?
I certainly felt like vomitting blood
Jokes aside, you need to identify the starting parts the script index with its corresponding HEX values. Your Hex Editor should be able to do that for you. For tutorial sake, I would highlight the exact values with the exact HEX values. Due to a lack of visible colours, I would be reusing them in the order, Orange, Cyan, Violet.
I'm taking the first script index to teach you guys.
We only need the parts in orange for now, so lets scrap unnecessary code in the next one
First, IDENTIFY the part of the beginning of the script index that shows 00 00 00, followed by 6 HEX VALUES, and ends with 00 00.
A double digit / double number / mixed value such as 89 / DG / D9 is considered 1 HEX Value
In this case, the highlighted portion in Cyan would be what we are interested in.
In this case, there are 6 HEX values in between a 00 00 00 and 00 00
Second, open a new HEX file with your Hex Editor. You may think, ehh what?? However, it is imperative for you to know what you are going to add FIRST before you even change the code, to avoid making major mistakes when the code is being added into the script index. This will majorly screw up your script, and you have no idea how many bytes you have added in the first place. So let's say I want to add 7 missiles from the gun's output, i'll write
WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);
Something like this.
Then, count the number of HEX values you have to the left of the column. In this case, I have counted 147 HEX Values.
Third, for the start of the script index, remember the 6 HEX Values?
According to ritcher, they represent "A2 A1 B2 B1 C2 C1". You need to identify C2 and convert it into DEC values. In this case, C2 is 70.
Convert it to DEC, add the amount of HEX Values that you are going to add (This amount is defined in DEC, or our standard form of counting). In my case it is 147, so add that number to the converted DEC form of C2, equate and convert it back to hex. What I obtained was 103 OR "01 03".
Conditional Step
This does not always happen. Whenever you obtain 2 HEX Values after adding up the amounts together above, this step MUST be utilised.
Since there are now 2 HEX Values, Add the FIRST HEX Value to the C1 HEX Value. In this case, C1 is 01. Adding HEX 01 and 01 gives 02. Take note that you don't have to convert to DEC for this addition, since the "01" or additional HEX Value obtained is already in HEX, NOT DEC form! This HEX value coincides with the form of the original C1 Value, which is in HEX.
Adding them up, will give the new C1 value. Since, the second byte given in the C2 Value is 03, the new C2 C1 Value thus becomes 03 02.
Note: If C2 gives ONLY 1 HEX value, there is NO NEED to touch the value of C1 at all.
Here are visual illustrations
Conditional Step
Third, replace the original C2 C1 values with the new HEX Values obtained. To obtain the values in Violet.
For those lost at what action numbers exactly are, here is a list for your convenience.
Oujar from 3DGundam has posted a list of actions. Credits in the table below goes to him. Translation and the sword basic movements were added by me.
- Code:
Folder Actions
0 No action
1 Standing
2 Walking
3 Landing
4 Before Jump
5 Landing
6 Landing
7 Fly Up
8 Stop Flying
9 Left step
10 Right step
11 Front Step
12 Back Step
13 Got Attacked
14 Got Attacked and recoiled away
15 Strucked Down from the sky
16 Lying on floor
17 Rise up
18 Change Sword
19 Defense
20 stand
21 Shield Rush
22 Flight Mode
23
24-98 Sword Mode Basic Movements
99
100 Normal Range Shot
101 Left Shot
102 Right Shot
103 Floating Shot / Back Shot
104 Subattack 1
105 Subattack 2
106 Flight Shot
107 Left Flight Shot
108 Right Flight Shot
109 Subattack 3
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125 Subattack 1
126 Subattack 1
127
128
129
130 Up + C Dash
131 Normal Sword Slash 1
132 Normal Sword Slash 2
133 Normal Sword Slash 3
134 Normal Sword Slash 4
135 Normal Sword Slash 5
136 Up + C Sword Dash Attack 1
137 Up + C Sword Dash Attack 2
138 Up + C Sword Dash Attack 3
139 Up + C Sword Dash Attack 4
140 Up + C Sword Dash Attack 5
141 Left Sword Slash 1
142 Left Sword Slash 2
143 Left Sword Slash 3
144 Left Sword Slash 4
145 Left Sword Slash 5
146 Right Sword Slash 1
147 Right Sword Slash 2
148 Right Sword Slash 3
149 Right Sword Slash 4
150 Right Sword Slash 5
151 Back + C Slash Start
152 X
153 X
154 X
155 X
156 X
157 X
158 X
159 X
160
168
169
170
181
Notice anything? They are extremely similar, arranged according to your tail.dat files and attacks. They can also be used as reference to the SwordCancel command.
The Starting of a Script Index
This is a small but important part about script indexes. Take a look at the script of KD-05_3's subattack 3 below.
0.........×#<....'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..Move=(0,STOP,0);..Force=(0,STOP,0);..GvEnable=0;..ShotTurnAng = 20;..LockBodyDownTarget(60,60);..Voice(S_Attack);....ChangeWeapon(GUN);......ENDIF;..1....ÍÌÌ=¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;..2.....×£;¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..
BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;..3........¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 3;..LockBodyDownTarget(60,60);......ENDIF;..4....ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;..5....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..6....ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..7....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..8....ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..9....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..10....ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..11....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..12....ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..13....ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;..14....ÍÌL>s...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.4, 0);..AttackFlag = 10;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;..15.....×#=Ð...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(999,999);..AttackDelay(4,600);......ENDIF;..16........P...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....LockBodyDownTarget(-1,-1);....ENDIF;..
Each change in colour represents a change in Script Index. For the game, ALL SCRIPTS starts from script index 0. Followed by 1,2,3, and so on.
The script above is actually your so-called Tail.dat, but I copied it directly from its script.ani with Hex Editor. Each Tail.dat consists of (n+1) script indexes, where n is the last script index in a tail.dat file.
In this case, 17 script indexes are present. However, when you use the GoScriptIndex(...); Command to direct the game to read off, say the 2nd script index, you need to input GoScriptIndex(1);.
Complicated? Here is another example
Say you want the game to direct the script back to the first shot, after executing the sixth shot (In KD-05_3 context), then input GoScriptIndex(4);, which is the 5th script index, where the first shot was first first shot. Hope you don't get confused with this one.
That aside, if you were to use the examples I gave to script an attack, then good luck to you. The example I gave would cause an infinite loop where the mech would continue to fire beams after beams after beams, even firing nothing when the weapon bar is empty.
Lengthening The .ANI Code Block
With enough basics, let's get down to business. The MAJOR MAJOR problem that I'm sure almost all .ANI modders would agree with would be the problem of insufficient space. But thanks to ritcher (Whose account apparently seems to be deleted), the problem is solved!
Do you remember why I emphasised on learning the ability to recognise a script index at the start of the tutorial? Well here is the reason.
The left part represents the HEX values of the right side of the table below. For easier referencing, I have cut down on the amount of data copied from the referenced script KD-05_3 Subattack 3
05 00 00 00 CD CC 4C 3E 70 01 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 41 54 54 41 43 4B 28 35 30 2C 20 35 30 2C 20 30 2E 31 2C 20 30 29 3B 0D 0A 41 74 74 61 63 6B 46 6C 61 67 20 3D 20 33 3B 0D 0A 0D 0A 20 20 27 31 94 D4 83 8C 81 5B 83 55 81 5B 0D 0A 20 20 27 5B 30 5D 57 50 20 5B 31 5D 45 6E 65 20 5B 32 5D 4C 65 6E 20 5B 33 5D 53 70 65 65 64 2A 31 30 30 20 5B 34 5D 95 9D 2A 31 30 30 0D 0A 20 20 27 5B 35 5D 92 C7 89 C1 92 C7 94 F6 97 CD 28 25 29 20 5B 36 5D 54 65 78 4E 6F 0D 0A 20 20 52 75 6E 50 72 6F 63 32 28 30 2C 31 2C 20 20 30 2C 31 30 30 2C 33 30 2C 31 30 30 2C 32 30 2C 30 2C 30 2C 30 2C 30 2C 30 29 3B 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A 05 00 00 00 CD CC 4C 3E B9 00 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A 05 00 00 00 CD CC 4C 3E 72 01 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 41 54 54 41 43 4B 28 35 30 2C 20 35 30 2C 20 30 2E 31 2C 20 30 29 3B 0D 0A 41 74 74 61 63 6B 46 6C 61 67 20 3D 20 33 3B 0D 0A 0D 0A 20 20 27 31 94 D4 83 8C 81 5B 83 55 81 5B 0D 0A 20 20 27 5B 30 5D 57 50 20 5B 31 5D 45 6E 65 20 5B 32 5D 4C 65 6E 20 5B 33 5D 53 70 65 65 64 2A 31 30 30 20 5B 34 5D 95 9D 2A 31 30 30 0D 0A 20 20 27 5B 35 5D 92 C7 89 C1 92 C7 94 F6 97 CD 28 25 29 20 5B 36 5D 54 65 78 4E 6F 0D 0A 20 20 52 75 6E 50 72 6F 63 32 28 30 2C 31 2C 20 20 30 2C 31 30 30 2C 33 30 2C 31 30 30 2C 32 30 2C 30 2C 30 2C 30 2C 30 2C 30 29 3B 0D 0A 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A 05 00 00 00 CD CC 4C 3E B9 00 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A 05 00 00 00 CD CC 4C 3E 72 01 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 41 54 54 41 43 4B 28 35 30 2C 20 35 30 2C 20 30 2E 31 2C 20 30 29 3B 0D 0A 41 74 74 61 63 6B 46 6C 61 67 20 3D 20 33 3B 0D 0A 0D 0A 20 20 27 31 94 D4 83 8C 81 5B 83 55 81 5B 0D 0A 20 20 27 5B 30 5D 57 50 20 5B 31 5D 45 6E 65 20 5B 32 5D 4C 65 6E 20 5B 33 5D 53 70 65 65 64 2A 31 30 30 20 5B 34 5D 95 9D 2A 31 30 30 0D 0A 20 20 27 5B 35 5D 92 C7 89 C1 92 C7 94 F6 97 CD 28 25 29 20 5B 36 5D 54 65 78 4E 6F 0D 0A 20 20 52 75 6E 50 72 6F 63 32 28 30 2C 31 2C 20 20 30 2C 31 30 30 2C 33 30 2C 31 30 30 2C 32 30 2C 30 2C 30 2C 30 2C 30 2C 30 29 3B 0D 0A 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A 05 00 00 00 CD CC 4C 3E B9 00 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A 05 00 00 00 CD CC 4C 3E 72 01 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 41 54 54 41 43 4B 28 35 30 2C 20 35 30 2C 20 30 2E 31 2C 20 30 29 3B 0D 0A 41 74 74 61 63 6B 46 6C 61 67 20 3D 20 33 3B 0D 0A 0D 0A 20 20 27 31 94 D4 83 8C 81 5B 83 55 81 5B 0D 0A 20 20 27 5B 30 5D 57 50 20 5B 31 5D 45 6E 65 20 5B 32 5D 4C 65 6E 20 5B 33 5D 53 70 65 65 64 2A 31 30 30 20 5B 34 5D 95 9D 2A 31 30 30 0D 0A 20 20 27 5B 35 5D 92 C7 89 C1 92 C7 94 F6 97 CD 28 25 29 20 5B 36 5D 54 65 78 4E 6F 0D 0A 20 20 52 75 6E 50 72 6F 63 32 28 30 2C 31 2C 20 20 30 2C 31 30 30 2C 33 30 2C 31 30 30 2C 32 30 2C 30 2C 30 2C 30 2C 30 2C 30 29 3B 0D 0A 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A | ....ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;......ÍÌL>¹...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);......ENDIF;......ÍÌL>r...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);......ENDIF;.. |
Oh god.. Do you feel like dying looking at it?
I certainly felt like vomitting blood
Jokes aside, you need to identify the starting parts the script index with its corresponding HEX values. Your Hex Editor should be able to do that for you. For tutorial sake, I would highlight the exact values with the exact HEX values. Due to a lack of visible colours, I would be reusing them in the order, Orange, Cyan, Violet.
I'm taking the first script index to teach you guys.
05 00 00 00 CD CC 4C 3E 70 01 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 41 54 54 41 43 4B 28 35 30 2C 20 35 30 2C 20 30 2E 31 2C 20 30 29 3B 0D 0A 41 74 74 61 63 6B 46 6C 61 67 20 3D 20 33 3B 0D 0A 0D 0A 20 20 27 31 94 D4 83 8C 81 5B 83 55 81 5B 0D 0A 20 20 27 5B 30 5D 57 50 20 5B 31 5D 45 6E 65 20 5B 32 5D 4C 65 6E 20 5B 33 5D 53 70 65 65 64 2A 31 30 30 20 5B 34 5D 95 9D 2A 31 30 30 0D 0A 20 20 27 5B 35 5D 92 C7 89 C1 92 C7 94 F6 97 CD 28 25 29 20 5B 36 5D 54 65 78 4E 6F 0D 0A 20 20 52 75 6E 50 72 6F 63 32 28 30 2C 31 2C 20 20 30 2C 31 30 30 2C 33 30 2C 31 30 30 2C 32 30 2C 30 2C 30 2C 30 2C 30 2C 30 29 3B 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A | ....ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;.. |
We only need the parts in orange for now, so lets scrap unnecessary code in the next one
05 00 00 00 CD CC 4C 3E 70 01 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A | ....ÍÌL>p...'‰º”¼.g‚Ì‚Ý.. |
First, IDENTIFY the part of the beginning of the script index that shows 00 00 00, followed by 6 HEX VALUES, and ends with 00 00.
A double digit / double number / mixed value such as 89 / DG / D9 is considered 1 HEX Value
In this case, the highlighted portion in Cyan would be what we are interested in.
05 00 00 00 CD CC 4C 3E 70 01 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A | ....ÍÌL>p...'‰º”¼.g‚Ì‚Ý.. |
Second, open a new HEX file with your Hex Editor. You may think, ehh what?? However, it is imperative for you to know what you are going to add FIRST before you even change the code, to avoid making major mistakes when the code is being added into the script index. This will majorly screw up your script, and you have no idea how many bytes you have added in the first place. So let's say I want to add 7 missiles from the gun's output, i'll write
WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);
Something like this.
Then, count the number of HEX values you have to the left of the column. In this case, I have counted 147 HEX Values.
Third, for the start of the script index, remember the 6 HEX Values?
05 00 00 00 CD CC 4C 3E 70 01 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A | ....ÍÌL>p...'‰º”¼.g‚Ì‚Ý.. |
Convert it to DEC, add the amount of HEX Values that you are going to add (This amount is defined in DEC, or our standard form of counting). In my case it is 147, so add that number to the converted DEC form of C2, equate and convert it back to hex. What I obtained was 103 OR "01 03".
Conditional Step
This does not always happen. Whenever you obtain 2 HEX Values after adding up the amounts together above, this step MUST be utilised.
Since there are now 2 HEX Values, Add the FIRST HEX Value to the C1 HEX Value. In this case, C1 is 01. Adding HEX 01 and 01 gives 02. Take note that you don't have to convert to DEC for this addition, since the "01" or additional HEX Value obtained is already in HEX, NOT DEC form! This HEX value coincides with the form of the original C1 Value, which is in HEX.
Adding them up, will give the new C1 value. Since, the second byte given in the C2 Value is 03, the new C2 C1 Value thus becomes 03 02.
Note: If C2 gives ONLY 1 HEX value, there is NO NEED to touch the value of C1 at all.
Here are visual illustrations
1. Key in the C2 HEX Values | 2. Convert to DEC |
3. Add the amount of HEX Values you are going to be adding | 4. Equate to find the total value |
5. Convert the value to HEX | 6. Obtain the new C2 Hex Value |
Conditional Step
1. Key in the original C1 HEX Value | 2. Add in the additional HEX values that you obtained from the spill-over C2 HEX Values. |
3. Equate an obtain the new C1 HEX Value | |
Third, replace the original C2 C1 values with the new HEX Values obtained. To obtain the values in Violet.
05 00 00 00 CD CC 4C 3E 03 02 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A | ....ÍÌL>p...'‰º”¼.g‚Ì‚Ý.. |
Last edited by Aesreal on Sat Mar 09, 2013 5:13 am; edited 29 times in total
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Lastly, place in the code that you typed ANYWHERE within the script index, making sure that you do not screw up the other codes in the process. Remember to change the C2 C1 Values!
Below are some examples.
You can place it at the end
Or at the beginning
Or the middle
You get the idea.
Here is a video to illustrate what would happen if the script above is done correctly.
Once again, pardon me for the lack of quality. My computer is getting old.
Changing the Number of Times An Attack Is Used
So what happens when you want to make sure that a script plays an attack multiple times before it moves on? It is actually very easy. Take a look at the script below, which is a direct copy of KD-05_3's Default Subattack 3.
×#< '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
Move=(0,STOP,0);
Force=(0,STOP,0);
GvEnable=0;
ShotTurnAng = 20;
LockBodyDownTarget(60,60);
Voice(S_Attack);
ChangeWeapon(GUN);
ENDIF;
ÍÌÌ=¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
×£;¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>p '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>s '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.4, 0);
AttackFlag = 10;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
×#=Ð '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(999,999);
AttackDelay(4,600);
ENDIF;
P '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
LockBodyDownTarget(-1,-1);
ENDIF;
•ÏŒ`ƒVƒ‡ƒbƒg
Take for example you want to have 10 shots in Subattack3 for KD-05_3 instead of 6 shots. The first thing to do is count the number of times the mech fires a beam. In this case, there are 6 shots. Now, what you want to do is to add in this at the very first script index
And this extra code before the "AttackDelay" commands.
For explanation on how "GoPoseIndex" and "GoScriptIndex" commands works, visit Ethereal's thread here: [Tutorial] Script.ani Conditions and Value Reference (Advanced)
What the above code does is to check references and return the command. In this case, at the very start, int[1] is defined as 0.
Each time the script runs all the way until it hits the script index with the code just directly above this, 1 is added to the value of int[1]. So int[1] becomes 1. If the script is repeated, 1 is added to the new value of int[1] once again, such that it becomes 2. This goes on and on until the script stops.
Now, how does the script knows when to stop? If you look at this "IF(@int[1],<,02);", it means that ONLY IF int[1] is less than 2, THAN the following commands
"GoPoseIndex(-1,2);
GoScriptIndex(7);"
would be read. Otherwise, if int[1] is 2,3,4,..... then the script reader instantly skips this command. The reason why the @int[1] command is placed OUTSIDE the conditional command is also because of this reason. The @int[1] command will never be processed, if it is placed inside the conditional command, since the script reader would always skip that command altogether!
Since we want 10 shots, and the original script only has 6 shots, that means, 4 additional shots are needed.
So, now I'll choose the script indexes that I would place the larger code in, to give me 4 additional shots. In this case, I choose the last 4 shots to be replayed. You can also choose the middle 4 shots, or really any 4 CONSECUTIVE shots. So long as your GoScriptIndex Command directs the script reader to the correct script index with the correct number of times, it is fine.
Do remember that all "tail.dats" starts reading the first script index as Script Index 0. Also, don't forget to add in the "ENDIF;" command to end off the command. Otherwise, when the number of "IF" commands and "ENDIF;" commands does not match, the game gives and error.
If I were to make the script that I have just explained, it would probably be something like this.
×#< '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
Move=(0,STOP,0);
Force=(0,STOP,0);
GvEnable=0;
ShotTurnAng = 20;
LockBodyDownTarget(60,60);
Voice(S_Attack);
@int[1]=0;
ChangeWeapon(GUN);
ENDIF;
ÍÌÌ=¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
×£;¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>p '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>s '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.4, 0);
AttackFlag = 10;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
@int[1]+=1;
IF(@int[1],<,02);
GoPoseIndex(-1,2);
GoScriptIndex(7);
ENDIF;
ENDIF;
×#=Ð '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(999,999);
AttackDelay(4,600);
ENDIF;
P '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
LockBodyDownTarget(-1,-1);
ENDIF;
•ÏŒ`ƒVƒ‡ƒbƒg
If you have done it correctly, something like this should happen. Ignore how the mech points to other directions at the end. There is a lack of a lock body function to point the gun in the right direction, also it is not the focus of the video.
Notice how there are 10 shots fired off from the mech now?
You can also use this method to replay a subattack multiple times.
Below are some examples.
You can place it at the end
05 00 00 00 CD CC 4C 3E 03 02 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 41 54 54 41 43 4B 28 35 30 2C 20 35 30 2C 20 30 2E 31 2C 20 30 29 3B 0D 0A 41 74 74 61 63 6B 46 6C 61 67 20 3D 20 33 3B 0D 0A 0D 0A 20 20 27 31 94 D4 83 8C 81 5B 83 55 81 5B 0D 0A 20 20 27 5B 30 5D 57 50 20 5B 31 5D 45 6E 65 20 5B 32 5D 4C 65 6E 20 5B 33 5D 53 70 65 65 64 2A 31 30 30 20 5B 34 5D 95 9D 2A 31 30 30 0D 0A 20 20 27 5B 35 5D 92 C7 89 C1 92 C7 94 F6 97 CD 28 25 29 20 5B 36 5D 54 65 78 4E 6F 0D 0A 20 20 52 75 6E 50 72 6F 63 32 28 30 2C 31 2C 20 20 30 2C 31 30 30 2C 33 30 2C 31 30 30 2C 32 30 2C 30 2C 30 2C 30 2C 30 2C 30 29 3B 0D 0A 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 0D 0A 45 4E 44 49 46 3B 0D 0A | ....ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);.. AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1,0,100,30,100,20,0,0,0,0,0);.. WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);..ENDIF ;.. |
Or at the beginning
05 00 00 00 CD CC 4C 3E 03 02 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 41 54 54 41 43 4B 28 35 30 2C 20 35 30 2C 20 30 2E 31 2C 20 30 29 3B 0D 0A 41 74 74 61 63 6B 46 6C 61 67 20 3D 20 33 3B 0D 0A 0D 0A 20 20 27 31 94 D4 83 8C 81 5B 83 55 81 5B 0D 0A 20 20 27 5B 30 5D 57 50 20 5B 31 5D 45 6E 65 20 5B 32 5D 4C 65 6E 20 5B 33 5D 53 70 65 65 64 2A 31 30 30 20 5B 34 5D 95 9D 2A 31 30 30 0D 0A 20 20 27 5B 35 5D 92 C7 89 C1 92 C7 94 F6 97 CD 28 25 29 20 5B 36 5D 54 65 78 4E 6F 0D 0A 20 20 52 75 6E 50 72 6F 63 32 28 30 2C 31 2C 20 20 30 2C 31 30 30 2C 33 30 2C 31 30 30 2C 32 30 2C 30 2C 30 2C 30 2C 30 2C 30 29 3B 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A | ....ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);..WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);.. BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;.. |
Or the middle
05 00 00 00 CD CC 4C 3E 03 02 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 57 65 61 70 6F 6E 41 74 74 61 63 6B 28 2C 33 2C 30 2C 30 29 3B 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 41 54 54 41 43 4B 28 35 30 2C 20 35 30 2C 20 30 2E 31 2C 20 30 29 3B 0D 0A 41 74 74 61 63 6B 46 6C 61 67 20 3D 20 33 3B 0D 0A 0D 0A 20 20 27 31 94 D4 83 8C 81 5B 83 55 81 5B 0D 0A 20 20 27 5B 30 5D 57 50 20 5B 31 5D 45 6E 65 20 5B 32 5D 4C 65 6E 20 5B 33 5D 53 70 65 65 64 2A 31 30 30 20 5B 34 5D 95 9D 2A 31 30 30 0D 0A 20 20 27 5B 35 5D 92 C7 89 C1 92 C7 94 F6 97 CD 28 25 29 20 5B 36 5D 54 65 78 4E 6F 0D 0A 20 20 52 75 6E 50 72 6F 63 32 28 30 2C 31 2C 20 20 30 2C 31 30 30 2C 33 30 2C 31 30 30 2C 32 30 2C 30 2C 30 2C 30 2C 30 2C 30 29 3B 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A | ....ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0, 0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);WeaponAttack(,3,0,0);ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;.. |
You get the idea.
Here is a video to illustrate what would happen if the script above is done correctly.
Once again, pardon me for the lack of quality. My computer is getting old.
Changing the Number of Times An Attack Is Used
So what happens when you want to make sure that a script plays an attack multiple times before it moves on? It is actually very easy. Take a look at the script below, which is a direct copy of KD-05_3's Default Subattack 3.
×#< '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
Move=(0,STOP,0);
Force=(0,STOP,0);
GvEnable=0;
ShotTurnAng = 20;
LockBodyDownTarget(60,60);
Voice(S_Attack);
ChangeWeapon(GUN);
ENDIF;
ÍÌÌ=¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
×£;¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>p '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>s '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.4, 0);
AttackFlag = 10;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
×#=Ð '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(999,999);
AttackDelay(4,600);
ENDIF;
P '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
LockBodyDownTarget(-1,-1);
ENDIF;
•ÏŒ`ƒVƒ‡ƒbƒg
Take for example you want to have 10 shots in Subattack3 for KD-05_3 instead of 6 shots. The first thing to do is count the number of times the mech fires a beam. In this case, there are 6 shots. Now, what you want to do is to add in this at the very first script index
- Code:
@int[1]=0;
And this extra code before the "AttackDelay" commands.
- Code:
@int[1]+=1;
IF(@int[1],<,02);
GoPoseIndex(-1,2);
GoScriptIndex(7);
ENDIF;
For explanation on how "GoPoseIndex" and "GoScriptIndex" commands works, visit Ethereal's thread here: [Tutorial] Script.ani Conditions and Value Reference (Advanced)
What the above code does is to check references and return the command. In this case, at the very start, int[1] is defined as 0.
Each time the script runs all the way until it hits the script index with the code just directly above this, 1 is added to the value of int[1]. So int[1] becomes 1. If the script is repeated, 1 is added to the new value of int[1] once again, such that it becomes 2. This goes on and on until the script stops.
Now, how does the script knows when to stop? If you look at this "IF(@int[1],<,02);", it means that ONLY IF int[1] is less than 2, THAN the following commands
"GoPoseIndex(-1,2);
GoScriptIndex(7);"
would be read. Otherwise, if int[1] is 2,3,4,..... then the script reader instantly skips this command. The reason why the @int[1] command is placed OUTSIDE the conditional command is also because of this reason. The @int[1] command will never be processed, if it is placed inside the conditional command, since the script reader would always skip that command altogether!
Since we want 10 shots, and the original script only has 6 shots, that means, 4 additional shots are needed.
So, now I'll choose the script indexes that I would place the larger code in, to give me 4 additional shots. In this case, I choose the last 4 shots to be replayed. You can also choose the middle 4 shots, or really any 4 CONSECUTIVE shots. So long as your GoScriptIndex Command directs the script reader to the correct script index with the correct number of times, it is fine.
Do remember that all "tail.dats" starts reading the first script index as Script Index 0. Also, don't forget to add in the "ENDIF;" command to end off the command. Otherwise, when the number of "IF" commands and "ENDIF;" commands does not match, the game gives and error.
If I were to make the script that I have just explained, it would probably be something like this.
×#< '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
Move=(0,STOP,0);
Force=(0,STOP,0);
GvEnable=0;
ShotTurnAng = 20;
LockBodyDownTarget(60,60);
Voice(S_Attack);
@int[1]=0;
ChangeWeapon(GUN);
ENDIF;
ÍÌÌ=¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
×£;¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>p '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>r '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.1, 0);
AttackFlag = 3;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
ENDIF;
ÍÌL>¹ '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ENDIF;
ÍÌL>s '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(60,60);
ATTACK(50, 50, 0.4, 0);
AttackFlag = 10;
'1”ÔƒŒ[ƒU[
'[0]WP [1]Ene [2]Len [3]Speed*100 [4]•*100
'[5]’ljÁ’Ç”ö—Í(%) [6]TexNo
RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);
@int[1]+=1;
IF(@int[1],<,02);
GoPoseIndex(-1,2);
GoScriptIndex(7);
ENDIF;
ENDIF;
×#=Ð '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
BURNER(0);
BURNER(1);
BURNER(2);
BURNER(3);
BURNER(4);
BURNER(5);
GvEnable=0;
ShotTurnAng = 3;
LockBodyDownTarget(999,999);
AttackDelay(4,600);
ENDIF;
P '‰º”¼g‚Ì‚Ý
IF(@int[151] ,==, 0);
LockBodyDownTarget(-1,-1);
ENDIF;
•ÏŒ`ƒVƒ‡ƒbƒg
If you have done it correctly, something like this should happen. Ignore how the mech points to other directions at the end. There is a lack of a lock body function to point the gun in the right direction, also it is not the focus of the video.
Notice how there are 10 shots fired off from the mech now?
You can also use this method to replay a subattack multiple times.
Last edited by Aesreal on Sat Mar 09, 2013 5:21 am; edited 24 times in total
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Controlling the Number of Script Indexes
Take a look at this
Typically, every Tail.dat starts with a Hex number at the very start. It represents the number of script indexes, followed by 3 nulls, another number, another 3 nulls before reaching the A2 A1 B2 B1 C2 C1 values.
The first number (a.k.a. 01) represents the number of script indexes. So let's say you have 10 script index, convert this from DEC to HEX format and you get 0A. Replace that 01 with 0A and add another script index. Removal of script indexes follows the same way.
After which, every script index in the Tail.dat begins with the SECOND number, 3 nulls, A2~C1 values. This number represents how many deciseconds the script index would be played before moving on to the next. Naturally, you'll have to convert the value from DEC to HEX as well and enter it into the HEX part of the Tail.dat with a Hex Editor.
Some additional stuff for you guys
Effects
There are 3 main processes to be used for effects. Processes 33, 34, and 62.
Process 34
The main use of process 34 is to reduce melee damage. However, due to the dual animations that it has, it can be used in creating animations (Eg, feathers, GN Particles).
Here is an example of a process 34 script taken from KD-08_7 Linux Fennel
RunProc2(0,34, 0,500, 2, 3,20, 300,15,25,15,0);
The 0 represents the typical index, where if multiple process 34 are played, this would determine which plays out first.
The 34 is the process.
The 2nd 0 represents the weapon point, where the effect is supposed to appear. Although in the game, this process seems to be bugged since it does not appear at the right place.
The 500 represents the amount of energy gauge that would be used due to this process.
The 2 represents the XFile number for the 'rotating shields', where different XFile number causes different 3D .x models to be used.
The 3 represents the XFile number for the 'feathers'.
The 20 represents the count for the 'feathers'. It determines how many 'feathers' would appear.
The 300 represents the amount of damage reduction that the process would cause. If you are using this solely for animation purposes, set this value to 0.
The 15 theoretically represents the time that the 'feathers' would last. Although I haven't really tested this yet.
The 25 theoretically represents the time that the 'rotating shields' would last. Similarly to the value of 15 above, this has not been properly tested yet.
The last 15 represents the dispersion rate of the 'feathers'. A high value indicates that the 'feathers' would be more widely spread.
The 0 at the end is unknown so far.
Take a look at this
01 00 00 00 05 00 00 00 CD CC 4C 3E 70 01 00 00 27 89 BA 94 BC 90 67 82 CC 82 DD 0D 0A 49 46 28 40 69 6E 74 5B 31 35 31 5D 20 20 2C 3D 3D 2C 20 20 20 20 30 29 3B 0D 0A 0D 0A 42 55 52 4E 45 52 28 30 29 3B 0D 0A 42 55 52 4E 45 52 28 31 29 3B 0D 0A 42 55 52 4E 45 52 28 32 29 3B 0D 0A 42 55 52 4E 45 52 28 33 29 3B 0D 0A 42 55 52 4E 45 52 28 34 29 3B 0D 0A 42 55 52 4E 45 52 28 35 29 3B 0D 0A 47 76 45 6E 61 62 6C 65 3D 30 3B 0D 0A 53 68 6F 74 54 75 72 6E 41 6E 67 20 3D 20 31 3B 0D 0A 4C 6F 63 6B 42 6F 64 79 44 6F 77 6E 54 61 72 67 65 74 28 36 30 2C 36 30 29 3B 0D 0A 0D 0A 41 54 54 41 43 4B 28 35 30 2C 20 35 30 2C 20 30 2E 31 2C 20 30 29 3B 0D 0A 41 74 74 61 63 6B 46 6C 61 67 20 3D 20 33 3B 0D 0A 0D 0A 20 20 27 31 94 D4 83 8C 81 5B 83 55 81 5B 0D 0A 20 20 27 5B 30 5D 57 50 20 5B 31 5D 45 6E 65 20 5B 32 5D 4C 65 6E 20 5B 33 5D 53 70 65 65 64 2A 31 30 30 20 5B 34 5D 95 9D 2A 31 30 30 0D 0A 20 20 27 5B 35 5D 92 C7 89 C1 92 C7 94 F6 97 CD 28 25 29 20 5B 36 5D 54 65 78 4E 6F 0D 0A 20 20 52 75 6E 50 72 6F 63 32 28 30 2C 31 2C 20 20 30 2C 31 30 30 2C 33 30 2C 31 30 30 2C 32 30 2C 30 2C 30 2C 30 2C 30 2C 30 29 3B 0D 0A 0D 0A 45 4E 44 49 46 3B 0D 0A | ........ÍÌL>p...'‰º”¼.g‚Ì‚Ý..IF(@int[151] ,==, 0);....BURNER(0);..BURNER(1);..BURNER(2);..BURNER(3);..BURNER(4);..BURNER(5);..GvEnable=0;..ShotTurnAng = 1;..LockBodyDownTarget(60,60);....ATTACK(50, 50, 0.1, 0);..AttackFlag = 3;.... '1”ÔƒŒ.[ƒU.[.. '[0]WP [1]Ene [2]Len [3]Speed*100 [4]•.*100.. '[5]’ljÁ’Ç”ö—Í(%) [6]TexNo.. RunProc2(0,1, 0,100,30,100,20,0,0,0,0,0);....ENDIF;.. |
The first number (a.k.a. 01) represents the number of script indexes. So let's say you have 10 script index, convert this from DEC to HEX format and you get 0A. Replace that 01 with 0A and add another script index. Removal of script indexes follows the same way.
After which, every script index in the Tail.dat begins with the SECOND number, 3 nulls, A2~C1 values. This number represents how many deciseconds the script index would be played before moving on to the next. Naturally, you'll have to convert the value from DEC to HEX as well and enter it into the HEX part of the Tail.dat with a Hex Editor.
Some additional stuff for you guys
Effects
There are 3 main processes to be used for effects. Processes 33, 34, and 62.
Process 34
The main use of process 34 is to reduce melee damage. However, due to the dual animations that it has, it can be used in creating animations (Eg, feathers, GN Particles).
Here is an example of a process 34 script taken from KD-08_7 Linux Fennel
RunProc2(0,34, 0,500, 2, 3,20, 300,15,25,15,0);
The 0 represents the typical index, where if multiple process 34 are played, this would determine which plays out first.
The 34 is the process.
The 2nd 0 represents the weapon point, where the effect is supposed to appear. Although in the game, this process seems to be bugged since it does not appear at the right place.
The 500 represents the amount of energy gauge that would be used due to this process.
The 2 represents the XFile number for the 'rotating shields', where different XFile number causes different 3D .x models to be used.
The 3 represents the XFile number for the 'feathers'.
The 20 represents the count for the 'feathers'. It determines how many 'feathers' would appear.
The 300 represents the amount of damage reduction that the process would cause. If you are using this solely for animation purposes, set this value to 0.
The 15 theoretically represents the time that the 'feathers' would last. Although I haven't really tested this yet.
The 25 theoretically represents the time that the 'rotating shields' would last. Similarly to the value of 15 above, this has not been properly tested yet.
The last 15 represents the dispersion rate of the 'feathers'. A high value indicates that the 'feathers' would be more widely spread.
The 0 at the end is unknown so far.
Last edited by Aesreal on Sat Sep 28, 2013 10:23 pm; edited 18 times in total
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Easier Way of Determining Amount of Bytes
Now that you have learnt how to change bytes the hard way, it is time for the easy way. Now, don't go flipping the table. The methods above is to make sure you understand the process. For almost all Hex Editors, they can automatically help you calculate the total amount of bytes that is needed.
Look at the images below and you'll understand.
For other Hex Editors, find the OFFSET value for the LAST BYTE of the code in the ANI Block, and deduct it with the OFFSET for the FIRST BYTE of the ANI Block. Afterwards, add 1 to it and you will get your C1 C2 Value.
Now that you have learnt how to change bytes the hard way, it is time for the easy way. Now, don't go flipping the table. The methods above is to make sure you understand the process. For almost all Hex Editors, they can automatically help you calculate the total amount of bytes that is needed.
Look at the images below and you'll understand.
For other Hex Editors, find the OFFSET value for the LAST BYTE of the code in the ANI Block, and deduct it with the OFFSET for the FIRST BYTE of the ANI Block. Afterwards, add 1 to it and you will get your C1 C2 Value.
Last edited by Aesreal on Sat Dec 14, 2013 4:13 am; edited 1 time in total
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
If there are any confusing areas/ parts where my English sucks horriby (I admit my proficiency of the English language is not really good), or you simply don't understand, do comment and let me know
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Thanks
I am so dizzy
I am so dizzy
Pain(God)- (90%)-Lv5
- Posts : 590
Join date : 2011-05-19
Currently : Amegakure
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Haha, welcome, I am feeling dizzy as well
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
@@.....I Know This Is Very Helpful,Zeranto....Thanks.....but my head is going to explode...XD
Sankarea- (20%)-Lv8
- Posts : 2575
Join date : 2011-06-08
Age : 28
Currently : Al-Revis Academy
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Haha, welcome welcome
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
A very detailed tutorial sir. ^_^ Nice work and trust me when I say, your tutorials is very accurate. :D
Guest- Guest
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Well thank you for that ;D
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Here's a small tip. Most values that starts with 27 (') apostrophe and ends with 0D0A (tab) are just comments. You can delete them and replace with your own string.
And those comments in the middle of if string represent what the RunProc2 value is. You can just copy the line and translate via Google see what the author is talking about.
Note that the comment before the actual string in not supposed to be edited without using the methods explained on the first page.
Actually this was already explained but I just kinda summed it up. ^_^
And those comments in the middle of if string represent what the RunProc2 value is. You can just copy the line and translate via Google see what the author is talking about.
Note that the comment before the actual string in not supposed to be edited without using the methods explained on the first page.
Actually this was already explained but I just kinda summed it up. ^_^
Guest- Guest
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Nice summary lol, I have the tendency to give grandmother stories, especially since my proficiency of the English language isn't that good. Thanks for this! You mind if I use it?
EDIT: Isn't 0D 0A spacing? Tab should be 09, no?
EDIT: Isn't 0D 0A spacing? Tab should be 09, no?
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
0D0A represents carriage return which is used as sort of a tab break or spacing.
Though now that I think about it. The term spacing and tab are the same. Basically it was used to make the codes look clean in a compiler.
Example
IF
as
as
ENDIF
is
0d0a
IF0d0a
as0d0a
as0d0a
ENDIF0d0a
In reality. If it were to be applied in a compiler. It signifies the end of a line and a start. A carriage return tab like those in consoles.
text > 0d0a -> Next text.
And 09 is tab though horizontal tab though isn't a (carriage return).
I know kinda confusing. x_x
Maybe we should categorize it as this.
0D0A = Carriage return
09 = Hortizontal Tab
20 = Space/Spacing
Because if you noticed... The original code is like...
0d0a
IF0d0a
as0d0a
as0d0a
ENDIF0d0a
and if you remove the 0d0a it becomes
IFasdasfdds202020202020202020202020ENDIF;
Though now that I think about it. The term spacing and tab are the same. Basically it was used to make the codes look clean in a compiler.
Example
IF
as
as
ENDIF
is
0d0a
IF0d0a
as0d0a
as0d0a
ENDIF0d0a
In reality. If it were to be applied in a compiler. It signifies the end of a line and a start. A carriage return tab like those in consoles.
text > 0d0a -> Next text.
And 09 is tab though horizontal tab though isn't a
I know kinda confusing. x_x
Maybe we should categorize it as this.
0D0A = Carriage return
09 = Hortizontal Tab
20 = Space/Spacing
Because if you noticed... The original code is like...
0d0a
IF0d0a
as0d0a
as0d0a
ENDIF0d0a
and if you remove the 0d0a it becomes
IFasdasfdds202020202020202020202020ENDIF;
Last edited by Ethereal on Tue Dec 18, 2012 1:09 am; edited 1 time in total
Guest- Guest
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
I see, so carridge return is the technical term for it. Thanks! But isn't spacing 20, not 30??
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Pain(God)- (90%)-Lv5
- Posts : 590
Join date : 2011-05-19
Currently : Amegakure
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
uhhhhhhhhhhhhhhhh....my head.......
Sankarea- (20%)-Lv8
- Posts : 2575
Join date : 2011-06-08
Age : 28
Currently : Al-Revis Academy
InfinitasImpetum- (0%)-Lv8
- Posts : 2162
Join date : 2012-05-30
Age : 34
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
'‰º”¼.g‚Ì‚Ý = name of variable in binary form(you see through out the script)
part before it is probably an array telling when to run the script section, how many times to execute it, and the length of the script.
part before it is probably an array telling when to run the script section, how many times to execute it, and the length of the script.
InfinitasImpetum- (0%)-Lv8
- Posts : 2162
Join date : 2012-05-30
Age : 34
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Do you know exactly what it does? Like which part represents which. It would definitely help alot if you do.
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
nope, all i know there has to be a point telling when to execute each section in the animation. unless its keyframe based each section is attach to a key frame to when it executes this can be easily found out by seeing if the number of hod files are equivelant too number of sections
section = if statements
section = if statements
InfinitasImpetum- (0%)-Lv8
- Posts : 2162
Join date : 2012-05-30
Age : 34
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Could you help me fix
http://www.winz00e.com/t3470-tutorial-script-indexes-and-more-complicated-ani-coding#66143
the parts where the separated boxes goes haywire. I would appreciate it alot
http://www.winz00e.com/t3470-tutorial-script-indexes-and-more-complicated-ani-coding#66143
the parts where the separated boxes goes haywire. I would appreciate it alot
CometStrife- (40%)-Lv7
- Posts : 1256
Join date : 2010-11-07
Age : 30
Currently : Earth
Re: [Tutorial] Script Indexes and More Complicated .ANI Coding
Aesreal wrote:Could you help me fix
http://www.winz00e.com/t3470-tutorial-script-indexes-and-more-complicated-ani-coding#66143
the parts where the separated boxes goes haywire. I would appreciate it alot
the table boxes just change the font size to make it fit, and if that doesn't then its another 4.0 issue.
InfinitasImpetum- (0%)-Lv8
- Posts : 2162
Join date : 2012-05-30
Age : 34
Page 1 of 2 • 1, 2
Similar topics
» [Tutorial] Script.ani Editing. (to be finished)
» [Tutorial] Script.ani Conditions and Value Reference (Advanced)
» [Tutorial] UKWXP Mod Manager Tutorial
» [Tutorial] Simple .ANI Tutorial
» [Guide] Texture Numbers and Script.ani Effects (Intermediate)
» [Tutorial] Script.ani Conditions and Value Reference (Advanced)
» [Tutorial] UKWXP Mod Manager Tutorial
» [Tutorial] Simple .ANI Tutorial
» [Guide] Texture Numbers and Script.ani Effects (Intermediate)
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum