Script
Posted: Mon Aug 23, 2010 4:37 pm
Hey. There's a metal grate in my level, and I want it to remove, when a bomb near it explodes. And I also want player not to be able to "kill" that grate with its weapons. So I made two scripts.
And for bomb:
But I guess the problem is in first script. I changed the "metal_grate_event" attribute to initial = 1, and the metal grate was still there.
Code: Select all
{
Spawn[()
{
Console(true);
BoxWidth(30);
BoxHeight(3);
if(GetAttribute("metal_grate_event", "Player") = 1)
{
NewOrder("Die");
}
else
{
RestartOrder();
}
}]
Die[()
{
Remove(true);
}]
}
Code: Select all
{
HEALTH [10]
HEALTHATTRIBUTE [enemy_health]
BOOM [Barrelboom]
Spawn[ ()
{
Console(true);
AttributeOrder(HEALTHATTRIBUTE, HEALTH, "Death");
IsPushable(false);
LowLevel("Idle");
} ]
Death[ ()
{
FadeOut(2, 0);
Remove(true);
} ]
//LowLevel routines
Idle[ ()
{
if (self.health = 0)
{
ModifyAttribute("metal_grate_event", 1, "Player");
AddExplosion("GeneralExplosion", "", 0, 0, 0);
DamageArea(30, 200, "health");
DamageArea(65, 200, "enemy_health");
HighLevel("Death");
}
} ]
}
But I guess the problem is in first script. I changed the "metal_grate_event" attribute to initial = 1, and the metal grate was still there.