Author Topic: Manual Projectile Detonation?  (Read 1779 times)

 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?
« Last Edit: April 28, 2011, 09:06:35 AM by FrogFreak »

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.

Yay, another person who has no idea what they're doing giving advice.

Code: [Select]
function MyWeaponImage::onFire(%this, %obj, %slot)
{
%proj = parent::onFire(%this, %obj, %slot);

%proj.schedule(1000, "explode");

return %proj;
}

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.

Yay, another person who has no idea what they're doing giving advice.

Code: [Select]
function MyWeaponImage::onFire(%this, %obj, %slot)
{
%proj = parent::onFire(%this, %obj, %slot);

%proj.schedule(1000, "explode");

return %proj;
}

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.
so onFire returns a projectile or something? :s


Ok, thank you Iban.  Also, if you don't mind, what is "armor"?

Ok, thank you Iban.  Also, if you don't mind, what is "armor"?
players


players
Wrong.

"Player" is the class of a controllable object that is what we consider the player.
"Armor" is a type of.. body. It determines what model a player will have, what the properties of movement will be, and a bunch of other stuff. "Players" are instantiations of an Armor type. Armor is also a Datablock, player is just an object.

So, is "armor" basically... you, where it includes every aspect of you, including client info and player info and player input?

I am a player.
HumanNonathleticArmor is my armor.

Wrong.

"Player" is the class of a controllable object that is what we consider the player.
"Armor" is a type of.. body. It determines what model a player will have, what the properties of movement will be, and a bunch of other stuff. "Players" are instantiations of an Armor type. Armor is also a Datablock, player is just an object.
...
Yeah, I worded that wrong.

Hmm, well, thanks again.

Correct.
Oh wow.
Good to know.
Also a thanks from me. :3