DeletedUser3731
Guest
Why is it that the troop deaths are evenly split up.
ie: 10,000 axemen attacking 10,000 swordmen 10,000 spearmen, and 10,000 archers behind a lvl 20 wall would get you -1248 swordsmen, spearmen, and archers.
My question is why in the hell are the spearmen even going in and are 33% of the axemen just chucking their axes at the archers up on the wall? How they hell are the archers dying.
Before each battle do they all just shake hand and 1/3 of each of the types of units stay while the other 2/3 give moral support from behind the wall?
They just get in lines and evenly split up the axemen into 1/3's?
What the hell xD
It should be like this (could use some fixing/help):
There are axemen, light cavalry, rams, and cats attacking swordsmen, archers , and trebuchets.
The trebs attack the rams.
The rams attack the wall.
The largest part of the attacking army (ie: axemen) gets attacked by the archers (maybe archer damage is increased based on wall level) then that part of the attacking group (ie: axemen) attacks the biggest defending group (ie: swordmen) until one side is wiped out (ie: axemen).
Then the archers (if the first largest army is now gone or smaller) attacks the current largest attackers group (ie: Light Cavalry).
Then the current largest attackers group attacks the current largest defending army group until one side is wiped out (ie: swordsmen).
And so on until either there are only rams or catapults on the attacker's side or there are no heavy cavalry, spearmen, or swordsmen on the defending side.
If there are no more attackings units on the attacker's side then the rams will be attacked by all the remaining defending troops. If the rams survive then they attack the wall again. Then the same thing happens for the catapults, all the defending army attacks the catapults and if the catapults survive then they attack the preselected building.
If there are no more defending units (not counting offensive units, archers, and any Hall of Orders)
then the attacking army will be attacked by any remaining offense and archers and by any berserkers.
If the attacking army wipes out all the defenders offense/archers/berserkers then it will plunder all resources then the catapults will catapult the preselected building.
Same thing if defense attacks offense/defense. The largest attacking group goes first (after rams) then everything get ran again.
I started to learn coding in september so go easy on my bad coding, point out errors if you can.
I just started making this code about an hour or so ago.
How can i make the + "x" + actually calculate? (ram - trebuchet = ramCurrent)?
then I replace x with ramCurrent?
ie: 10,000 axemen attacking 10,000 swordmen 10,000 spearmen, and 10,000 archers behind a lvl 20 wall would get you -1248 swordsmen, spearmen, and archers.
My question is why in the hell are the spearmen even going in and are 33% of the axemen just chucking their axes at the archers up on the wall? How they hell are the archers dying.
Before each battle do they all just shake hand and 1/3 of each of the types of units stay while the other 2/3 give moral support from behind the wall?
They just get in lines and evenly split up the axemen into 1/3's?
What the hell xD
It should be like this (could use some fixing/help):
There are axemen, light cavalry, rams, and cats attacking swordsmen, archers , and trebuchets.
The trebs attack the rams.
The rams attack the wall.
The largest part of the attacking army (ie: axemen) gets attacked by the archers (maybe archer damage is increased based on wall level) then that part of the attacking group (ie: axemen) attacks the biggest defending group (ie: swordmen) until one side is wiped out (ie: axemen).
Then the archers (if the first largest army is now gone or smaller) attacks the current largest attackers group (ie: Light Cavalry).
Then the current largest attackers group attacks the current largest defending army group until one side is wiped out (ie: swordsmen).
And so on until either there are only rams or catapults on the attacker's side or there are no heavy cavalry, spearmen, or swordsmen on the defending side.
If there are no more attackings units on the attacker's side then the rams will be attacked by all the remaining defending troops. If the rams survive then they attack the wall again. Then the same thing happens for the catapults, all the defending army attacks the catapults and if the catapults survive then they attack the preselected building.
If there are no more defending units (not counting offensive units, archers, and any Hall of Orders)
then the attacking army will be attacked by any remaining offense and archers and by any berserkers.
If the attacking army wipes out all the defenders offense/archers/berserkers then it will plunder all resources then the catapults will catapult the preselected building.
Same thing if defense attacks offense/defense. The largest attacking group goes first (after rams) then everything get ran again.
I started to learn coding in september so go easy on my bad coding, point out errors if you can.
I just started making this code about an hour or so ago.
HTML:
// Start of Tribal wars 2 battle mechanics;
function start() {
//START OF CHECK FOR, RAM && TREBUCHET && WALL;
if(attacker > 0){
if(ram > 0){
if(trebuchet > 0){
println("trebuchet killed " + "x" + " ram.");
if(ram > 0){
if(wall > 0){
println("ram attacks wall. wall loses " + "x" + " lvl and is now " + "x" + " lvl.");
}else{ //if(wall > 0){
println("no wall " + "x" + " return.");
} //}else{
}else{ //if(ram > 0){
println("no ram. wall is unchanged.");
} //}else{
}else{ //if(trebuchet > 0){
println("no trebuchet. ram is unchanged.");
} //}else{
if(ram > 0){
if(wall > 0){
println("ram attacks wall. wall loses " + "x" + " lvl and is now " + "x" + " lvl.");
}else{ //if(wall > 0){
println("no wall " + "x" + " return.");
} //}else{
} //if(ram > 0){
}else{ //if(ram > 0){
println("no ram. wall is unchanged.");
} //}else{
} //if(attacker > 0){
//END OF CHECK FOR, RAM && TREBUCHET && WALL;
} //function start() {
//defender && attacker var;
var defender = 1;
var attacker = 1;
//defender units;
var spearmen = 500;
var swordmen = 0;
var archer = 400;
var heavyCavalry = 0;
//attacker units;
var axemen = 500;
var lightCavlary = 0;
var mountedArcher = 100;
var ram = 10;
var catapult = 1;
//Hall of Orders;
var trebuchet = 5;
var berserker = 0;
//wall
var wall = 20
How can i make the + "x" + actually calculate? (ram - trebuchet = ramCurrent)?
then I replace x with ramCurrent?
Last edited by a staff member: