Author Topic: Stunstick tumble.  (Read 1769 times)

I just need to know why this doesn't work. I can't figure it out. then again, I dunno what I'm doing either, so I'ma hoping to learn something as a result of this too. My part is the part commented out.

Code: [Select]
package stunstick
{
function stunstickProjectile::OnCollision(%this, %obj, %col, %fade, %pos, %normal)
{
if(%col.getClassName() $= "Player" || %col.getClassName() $= "AIPlayer")
{
%col.setWhiteOut(1);
}
parent::Oncollision(%this, %obj, %col, %fade, %pos, %normal);
}
/*
function stunstickProjectile::OnCollision(%this, %int)
{
if(%col.getClassName() $= "Player" || %col.getClassName() $= "AIPlayer")
{
tumble(%this,%int);
}
parent::Oncollision(%this, %int);
}
*/
};
ActivatePackage(stunstick);

It's done incorrectly. It's all commented out, too.

Just do this.

Code: [Select]
$somePrefTellingInt = someValueforInt;
package stunstick
{
function stunstickProjectile::OnCollision(%this, %obj, %col, %fade, %pos, %normal)
{
              %int = $somePrefTellingInt;
if(%col.getClassName() $= "Player" || %col.getClassName() $= "AIPlayer")
{
%col.setWhiteOut(1);
%col.tumble(%int);
}
parent::Oncollision(%this, %obj, %col, %fade, %pos, %normal);
}
};
ActivatePackage(stunstick);
Because I assume you want the person being hit to be tumbled.

It's done incorrectly. It's all commented out, too.

Code: [Select]
$somePrefTellingInt = someValueforInt;
package stunstick
{
function stunstickProjectile::OnCollision(%this, %obj, %col, %fade, %pos, %normal)
{
              %int = $somePrefTellingInt;
if(%col.getClassName() $= "Player" || %col.getClassName() $= "AIPlayer")
{
%col.setWhiteOut(1);
%col.tumble(%int);
}
parent::Oncollision(%this, %obj, %col, %fade, %pos, %normal);
}
};
ActivatePackage(stunstick);
Because I assume you want the person being hit to be tumbled.


I know it didn't work cuz I tested it and it didn't work.

I commented it out it out to point it out.

What does these mean? (educational purposes)
Code: [Select]
$somePrefTellingInt = someValueforInt;

%int = $somePrefTellingInt;

Thanks you veryd much sir.


EDIT:
I get this, which I assume means It's overwriting something?
Code: [Select]
Add-Ons/Item_Skis/item_skis.cs (985): Unable to find object: '' attempting to call function 'setMode'
BackTrace: ->[stunstick]stunstickProjectile::onCollision->Player::tumble->tumble
« Last Edit: June 04, 2011, 12:15:28 AM by Butler »

EDIT:
I get this, which I assume means It's overwriting something?
Code: [Select]
Add-Ons/Item_Skis/item_skis.cs (985): Unable to find object: '' attempting to call function 'setMode'
BackTrace: ->[stunstick]stunstickProjectile::onCollision->Player::tumble->tumble
Post line 985 of the file and a few lines before and after please. I think it can't find the player's camera to change the mode.

Here it is. Line 985 is commented out.

Code: [Select]
//definitely delete after 45 seconds
%newcar.schedule(45 * 1000, delete);

%newcar.schedule(2000, tumbleCheck);

/*%client.camera.setMode("Corpse",%obj);*/
%client.setControlObject(%client.camera);

//remove %player.istumbling after a we stop
//schedule(%time, %obj, stopTumble, %obj);



« Last Edit: June 04, 2011, 06:30:41 PM by Butler »

$somePrefTellingInt = someValueforInt; -Set a global variable named somePrefTellingInt of the value someValueForInt.

%int = $somePrefTellingInt; -Set the local variable int to the global variable somePrefTellingInt.

I got this error. I'm not entirely sure HOW i created it. I understand what the error is, I don't understand how it cannot find it.
Code: [Select]
Add-Ons/Weapon_Stunstick/server.cs (289): Unknown command tumble.
  Object (88416) AIPlayer -> AIPlayer -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> ShapeBase -> ShapeBase -> ShapeBase -> ShapeBase -> ShapeBase -> ShapeBase -> ShapeBase -> GameBase -> SceneObject -> NetObject -> SimObject

I got this error. I'm not entirely sure HOW i created it. I understand what the error is, I don't understand how it cannot find it.
Quote
Add-Ons/Weapon_Stunstick/server.cs (289): Unknown command tumble.
  Object (88416) AIPlayer -> AIPlayer -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> Player -> ShapeBase -> ShapeBase -> ShapeBase -> ShapeBase -> ShapeBase -> ShapeBase -> ShapeBase -> GameBase -> SceneObject -> NetObject -> SimObject

Please use quote for that, it isn't even code. Code boxes don't have wrapping.



Please use quote for that, it isn't even code. Code boxes don't have wrapping.
Please don't talk useless stuff. No one cares about his formatting.

Also, take it out of the package and test the a yual args of tumble.
« Last Edit: June 04, 2011, 07:43:10 PM by Destiny/Zack0Wack0 »

Please use quote for that, it isn't even code. Code boxes don't have wrapping.

Deal with it.



I dunno what I'm doing either, so I'ma hoping to learn something as a result of this too.

Also, take it out of the package and test the a yual args of tumble.



Code: [Select]
function stunstickProjectile::OnCollision(%this, %obj, %col, %fade, %pos, %normal)
{
if(%col.getType() & $TypeMasks::PlayerObjectType)
{
%time = 3000;//milliseconds
%col.setWhiteOut(%time / 1000);
tumble(%col, %time);
}
}

Code: [Select]
function stunstickProjectile::OnCollision(%this, %obj, %col, %fade, %pos, %normal)
{
if(%col.getType() & $TypeMasks::PlayerObjectType)
{
%time = 3000;//milliseconds
%col.setWhiteOut(%time / 1000);
tumble(%col, %time);
}
}


So, whiteout for 3 milliseconds and tumble for 3 seconds?

I assume this:
Code: [Select]
(%time / 1000)
Is a math operation in which the resulting value would be 3 milliseconds.

Please don't talk useless stuff. No one cares about his formatting.

Advice against massive page stretches is not "useless stuff," as you so elegantly put it. The fact that most of the post text is now off screen should be enough to convince you this advice is valid. Please fix it, sir.

I've been checking topics so to hopefully give some advice on code, but this is highly disruptive to reading this.

Advice against massive page stretches is not "useless stuff," as you so elegantly put it. The fact that most of the post text is now off screen should be enough to convince you this advice is valid. Please fix it, sir.

I've been checking topics so to hopefully give some advice on code, but this is highly disruptive to reading this.
There's something wrong with your browser, code blocks do have wrapping.

There's something wrong with your browser, code blocks do have wrapping.

It's the <pre></pre>. Doesn't have wrapping. It's doing a major, massive, annoying pagestretch.