Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WAR!
#1
WAR!

"War! Huah! Tell you what it's good for. Absolutely nothing!"

"Well, nobody wants war." - James T. Kirk (Star Trek: Errand of Mercy)



Now before I begin, allow me to state that this tutorial covers three different 'warfare' systems that were polularized by Suikoden and recreated by Kamau for his Legion Saga series (an RPGMaker 2000 series of games). The original RM2K system engine had the interesting feature of being able to utilize map event code in much the same way as calling common events. Unless you utilize a script to perform the same function as the 'Call Map Event' code, this system had to be re-tooled for RPGMaker XP.


Demo
Demo Here


Descriptions
For tutorials on each system (rather than scrolling down), click on a desired link.
War #1: Static Armies
War #2: Flashy Armies
War #3: Multi-Unit Armies (did not really write alot, but it is still available in the demo
Reply }
#2
Now like I stated earlier, the very first map in my demo used a simple Map Event to change the values of three RMXP variables:

@>Control Variables: [0001: HERO ARMY Size] = 5000
@>Control Variables: [0002: ENEMY ARMY Size] = 5000
@>Control Variables: [0003: ENEMY ARMY Decision] = Random No. (0...3)


And again, all this does is reset both armies to have 5000 troops each and decides what the first action the enemy army will take. After that, your hero's characterset graphic was erased and you were then transported to the battlefield you chose. In this case...

WAR #1:
STATIC ARMIES

The basic premise of this war system is simply a 'Rock, Paper, Scissors' game. You only have three options to choose from in battle: Sword, Bow or Staff. And it works pretty much the same as the old 'Rock covers Paper' system. Sword attacks can beat the archers, Bow attacks can beat the mages and the Staff attacks work wonders on the infantry.


Screenshots.
Just one...


Setting up the look of the battlefield.
As this is a simple battlefield system, you only need one standard-sized map of 20x15. Decorate this 'battlefield map' as you see fit, but try to leave the bottom half of the screen relatively bare so your armies can be seen in the field. Of course, this is only a suggestion. You may alter or change the layout of your battlefield so the armies aren't facing each other side to side but top down.

Setting up the Armies
As a general practice, most event-based army battles are played with RPGMaker XP in a side-to-side fashion. Enemy troops placed along the left side of the screen and the hero's army along the right. Again, let me just say that this is just a suggestion and can be changed to suit your tastes.

The Hero's General
The master control of this battlefield is controlled through the Hero's Event. It is a map event that comprises 6 pages of event code and most of these are parallel process events. It is by this set of events that your battlesystem works and you get to decide the actions of your troops.

Page #1 - The Introduction Page:
Graphic is set to a hero's image
Switches are not used
Variables are not used
SelfSwitches are not used
Trigger is set to AutoRun
Options are set to 'Move Animation' and 'Always on Top'

Other than this page being the first event activated, not much is really performed in this page. It merely presents some dialog before the battle begins and 'may' give a briefing on how to play the battlesystem. After it has played out, it then (FINALLY) turns on Switch #1 to start the battlesystem.

Introduction Event Code

As you can see, the only value used here is the 0001: BATTLE Begin Switch. It activates the next series of pages and allows the battlesystem to function.

-----


Page #2 - The Hero Decision Page:
Graphic is set to a hero's image
Switches are set to #0001: BATTLE Begin
Variables are not used
SelfSwitches are not used
Trigger is set to Parallel Process
Options are set to 'Move Animation'

This is literally the heart of the system. Once the 1st page has completed performing its actions this page and its related 'Action' pages will take over and will continually run until the battle is over.

From here, your player will decide what action the army will take, be it Sword, Bow or Staff. And just to be on the safe side, this demo's system uses an extra 'Yes/No' confirmation in case the player chose the wrong option by accident. In any event, one of three switches (#3, #4 or #5) will be turned on to identify which action the player chose to take.

Hero Decision Event Code

To make it example simple here, I merely showed the 'Sword/Bow/Staff' decision and didn't show the additional 'Yes/No' choice. This was to show you that each decision available merely turned on a switch. If you chose the 'Sword', you activate the 0003: ACTION - Sword Switch. If you chose the 'Bow', you activate the 0004: ACTION - Bow Switch And if you chose the 'Staff', you activate the 0005: ACTION - Staff Switch.

Once you make your decision, control of the battlesystem will be turned over to a page in this event that has a matching Switch condition (which ever switch you just turned on: Sword, Bow or Staff).

Other than you inserting finer details like text of the 'yes/no' confirmation case (your choice), that is all that is necessary for this page.

-----


