Blockland Forums > Modification Help

Stunstick tumble.

Pages: (1/6) > >>

Butler:

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: ---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);

--- End code ---


otto-san:

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

Just do this.


--- Code: ---$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);
--- End code ---
Because I assume you want the person being hit to be tumbled.

Butler:


--- Quote from: otto-san on June 03, 2011, 10:45:41 PM ---It's done incorrectly. It's all commented out, too.


--- Code: ---$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);
--- End code ---
Because I assume you want the person being hit to be tumbled.

--- End quote ---


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: ---$somePrefTellingInt = someValueforInt;

%int = $somePrefTellingInt;

--- End code ---

Thanks you veryd much sir.


EDIT:
I get this, which I assume means It's overwriting something?

--- Code: ---Add-Ons/Item_Skis/item_skis.cs (985): Unable to find object: '' attempting to call function 'setMode'
BackTrace: ->[stunstick]stunstickProjectile::onCollision->Player::tumble->tumble

--- End code ---


Greek2me:


--- Quote from: Butler on June 03, 2011, 10:50:38 PM ---EDIT:
I get this, which I assume means It's overwriting something?

--- Code: ---Add-Ons/Item_Skis/item_skis.cs (985): Unable to find object: '' attempting to call function 'setMode'
BackTrace: ->[stunstick]stunstickProjectile::onCollision->Player::tumble->tumble

--- End code ---

--- End quote ---
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.

Butler:

Here it is. Line 985 is commented out.


--- Code: ---//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);

--- End code ---




Pages: (1/6) > >>

Go to full version