Author Topic: Tumble on shoot?  (Read 1538 times)

I need a code that will make it so that you can tumble when you shoot someone or when you click specifically.

You'd have to repackage Projectile::Damage and use the tumble(%obj, 1) function.
edit: i'd do it for you but i have no idea how projectile::damage works
« Last Edit: August 22, 2013, 10:58:19 PM by ultimamax »


Try this; won't work for clicking but (I think) it should work for projectile damage. Actually, any damage.

Code: [Select]
package TumbleOnDamaged
{
function Armor::onDamage(%this, %obj)
{
    %obj.tumble();
}
};
activatePackage(TumbleOnDamaged);


^ don't do this
Got a feeling someone would say this. He's probably right. I typed that on my iPod without being able to test it. I'll let someone else do one for you, I'm too tired at the moment.

Got a feeling someone would say this. He's probably right. I typed that on my iPod without being able to test it. I'll let someone else do one for you, I'm too tired at the moment.
Impressive, you managed to use all three of the most common excuses for not being able to code

Impressive, you managed to use all three of the most common excuses for not being able to code
Are you serious? I've made multiple addons in the past. I didn't come here to boast of my coding skills, simply to try to help. I posted that while fighting off sleep; I wouldn't have posted anything of I'd been thinking clearly. I do know how to code, just not as well as some of the other forumers. There is no need for you to come into Coding Help and get on my back because I made a single mistake. Instead, I'd appreciate it much more if you, I dunno, just told me that's not how to do it, then give me an example on how it would be done. I'm sure at some point in life you makes mistakes when coding, too. We all have to go through the learning curve; but there is no reason to beat people up on the way.

Anyway, how are they "excuses" if I admitted I was wrong and they're actually true? I am quite tired at the moment, as I just woke up. And how can I know for sure if something I've never tried before with coding works without being able to test it?


Bro, calm down. Nobody's attacking you. Your code itself wasn't particularly faulty, it's just not the right way to go about it. I've given poor advice before too-- there's no need to give excuses. It doesn't matter if you were tired, on your iPad, or didn't test it before you posted it. Thanks for chiming in, we appreciate that you want to help others code.

On Topic: OP, your message is barely coherent. Do you want the shooter to tumble, or the person who was shot? Do you want every gun to tumble this person, or just a specific one? Do you even want a gun involved at all, or do you just want someone to tumble when you click at all?
« Last Edit: August 23, 2013, 03:35:42 PM by $trinick »

Code: [Select]
package tumbleProjectile
{
function tumbleProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(%col.getClassName() $= "Player" && miniGameCanDamage(%obj, %col))
{
%col.tumble(5000);
}
parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};
ActivatePackage(tumbleProjectile);


Code: [Select]
package tumbleProjectile
{
function tumbleProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(%col.getClassName() $= "Player" && miniGameCanDamage(%obj, %col))
{
%col.tumble(1.5);
}
parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};
ActivatePackage(tumbleProjectile);



%col.tumble function does not exist. Bad joke
« Last Edit: August 23, 2013, 06:45:34 PM by Advanced Bot »

Bro, calm down. Nobody's attacking you. Your code itself wasn't particularly faulty, it's just not the right way to go about it. I've given poor advice before too-- there's no need to give excuses. It doesn't matter if you were tired, on your iPad, or didn't test it before you posted it. Thanks for chiming in, we appreciate that you want to help others code.
Thanks for the reassurance, but the only reason I did post that was because someone was attacking me.
Impressive, you managed to use all three of the most common excuses for not being able to code
Also, I don't consider it an excuse if it's a legitimate reason. I try to keep things low key and reasonable, but I still do get a bit ticked off when someone makes a claim like that.

I try to keep things low key and reasonable, but I still do get a bit ticked off when someone makes a claim like that.
Are you kidding?! He was giving you respect! (jkjk)

I need a code that will make it so that you can tumble when you shoot someone or when you click specifically.

Found this little piece of code:
Code: [Select]
function armor::onTrigger(%this, %player, %trigger, %val)
{
//%val Key
//=================
//true = Pushed
//false = Released
//=================

//%trigger Key
//=============
//0 = Activate
//2 = Jump
//3 = Crouch
//4 = Jet
//=============
}

You should be able to modify the code to fit the job. Oh also be sure to add a check to see if they carrying the weapon you specified.
« Last Edit: August 24, 2013, 01:34:36 AM by Honorabl3 »

function player::activateStuff(%this)