Blockland Forums > Modification Help
Manual Projectile Detonation?
FrogFreak:
Is it possible to add a feature that checks for input (EG: altfire), with which, if you use that input (Like altfire), any projectile from the weapon will manually and prematurely detonate?
flametail:
I am sure it is possible, as it is done with the C4 add-on.
Just dont know how.
Go get the c4 add-on and read through it.
The c4 is planted, and a timer is set.
C4 goes off either when the timer expires or you jet, whichever comes first.
Iban:
Yay, another person who has no idea what they're doing giving advice.
--- Code: ---function MyWeaponImage::onFire(%this, %obj, %slot)
{
%proj = parent::onFire(%this, %obj, %slot);
%proj.schedule(1000, "explode");
return %proj;
}
--- End code ---
This is by memory, but should explode the projectile created 1000ms after it's launched.
You can store this %proj variable on the %obj or something and then parent the armor::onTrigger function to explode it.
lordician:
--- Quote from: Iban on April 28, 2011, 01:26:40 PM ---Yay, another person who has no idea what they're doing giving advice.
--- Code: ---function MyWeaponImage::onFire(%this, %obj, %slot)
{
%proj = parent::onFire(%this, %obj, %slot);
%proj.schedule(1000, "explode");
return %proj;
}
--- End code ---
This is by memory, but should explode the projectile created 1000ms after it's launched.
You can store this %proj variable on the %obj or something and then parent the armor::onTrigger function to explode it.
--- End quote ---
so onFire returns a projectile or something? :s
Iban:
Correct.