Post by Dungeon Warden on Dec 6, 2004 16:02:44 GMT -5
This is a topic to discuss the technical aspects of my battle demo. If you have any questions on how it was done, any ideas on how to improve it, or ways to incorporate the battle system into your own custom battle system, post them here.
This is how I did it:
First create your character using the enemy graphic editor. Use this image in the Enemy Actions editor to create a new set of enemy actions.
For Wait, set Motion to wait and Move to X +28,Y -50 (the placement isn't important - change these numbers if you want.
Set the frame length to 1 so that the movement only takes one frame. The enemy character will jump to the position this way.
Leave the overall length at 30 (or whatever the default is). This will allow the character to wait without repeating the move command very often.
Make sure all the other actions are set to the same move distance. Since the other actions only cycle once, you can make the overall frame length as long or as short as you want (still limiting the move to one frame).
You should also edit the move (or add one to frame 1) of all the enemies so that they move to X -28 (to the left). This will help line up the enemies and the character models. Note that by changing the main frame count, you can add more move actions besides the move into position on that is needed.
Create new enemies using your character model and enemy action set. The stats for this enemy can be all 0 (except HP must be at least 1) since the enemy will not do the fighting. More on this later. The only thing, besides the enemy actions, you need to add is a modified action (incapacitate) condition that is perminate, battle only, and has no messages. This will fool the battle system into ignoring this enemy because it has already been defeated. When the battle is over you will get experience as if you defeated the enemy character so make sure treasure, exp, and gold are all set to zero.
Create a variable for each character. ex. Virks avatar (An avatar is a representative of a powerful being that fills in for that being and has mort of it's powers. I though this was a fiting name for the enemy characters so that's what I will call them from now on.
In the start battle script, (the default script has "close message window" as it's only command), add the following:
Data : Variable [Virks avatar] = Var [battleparticipants] -1 (er, I'm doing this from memory so if anyone want's to check the actually variable name, I'll correct this.)
Battle participants (i'll call it PB) contains the total number of enemies in the battle. This variable allows you to assign virk to the last enemy to appear in battle - which you will make sure is virks avatar. You can call enemies into battle, and you will need to change the number accordingly.
Note: The default battle system uses the order the enemy appear on screne to keep track of which enemy is the instigator or the target. That's why you need this number.
If you have more then one character, the leader should be BP - the number of party members. In my demo Vixen (leader) is BP-3, Bruce (second) is BP-2 and Yasha (last) is BP-1. This is so the avatar order will match up with the stat display order in the battle menu.
Note: you can only have four different types of enemies in battle at a time. i.e. there is a max of four units. If you wanted four member parties, two avatars would have to be identical. Since they have different order numbers, everything else would still work. By changing wait scripts and using special effects you might be able to make too idenical avatars look different. This is just a theory at this point.
When making Units, set the enemy unit(s) first and the avatar units last. The units must be in member order (see below) so it might be better to leave the avatar units out of the unit set up and then summon the avatars in member order when battle begins (possibly in the enter battle script for each character).
Warning: Make sure the enemy is small enough to fit on the screen with the avatars. Even though the maximum number of enemies is 100, there is a limit to how many will fit on the screen. You can back the camera up to make everything smaller or make all the units smaller. You might even set the camera depending on the number of units in battle. The default camera will have to start as far out as your largest unit for this to work, I think.
Now that the character is linked to the avatar through the battle order number, you can change the scripts to control the avatars. In Member Damage, Critical, and new death add the following:
Check who goes first
SB Repeat : Flag Member Order = off
Check who goes Next
{SB Condition : Var [Vixens Avatar] = Enemymemberorder
{SB Condition : Var [Target Member] = 1 (use the database number of the character being attacked)
{Enemy action = [damage] (or death is the case of New Death)
{Default Enemy action *
{Branch : To End
{End Condition
{End Condition
**Repeat the '{' section for each character.**
End Branch repeat
* Note: for death you need to create a new action - character death - if you want to display the death character on the battlefield.
Lastly you need to set up the weapons and abilities. You can have up to 20 enemy actions, so you could include several weapon and spell actions for each character. Change the Directing : attack(?), success and fail direct effect slots of the weapons from the VFX script to a Enemy Action Script. As long as you match the enemy action of the avatar to the weapon, two characters can use the same weapon and have different actions.
I think that's every thing. If anyone has any questions, let me know.
This is how I did it:
First create your character using the enemy graphic editor. Use this image in the Enemy Actions editor to create a new set of enemy actions.
For Wait, set Motion to wait and Move to X +28,Y -50 (the placement isn't important - change these numbers if you want.
Set the frame length to 1 so that the movement only takes one frame. The enemy character will jump to the position this way.
Leave the overall length at 30 (or whatever the default is). This will allow the character to wait without repeating the move command very often.
Make sure all the other actions are set to the same move distance. Since the other actions only cycle once, you can make the overall frame length as long or as short as you want (still limiting the move to one frame).
You should also edit the move (or add one to frame 1) of all the enemies so that they move to X -28 (to the left). This will help line up the enemies and the character models. Note that by changing the main frame count, you can add more move actions besides the move into position on that is needed.
Create new enemies using your character model and enemy action set. The stats for this enemy can be all 0 (except HP must be at least 1) since the enemy will not do the fighting. More on this later. The only thing, besides the enemy actions, you need to add is a modified action (incapacitate) condition that is perminate, battle only, and has no messages. This will fool the battle system into ignoring this enemy because it has already been defeated. When the battle is over you will get experience as if you defeated the enemy character so make sure treasure, exp, and gold are all set to zero.
Create a variable for each character. ex. Virks avatar (An avatar is a representative of a powerful being that fills in for that being and has mort of it's powers. I though this was a fiting name for the enemy characters so that's what I will call them from now on.
In the start battle script, (the default script has "close message window" as it's only command), add the following:
Data : Variable [Virks avatar] = Var [battleparticipants] -1 (er, I'm doing this from memory so if anyone want's to check the actually variable name, I'll correct this.)
Battle participants (i'll call it PB) contains the total number of enemies in the battle. This variable allows you to assign virk to the last enemy to appear in battle - which you will make sure is virks avatar. You can call enemies into battle, and you will need to change the number accordingly.
Note: The default battle system uses the order the enemy appear on screne to keep track of which enemy is the instigator or the target. That's why you need this number.
If you have more then one character, the leader should be BP - the number of party members. In my demo Vixen (leader) is BP-3, Bruce (second) is BP-2 and Yasha (last) is BP-1. This is so the avatar order will match up with the stat display order in the battle menu.
Note: you can only have four different types of enemies in battle at a time. i.e. there is a max of four units. If you wanted four member parties, two avatars would have to be identical. Since they have different order numbers, everything else would still work. By changing wait scripts and using special effects you might be able to make too idenical avatars look different. This is just a theory at this point.
When making Units, set the enemy unit(s) first and the avatar units last. The units must be in member order (see below) so it might be better to leave the avatar units out of the unit set up and then summon the avatars in member order when battle begins (possibly in the enter battle script for each character).
Warning: Make sure the enemy is small enough to fit on the screen with the avatars. Even though the maximum number of enemies is 100, there is a limit to how many will fit on the screen. You can back the camera up to make everything smaller or make all the units smaller. You might even set the camera depending on the number of units in battle. The default camera will have to start as far out as your largest unit for this to work, I think.
Now that the character is linked to the avatar through the battle order number, you can change the scripts to control the avatars. In Member Damage, Critical, and new death add the following:
Check who goes first
SB Repeat : Flag Member Order = off
Check who goes Next
{SB Condition : Var [Vixens Avatar] = Enemymemberorder
{SB Condition : Var [Target Member] = 1 (use the database number of the character being attacked)
{Enemy action = [damage] (or death is the case of New Death)
{Default Enemy action *
{Branch : To End
{End Condition
{End Condition
**Repeat the '{' section for each character.**
End Branch repeat
* Note: for death you need to create a new action - character death - if you want to display the death character on the battlefield.
Lastly you need to set up the weapons and abilities. You can have up to 20 enemy actions, so you could include several weapon and spell actions for each character. Change the Directing : attack(?), success and fail direct effect slots of the weapons from the VFX script to a Enemy Action Script. As long as you match the enemy action of the avatar to the weapon, two characters can use the same weapon and have different actions.
I think that's every thing. If anyone has any questions, let me know.