Scripting Explosions
Land mines, exploding drums and time bombs are all easily scripted using a pawn in Freevector. Below is the script for a landmine that can be used against the player, and a script for an exploding drum. The only difference is that the land mine checks for distance and the exploding drum checks whether or not it was hit.
{
LandMine[()
{
if(GetSquaredDistance(32))
{
AddParticleBone("bangeffect","bone1");
AddExplosion(1,32);
self.Visible = false;
self.setCollide = false;
self.Remove=true;
}
}]
ExplodingDrum[()
{
if(self.Hit)
{
AddParticleBone("bangeffect","bone1");
AddExplosion(1,32);
self.Visible = false;
self.setCollide = false;
self.Remove=true;
}
}]
}
|