I have a host of tanks for my RTS. Their metal flags have been switched on, but only one tank, and only its body, applies the metal flag. This is the code:

Code:

action AmerTankTurret
{
my.metal = on;
my.enable_click = on; //enable click
my.event = selectMe; //select unit if he is clicked
while(you.health > 0)
{
if(my.selected == on) { you.selected == on; }
if(you.selected == on) { my.selected == on; }
my.x = you.x;
my.y = you.y;
my.z = you.z;
if(you.mode != 3)
{
my.pan = you.pan;
}
wait(1);
}
}

action AmerTank //controls USA 5 tanks, FT-17, Sherman, Patton, Abrams and MacArthur
{
my.metal = on;
my.health = 250 + amerTankBonus;
my.enable_click = on; //enable click
my.event = selectMe; //select unit if he is clicked
my.team = 1; //team is set to 1, these are the player's units
my.type = 2; //is a vehicle
my.mode = 0; //moving or no?
my.pan = ang(my.pan); //set rotation to -180 . . . +180 range
my.selected = off;
if(curEra == ww1) { ent_create(ftTurret,my.x,AmerTankTurret); }
if(curEra == ww2) { ent_create(shermTurret,my.x,AmerTankTurret); }
if(curEra == viet) { ent_create(patTurret,my.x,AmerTankTurret); }
if(curEra == mod) { ent_create(m1Turret,my.x,AmerTankTurret); }
if(curEra == maakra) { ent_create(macTurret,my.x,AmerTankTurret); }
while(my.health > 0)
{
if(my.selected == on) //if selected
{
if(my.selecter != 1) //if doesn't have selection ring
{
ent_create(selectBMP,my.x,selectSprite); //create it
my.selecter = 1; //set selecter to one
}
if(unselect == 1)
{
my.selected = off; //deselect if something else is clicked on
}
if(mouse_right) //if rightclicked while selected
{
mouse_trace(); //find coordinate
vec_set(my.targX,target); //set to unit's targets
my.mode = 1; //set him to move
}
}
if(my.mode == 1)
{
vec_set(temp,my.targX);
vec_diff(temp,temp,my.x);
vec_to_angle(my.angAtt,temp);
my.angAtt = ang(my.angAtt);
//while(my.
if((my.tilt < 0) || (my.tilt > 0)) { my.tilt = 0; }
if((my.roll < 0) || (my.roll > 0)) { my.roll = 0; }
my.skill22 = 5 * time;
my.skill23 = 0;
my.skill24 = 0;//-2.5;
move_mode = ignore_passable + ignore_sprites + glide;
ent_move(my.skill22,nullvector);
if(vec_dist(my.x,my.targX) <= 60) { my.mode = 0; breakpoint; }
}
wait(1);
}
//run death animation, make passable and remove
ent_remove(me);
}



Other than the metal flag, the code works so far, although it is still in developement. Since the tank has no skin (i need to buy ultimate unrap), metal would make the tank easier to see.


"Oh no, it's true! I'm a love magnet!" Calvin from Calvin and Hobbes My name's Anonymous_Alcoholic.