Page #3 - The Sword Action Page:
Graphic is set to a hero's image
Switches are set to #0001: BATTLE Begin and #0003: Action - Sword
Variables are not used
SelfSwitches are not used
Trigger is set to Parallel Process
Options are set to 'Move Animation'

One of the big 'Action Control' pages, this page becomes active once the '0003: ACTION - Sword' switch is turned on.

Basically, this event starts off by randomly choosing an action for the enemy, and then it branches to one of three conditions based on that random enemy action. Each of these three conditions calculat what the enemy and hero army losses are depending on that action against the hero's use of the 'Sword' action.

Let's look at it in a 'simplified' manner.

Sword Event Code

This sample code doesn't have the flashy graphics or sound effects as the demo does, but it does present you with the inner workings of the system.

Again... as I have stated earlier, this page will decide what action the enemy army will take. This is performed by choosing a random number between 1 to 3 and storing the value within variable 0003: ENEMY ARMY Decision. This random number represents the enemy's chosen action of 'Sword, Bow or Staff. After the random number is chosen, the system performs a series of Conditional Branches.

The first branch (Variable [0003: ENEMY ARMY Decision] == 1) plays out what would happen if both the Hero and Enemy use the sword... a tie with both armies losing 400 men. The hero's army is reduced by subtracting 400 from the. 0001: HERO ARMY Size variable and the enemy army is reduced by subtracting 400 from the 0002: ENEMY ARMY Size variable. And with each reduction in size, a message box will show to describe the results to the player. Remember your basic text options: \v[1] will display the value in variable #1 and \v[2] will show the value in variable #2.

The second and third branches play out the same way, but the outcomes are different. The second branch assumes that the enemy used a bow and is overrun by the hero and he loses 600 men. Meanwhile the third branch assumes the enemy was fortunate and used the staff command, blasting the hero who loses 600 of his own.

And finally, after all of these decisions are done, the the 0003: ACTION - Sword switch is turned off. This releases control of the battlesystem back to the Hero Decision Page (Page #2), where you can decide upon another action... Sword, Bow or Staff.

-----


Pages #4 and #5 - The Bow and Staff Action Pages:
Graphic is set to a hero's image
Switches are set to #0001: BATTLE Begin and either #0004: Action - Bow or #0005: Action - Staff
Variables are not used
SelfSwitches are not used
Trigger is set to Parallel Process
Options are set to 'Move Animation'

These two pages are like the Sword Action page in that they too are large 'Action Control' pages. They only become active once the '0004: ACTION - Bow' or '0005: ACTION - Staff' switch is turned on.

Rather than re-displaying the entire code for both Bow and Staff pages, let me just say that the code within mirrors the Sword action pages with the exception of the outcome based on the enemy's reaction to the attack.

Again. this event starts off by randomly choosing an action for the enemy, and then it branches to one of three conditions based on that random enemy action. But unlike the Sword page, the outcomes will be based on the hero's use of either Bow or Staff. The same variables that determine the enemy's reaction (#0003) and the size of the Hero's and Enemy's armies (#0001 and #0002) are exactly the same. The only real differences will be within the conditional branches and the number of troops lost.

For the Bow page, the first condition will reflect the heroes using a bow while the enemy uses the sword. Basically, the hero loses 600 men. The second condition will reflect both heroes and enemies using bows so both lose 400 men. And the third condition in the Bow page will reflect the heroes pummelling the enemy, making the enemy lose 600 men.

The Staff page isn't that much different. It just reflects hero and enemy losses in a different manner.

And after all is performed, their respective 0004: ACTION - Bow or 0005: ACTION - Staff switch is turned off, releasing control back to the Hero Decision Page.

-----


Page #6 - The End Battle Page:
Graphic is set to a hero's image
Switches are set to #0002: BATTLE Ends
Variables are not used
SelfSwitches are not used
Trigger is set to Action Button
Options are set to 'Move Animation'

A necessary evil, this page holds no events calls and will halt all actions performed by this event. Basically, this ends the battlesystem's action system.


The Enemy's General
While the Hero's Event controls the working system, it is the Enemy's event that determines and controls 'end-of-battle' results. This map event has only 4 pages of event code that are mostly parallel processes or auto-run features. It's pretty much a simple system.


Page #1 - The Introduction Page:
Graphic is set to an enemy's image
Switches are not used
Variables are not used
SelfSwitches are not used
Trigger is set to Action Button
Options are set to 'Move Animation'

The first page is a blank page. In this instance there is nothing going as the battle hasn't started. It's pretty much dead weight, but necessary.

-----


Page #2 - The Judgement Page:
Graphic is set to an enemy's image
Switches are set to #0001: BATTLE Begin
Variables are not used
SelfSwitches are not used
Trigger is set to Parallel Process
Options are set to 'Move Animation'

This page runs constantly once the battle starts thanks to Switch #1 being turned on.

The function of this page is very simple. It runs checks on the enemy's and hero's army size and turns on a switch signalling the defeat of an army.

The code is so simple...

Judgement Event Code

See?

The first branch checks to see if the enemy's army (0002: ENEMY ARMY Size) had reached or gone below 0. This would mean the defeat of the enemy. Once that is done, the system would turn on two switches: 0008: DEFEAT - Enemy and 0002: BATTLE End. The first switch signals that the enemy's army was defeated (and not the hero's). The second switch turns off the battle.

The second branch mirrors the first as it checks to see if the hero's army (0001: HERO ARMY Size) had reached or gone below 0. Once that is confirmed, the system would turn on two switches: 0007: DEFEAT - Hero and 0002: BATTLE End. The first switch signals that the hero's army was defeated (and not the enemy), while the second switch turns off the battle.

That's really all there is.

-----


Page #3 - The Hero's Defeat Page:
Graphic is set to an enemy's image
Switches are set to #0007: DEFEAT - Hero
Variables are not used
SelfSwitches are not used
Trigger is set to AutoRun
Options are set to 'Move Animation'

This is one page that the player really doesn't wanna see, but is necessary. The page that runs when the player loses the war.

It is activated when the Hero's defeat is determined in the previous Judgement page. After the Judgement page turns the 0007: DEFEAT - Hero switch on, this page takes hold and runs uninterrupted thanks to the 'AutoRun' trigger.

No fancy switches turned on or off. No variables added to or subtracted from. Nothing. This page really doesn't do too much other than transferring the player to the 'Game Over' screen, but gamemakers will typically add text to personalize the defeat of the hero as you can see below.

@>Wait: 15 frame(s)
@>Text: Ahhhhh!
@>Wait: 20 frame(s)
@>Change Screen Color Tone: (-255,-255,-255,0), @20
@>Game Over
@>


-----


Page #4 - The Hero's Victory Page:
Graphic is set to an enemy's image
Switches are set to #0008: DEFEAT - Enemy
Variables are not used
SelfSwitches are not used
Trigger is set to AutoRun
Options are set to 'Move Animation'

Now this is the page the player WANTS to have run. This page runs when the player wins the battle the battle

Like the Defeat page above, this one doesn't have any fancy switches or variables being adjusted. What this page performs, however, is that you are transported out of the battlefield and the hero's characterset graphic is restored. Any additional text can be added to personalize the victory.

@>Wait: 15 frame(s)
@>Text: We WON! CHEEERRSSSS!
@>Wait: 20 frame(s)
@>Transfer Player:[002: VICTORY MAP], (009,007), Down
@>Change Actor Graphic: [Aluxes], 001-Fighter01, 0,,0
@>


The Troops
While the hero and enemy generals control the war system, it's the troops that fill the screen. Placed alongside or in front of their respective commanders on the map, these events represent the men on the field. Each event holds 2 pages or conditions based on troop strength and these two pages are devoid of event calls. They perform no action other than being displayed. Each of these troops are similar in design with the exception of the graphics used and the Army Size variable and value condition.

Page #1 - The Empty Page:
Graphic is left empty
Switches are not used
Variables are not used
SelfSwitches are not used
Trigger is set to Action Button
Options are set to 'Move Animation'

This page is intentionally left blank. No fancy switches, no variables and not even a graphic. This event is only turned on or activated if certain conditions or values are met.... Basically if this TROOP event is killed.

--

Page #2 - The Troop's Alive Page:
Graphic is set to either a hero's or enemy soldier's image
Switches are not used
Variables are set to 0001: HERO ARMY Size or 0002: ENEMY ARMY Size (and set to a value indicating army strength)
SelfSwitches are not used
Trigger is set to Action Button
Options are set to 'Move Animation'

This page is different. It is customized and reflects a number of troops on the field... from either the hero's or the enemy's army. If this event represents members of the hero's army, the graphic used in this page will be that of the hero's soldiers and the variable used would be 0001: HERO ARMY Size. Otherwise the graphic used in this page will be that of the enemy's soldiers and the variable used would be 0002: ENEMY ARMY Size.

And with each troop, you adjust the 'condition' to be met by the army size variable (either 0001 or 0002). The range of this value condition may be as low as '1' which is met if almost the entire army is wiped out, or as high as 4000 if the army has 4000 troops or more.

The number of troops for the hero's or enemy's army is really up to you, the game designer.

And after that... it's ready to run.


After the battle...
Well, this was designed for use once, but resetting the system is a piece of cake. It's just a matter of restoring your hero's characterset graphic (like I stated in the Hero's Victory page earlier), resetting your variables and switches, and making a new battlefield map with similar events. Dialog may be different... the army sizes may be different and the teleport event may take the hero to a different map... but the basic mechanics will be the same. But what you need to reset is pretty short:

Switches:
0001: BATTLE Begin
0002: BATTLE End
0003: ACTION - Sword
0004: ACTION - Sword
0005: ACTION - Sword
0007: DEFEAT - Hero
0008: DEFEAT - Enemy

Variables:
0001: HERO ARMY Size
0002: ENEMY ARMY Size
0003: ENEMY ARMY Decision

And there you have it. One complete War system.
Reply }
#3
Back for round two... and again as I stated earlier, the very first map in my demo used a simple Map Event to change the values of three RMXP variables:

@>Control Variables: [0001: HERO ARMY Size] = 5000
@>Control Variables: [0002: ENEMY ARMY Size] = 5000
@>Control Variables: [0003: ENEMY ARMY Decision] = Random No. (0...3)


And again, all this does is reset both armies to have 5000 troops each and decides what the first action the enemy army will take. After that, your hero's characterset graphic was erased and you were then transported to the battlefield you chose. In this case...


WAR #2:
FLASHY ARMIES

The basic premise of this war system is also a simple 'Rock, Paper, Scissors' game, but with a little extra touch. Normally, you would only have three options to choose from in battle: Charge, Arrow or Orbcraft. And it works pretty much the same as the old 'Rock covers Paper' system. Infantry charges can beat the archers, archer's arrows can disrupt the mages and the Mage's orbcraft skills can blast apart the infantry.

Screenshots.
Three this time...

Setting up the look of the battlefield.
The fun part of this battlesystem is that the field of battle made much larger than just one 20x15 screen. While most of the attention focuses on the hero's army, this system pans across the field of battle to show the enemy's army and into the middle of the battlefield itself to show the armies collide in combat.

Doesn't that sound interesting?


Setting up the Armies
As a general practice, most event-based army battles are played with RPGMaker XP in a side-to-side fashion. Enemy troops placed along the left side of the screen and the hero's army along the right. Again, let me just say that this is just a suggestion and can be changed to suit your tastes.


The Master Control
The master control of this battlefield is controlled through the Master Control Event. It is a map event that comprises 7 pages of event code and most of these are parallel process events. It is by this set of events that your battlesystem works and you get to decide the actions of your troops.

Page #1 - The Introduction Page:
Graphic is left empty
Switches are not used
Variables are not used
SelfSwitches are not used
Trigger is set to AutoRun
Options are set to 'Move Animation'

Other than this page being the first event activated, not much is really performed in this page. It basically presents some dialog before the battle begins and 'may' give a briefing on how to play the battlesystem.

One of the options in this version is that it also presents you with a choice of 'battle partner'. This is a NPC character who can give you a special bonus ability to use in combat which you can use a couple times.

After it has played out, it then (FINALLY) turns on Switch #1 to start the battlesystem.
Introduction Event Code

First off, you can see that four variables are set up in this event. The first one is the 0012: TURN - Counter value that does nothing but indicate the number of turns have passed. It's a luxury unless you decide to make an 'event' that is truggered after a number of turns. The next three values are the SPECIAL - Count values (#6, 7, and 8 ) that holds how many times an action can be used by you or your 'battle partner''. The first value indicates the number of times the main hero can use his special ability, the second indicates how many times his 'advisor' can use HIS special ability and the third for his 'battle partner's' ability. The way THIS demo is set up, you can have one of four special partners. And as you may notice, the hero's only able to use his ability once while any other character cah use his/her ability twice. I'll talk about using them later.

Now after all the fun text that was entered (including the use of the Scroll Map event to pan across the battlefield), you have a Show Choices event that gives you the option to select your 'battle partner'. When you do, you set the 0005: SPECIAL - Type variable. This indicates which 'battle partner' you're using. You may notice that this allows you to have 'no' battle partner. Also set up in this Show Choices block of code is a Jump to Label call that can restart the choice process if the player made an error. It returns you to the Restart Choce event that is at the beginning of the Choices block.

After all that, you finally encounter the 0001: BATTLE Begin Switch. It activates the next series of pages and allows the battlesystem to function.


----

Page #2 - The Decision Page:
Graphic is left empty
Switches are set to #0001: BATTLE Begin
Variables are not used
SelfSwitches are not used
Trigger is set to Parallel Process
Options are set to 'Move Animation'

This is literally the heart of the system. Once the 1st page has completed performing its actions this page and its related 'Action' pages will take over and will continually run until the battle is over.

From here, your player will decide what action the army will take, be it Charge, Arrow, Orbcraft, or a number of other options. In any event, one of three switches (#3, #4, #5 or #6) will be turned on to identify which action the player chose to take. There IS a limit however. If the player attempts to choose a special skill that has limited uses (it may only be used twice), then it redirects the player to start deciding over again.

Decision Event Code

This one is not as simple in design as the first battlesystem's decision control page.

First, you are brought to an "Action/Special/Advice decision. This branches to one of three SUB sets of decisions, whether you perform the generic attack, use a special attack, or get some advice or information on the battle's progress.

The first SUB branch (if the player chooses the 'ACTION' option) is the standard Charge/Arrow/Orbcraft decision. If you chose "Charge", you activate the 0003: ACTION - Sword Switch. If you chose "Arrow", you activate the 0004: ACTION - Bow Switch And if you chose the "Orbcraft", you activate the 0005: ACTION - Staff Switch. And once you make your decision, control of the battlesystem will be turned over to a page in this event that has a matching Switch condition (which ever switch you just turned on: Sword, Bow or Staff).

The second SUB branch (If the player chooses the 'SPECIAL' option) has a conditional branch that sees if you selected a 'battle partner' or not. That branch uses the 0005: SPECIAL - Type variable. If the value is 0, then you chose no 'battle 'partner'. If you chose no battlepartner, it uses another set of branches to see if you're chosing the hero's own ability or that of the 'advisor npcs' ability. In either case, it will do a quick check to see how many times you used that ability (SPECIAL-Count1 or SPECIAL-Count2) and if you didn't use it up, it will activate the 0006: ACTION - Special switch, set the 0004: SPECIAL - Used variable to either 1 or 2 (whichever special skill is used), and subtract 1 usage from the special counter (SPECIAL-Count1 or SPECIAL-Count2). However, if you DO have a battlepartner (the 0005: SPECIAL - Type being 1 or higher), then you can choose one of three abilities... mirroring the previous mini-block of code. Time consuming but worth it.

The last SUB branch (if the player chooses the ADVICE option) gives you the option to get a report on the war's status or a basic tutorial on how to play. The war's status is brought up in a text box that shows the values of variables 12, 1 and 2 (turns, hero's army and enemy's army). The tutorial is just plain text.

Other than you inserting finer details like text of the 'yes/no' confirmation case (your choice), that is all that is necessary for this page.

----


Page #3 - The Charge Action Page:
Graphic is empty
Switches are set to #0001: BATTLE Begin and #0003: Action - Sword
Variables are not used
SelfSwitches are not used
Trigger is set to Parallel Process
Options are set to 'Move Animation'

One of the big 'Action Control' pages, this page becomes active once the '0003: ACTION - Sword' switch is turned on.

Basically, this event starts off by branching to one of three conditions based on the enemy's randomly chosen action. Each of these three conditions perform some nice panning and animation before calculating what the enemy and hero army losses are. Afterwhich, the system Adds '1' to the turn counter, cleans up the army totals, presents the outcome of the attack, decides what the enemy will do next and then finally turns the '0003: ACTION - Sword' switch off.

Let's look at it in a 'simplified' manner.

Charge! Event Code

This is about as simplified as it can be shown.

Again... as I have stated earlier, this page will decide what action the enemy army will take. This is performed by it branching on the value stored within variable 0003: ENEMY ARMY Decision . Unlike the first WAR system (STATIC ARMIES), the first enemy decision value is started in that map event at the beginning of this tutorial. The next time the enemy makes a decision will be at the end of this event.

The first branch (Variable [0003: ENEMY ARMY Decision] == 1) plays out what would happen if both the Hero and Enemy use the charge attack... a tie with both armies losing between 350 to 400 men. After the hero gets to display some text, the camera/viewpoint moves across the map with the Scroll Map command. Then, the enemy gets to deliver some text afterwich the camera/viewpoint moves to the center of the screen. Then it's magic time. A custom 'battle animation' made for the system shows two armies running into each other with casualties on both sides. The hero's army is then reduced by subtracting 400 from the. 0001: HERO ARMY Size variable and the enemy army is reduced by subtracting 400 from the 0002: ENEMY ARMY Size variable.

The second and third branches play out the same way, but the outcomes are different. The second branch assumes that the enemy used his archers and is overrun by the hero and he loses 400 to 450 men and the battle animation reflects the archers being overrun.. Meanwhile the third branch assumes the enemy was fortunate and used thier orbrcraft skills, literally blasting the hero with magic who loses 400 to 500 of his own. Again, the battle animation shown displays the matic attacks too.

After all these decisions have been made, the system then adds '1' to the number of turns taken during this battle with the 0012: TURN - Counter variable. And then it uses a series of conditional branches to make sure the number of troops in the hero's and enemy's armies is NOT below zero. [i]It looks bad on the screen to have -32 members left in your army.

And finally, after all of these decisions are done, the enemy makes his next battle decision by choosing a random number between 1 to 3 and storing the value within variable 0003: ENEMY ARMY Decision .. And then the 0003: ACTION - Sword switch is turned off. This releases control of the battlesystem back to the Decision Page (Page #2), where you can decide upon another action... Charge, Archer, Orbcraft, etc.

-----


Pages #4 and #5 - The Arrow and Orbcraft Action Pages:
Graphic is empty
Switches are set to #0001: BATTLE Begin and either #0004: Action - Bow or #0005: Action - Staff
Variables are not used
SelfSwitches are not used
Trigger is set to Parallel Process
Options are set to 'Move Animation'

These two pages are like the Charge Action page in that they too are large 'Action Control' pages. They only become active once the '0004: ACTION - Bow' or '0005: ACTION - Staff' switch is turned on.

Rather than re-displaying the entire code for both Archers and Orbcraft pages, let me just say that the code within mirrors the Charge action pages with the exception of the outcome based on the enemy's reaction to the attack.

Again. this event starts off by branching to one of three conditions based on that random enemy action. But unlike the Charge page, the outcomes will be based on the hero's use of either Archers or Orbcraft. The same variables that determine the enemy's reaction (#0003) and the size of the Hero's and Enemy's armies (#0001 and #0002) are exactly the same. The only real differences will be within the conditional branches and the number of troops lost and the battle animations.

For the Archer page, the first condition will reflect the heroes using a bow while the enemy uses the charge attack. Basically, the hero loses 400 to 450 men. The second condition will reflect both heroes and enemies using archers so both lose 350 to 400 men. And the third condition in the Archer page will reflect the heroes pummelling the enemy, making the enemy lose 400 to 450 men.

The Orbcraft page isn't that much different. It just reflects hero and enemy losses in a different manner.

It then performs the same turn counting, the same enemy/hero army size checks, and decides the next action for the enemy.
.
And after all of that performed, their respective 0004: ACTION - Bow or 0005: ACTION - Staff switch is turned off, releasing control back to the Decision Page.

----


Page #6 - The Support/Backup Action Page:
Graphic is empty
Switches are set to #0001: BATTLE Begin and #0006: Action - Special
Variables are not used
SelfSwitches are not used
Trigger is set to Parallel Process
Options are set to 'Move Animation'

One of the big 'Action Control' pages, this page becomes active once the '0006: ACTION - Special' switch is turned on.

Basically, this event starts off by branching to one of three conditions based on the enemy's randomly chosen action. Each of these three conditions perform


Support/Backup Event Code


Yyyeah. This is the 'simplified' version. And I will discuss it only in brief.

The first main branch set is based on the '0004: SPECIAL - Used' value which is chosen by the player. If it is set to 1, then the hero is performing his special ability. If it is set to 2, then the hero's advisor is performing HIS special ability. And if it's set to 3, then it's the backup character's ability (whoever that may be). Remember that the backup character is chosen at the start of the battle.

Now in every case, you basically have the hero (or character) delivering some text... the camera/screen scrolls left... and a battle animation is performed. The battle animation being geared towards that action. Afterwhich, some math which affects the armies is performed. The hero delivers a hit that makes the enemy lose 400 to 500 troops. Additional smaller branches within this first branch permits the he backup characters to return troops, bribe troops (losing some gold in the process), or deliver solid hits on the enemies as well. Mind you, the hero's advisor's block of code...? He doesn't attack at all. He just advises.

The hero's advisor reads the data in the 0003: ENEMY ARMY Decision value and prints out the enemy's move. After the advisor does this, the system turns the 0006: ACTION - Special switch OFF and the system resets. Note that the advisor's block of code is the only one where the switch is turned off immediately. This prevents the enemy from taking his turn.... or simulates the notion that the advisor is giving the hero a heads up on his next action.

The second main branch is performed after the first (duh), but only if the advisor's actions aren't performed... IE, after checking the 0004: SPECIAL - Used value. As long as it's not set to 2, then this block of code is performed.

Within this second branch, you will see another set of conditional branches based on the enemy's decision (again based on the 0003: ENEMY ARMY Decision value). The enemy says some text... the camera pans right... an animation is performed... and the hero loses some men. There's no attacks performed by the hero in here as that is covered in the first branch of commands. Pretty simple.

After the enemy's decision, we finish up by performing the same turn counting, the same enemy/hero army size checks, randomly deciding the next action for the enemy, and turning off the 0006: ACTION - Special switch which releases control back to the Decision Page.

Done.


----

Page #7 - The End Battle Page:
Graphic is empty
Switches are set to #0002: BATTLE Ends
Variables are not used
SelfSwitches are not used
Trigger is set to Action Button
Options are set to 'Move Animation'

A necessary evil, this page holds no events calls and will halt all actions performed by this event. Basically, this ends the battlesystem's action system.



The Battle Decision Control
While the Master Control Event controls the working system, it is the Battle Decision Control event that determines and controls 'end-of-battle' results. This map event has only 4 pages of event code that are mostly parallel processes or auto-run features. It's pretty much a simple system, and a mirror to the Enemy Control in the first WAR system.


Page #1 - The Introduction Page:
Graphic is empty
Switches are not used
Variables are not used
SelfSwitches are not used
Trigger is set to Action Button
Options are set to 'Move Animation'

The first page is a blank page. In this instance there is nothing going as the battle hasn't started. It's pretty much dead weight, but necessary.

-----


Page #2 - The Judgement Page:
Graphic is empty
Switches are set to #0001: BATTLE Begin
Variables are not used
SelfSwitches are not used
Trigger is set to Parallel Process
Options are set to 'Move Animation'

This page runs constantly once the battle starts thanks to Switch #1 being turned on.

The function of this page is very simple. It runs checks on the enemy's and hero's army size and turns on a switch signalling the defeat of an army.

The code is so simple...

Judgement Event Code

See?

The first branch checks to see if the enemy's army (0002: ENEMY ARMY Size) had reached or gone below 0. This would mean the defeat of the enemy. Once that is done, the system would turn on two switches: 0008: DEFEAT - Enemy and 0002: BATTLE End. The first switch signals that the enemy's army was defeated (and not the hero's). The second switch turns off the battle.

The second branch mirrors the first as it checks to see if the hero's army (0001: HERO ARMY Size) had reached or gone below 0. Once that is confirmed, the system would turn on two switches: 0007: DEFEAT - Hero and [b]0002: BATTLE End. The first switch signals that the hero's army was defeated (and not the enemy), while the second switch turns off the battle.

That's really all there is.

-----


Page #3 - The Hero's Defeat Page:
Graphic is empty
Switches are set to #0007: DEFEAT - Hero
Variables are not used
SelfSwitches are not used
Trigger is set to AutoRun
Options are set to 'Move Animation'

This is one page that the player really doesn't wanna see, but is necessary. The page that runs when the player loses the war.

It is activated when the Hero's defeat is determined in the previous Judgement page. After the Judgement page turns the DEFEAT - Hero switch on, this page takes hold and runs uninterrupted thanks to the 'AutoRun' trigger.

No fancy switches turned on or off. No variables added to or subtracted from. Nothing. This page really doesn't do too much other than transferring the player to the 'Game Over' screen, but gamemakers will typically add text to personalize the defeat of the hero as you can see below.

@>Wait: 15 frame(s)
@>Text: Ahhhhh!
@>Wait: 20 frame(s)
@>Change Screen Color Tone: (-255,-255,-255,0), @20
@>Game Over
@>


-----


Page #4 - The Hero's Victory Page:
Graphic is empty
Switches are set to #0008: DEFEAT - Enemy
Variables are not used
SelfSwitches are not used
Trigger is set to AutoRun
Options are set to 'Move Animation'

Now this is the page the player WANTS to have run. This page runs when the player wins the battle the battle

Like the Defeat page above, this one doesn't have any fancy switches or variables being adjusted. What this page performs, however, is that you are transported out of the battlefield and the hero's characterset graphic is restored. Any additional text can be added to personalize the victory.

@>Wait: 15 frame(s)
@>Text: We WON! CHEEERRSSSS!
@>Wait: 20 frame(s)
@>Transfer Player:[002: VICTORY MAP], (009,007), Down
@>Change Actor Graphic: [Aluxes], 001-Fighter01, 0,,0
@>



The Troops
While the hero and enemy generals control the war system, it's the troops that fill the screen. Placed alongside or in front of their respective commanders on the map, these events represent the men on the field. Each event holds 2 pages or conditions based on troop strength and these two pages are devoid of event calls. They perform no action other than being displayed. Each of these troops are similar in design with the exception of the graphics used and the Army Size variable and value condition. Again, this mirrors the first WAR system's set of event codes.

Page #1 - The Empty Page:
Graphic is left empty
Switches are not used
Variables are not used
SelfSwitches are not used
Trigger is set to Action Button
Options are set to 'Move Animation'

This page is intentionally left blank. No fancy switches, no variables and not even a graphic. This event is only turned on or activated if certain conditions or values are met.... Basically if this TROOP event is killed.

--

Page #2 - The Troop's Alive Page:
Graphic is set to either a hero's or enemy soldier's image
Switches are not used
Variables are set to 0001: HERO ARMY Size or 0002: ENEMY ARMY Size (and set to a value indicating army strength)
SelfSwitches are not used
Trigger is set to Action Button
Options are set to 'Move Animation'

This page is different. It is customized and reflects a number of troops on the field... from either the hero's or the enemy's army. If this event represents members of the hero's army, the graphic used in this page will be that of the hero's soldiers and the variable used would be 0001: HERO ARMY Size. Otherwise the graphic used in this page will be that of the enemy's soldiers and the variable used would be 0002: ENEMY ARMY Size.

And with each troop, you adjust the 'condition' to be met by the army size variable (either 0001 or 0002). The range of this value condition may be as low as '1' which is met if almost the entire army is wiped out, or as high as 4000 if the army has 4000 troops or more.

The number of troops for the hero's or enemy's army is really up to you, the game designer.

And after that... it's ready to run.


The Battle Leaders.
Rather plain and simple... on one side, where you have your enemy troop events massed together, you have a characterset event that shows the enemy general, and on the other side you have a couple events that show your hero and his advisor.

Well... a little more than that. You have one more event that has multiple pages. This being your 'backup' character. Nothing goes on in the event other than different graphics for each page and the Variable that turns each switch on (0005: SPECIAL - Type). If there is no special type, then it stays on the first page (with no graphic), but if set to '1', then the second page's character is shown... set to '2', the third page's character... and so on.


After the battle...
Well, this was designed for use once, but resetting the system is a piece of cake. It's just a matter of restoring your hero's characterset graphic (like I stated in the Hero's Victory page earlier), resetting your variables and switches, and making a new battlefield map with similar events. Dialog may be different... the army sizes may be different and the teleport event may take the hero to a different map... but the basic mechanics will be the same. But what you need to reset is pretty short:

Switches:
0001: BATTLE Begin
0002: BATTLE End
0003: ACTION - Sword
0004: ACTION - Sword
0005: ACTION - Sword
0006: ACTION - Special
0007: DEFEAT - Hero
0008: DEFEAT - Enemy

Variables:
0001: HERO ARMY Size
0002: ENEMY ARMY Size
0003: ENEMY ARMY Decision
0004: SPECIAL - Used
0005: SPECIAL - Type
0006: SPECIAL - Count1
0007: SPECIAL - Count2
0008: SPECIAL - Count3
0009: SPECIAL - Gold Spent
0010: SPECIAL - Current Gold
0011: SPECIAL - Calculations
0012: TURN - Counter

I know... I know... I didn't refer to variables 9 and 11. I simplified it further in this post. But any event... you now have one more complete War system
Reply }
#4
WAR #3:
MULTI-UNIT ARMIES

Multiple troops, multiple heroes and multiple actions. Even though the combat is still based on the 'Rock, Paper, Scissors' game, you control up to ten squads/troops/armies... whatever.


Screenshots.
Just one...
Reply }
#5
Hey DerVVulfman, as always great work. Had a question about this, to make it more realistic I guess. I was wondering if you could place a value on each of the three squads. Normally you just have a total number if troops, and all your casualties come from the one big number. I'm talking about having let's say having 2000 infantry, 1500 archers, and 1000 mages, and when you use infantry, archers, or mages, then the casualties subtract from the type you just used. For instance, you have attack with 2000 infantry, the enemy attacks with mages, they kill 500 infantry. Thus, you are left with 1500 infantry with no casualties to you archers or mages. Then obviously, if you have 0 infantry left, you can no longer choose that option. Just that thought. Thanks.
Reply }
#6
Awesome work. :D
Reply }
#7
Seems to be a beautiful system, reminds me very much Yggdra Union for GBA.
Could change the server, I am not able to download ...
I use Google Translator Confused , so my English is not so good Very cheery ! Be patient please! Winking
Reply }
#8
Whoops! My bad. I switched from one file sharing site to another and uploaded/doublechecked all my scripts and script demos.... but not my event system!!!

Fixed
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }




Users browsing this thread: