Author Topic: Player Scale Script  (Read 1271 times)

Can someone give me a script that, on a projectile collision will change a player scale?

Is it that hard to do %col.setPlayerScale(number here); ?

I had that:

Code: [Select]
%col.setPlayerScale(number here);

Then it gave me this:
Code: [Select]
ERROR: Error is outlined with ## on the sides:
%col.setPlayerScale(1 1 ##1##);
ERROR Report Complete

Double Toast:

First I had this:
Code: [Select]
function ScaleJetRayProjectile::Damage(%this,%obj,%col,%fade,%pos,%normal)
{
   if(%col.getType() & $TypeMasks::PlayerObjectType)
   {
      %col.setPlayerscale(1 1 1);

      if(isObject(%col.client))
         %col.client.applyBodyColors();

      if(%col.getObjectMount())
         %col.getDataBlock().doDismount(%col);
   }
}

Console gave me this:
Code: [Select]
Loading Add-On: Weapon_Scale_Ray
Add-Ons/Weapon_Scale_Ray/Weapon_Scale_Ray.cs Line: 377 - Syntax error.
>>> Some error context, with ## on sides of error halt:
};



function ScaleJetRayImage::onFire(%this,%obj,%slot)

{

^if(%obj.getDamagePercent() < 1.0)

^^%obj.playThread(2, shiftAway);

^Parent::onFire(%this,%obj,%slot);^

}

function ScaleJetRayProjectile::Damage(%this,%obj,%col,%fade,%pos,%normal)
{
   if(%col.getType() & $TypeMasks::PlayerObjectType)
   {
      %col.setPlayerscale(1 1 ##1##);

      if(isObject(%col.client))
         %col.client.applyBodyColors();

      if(%col.getObjectMount())
         %col.getDataBlock().doDismount(%col);
   }
}
>>> Error report complete.

That's because you only put one number for setPlayerScale. As for future reference, anything with spaces in it should be surrounded with "s.
Example:
%col.setScale("1 1 1");
(above needs "s)

This does not include things that didn't need spaces in the first place, such as:
%col.getType() & $TypeMasks
(above does not need "s)

Try just using %col.setPlayerScale(1);

So, Just this?
Code: [Select]
function ScaleJetRayProjectile::Damage(%this,%obj,%col,%fade,%pos,%normal)
{
%col.setPlayerscale("1 1 1");
}

No.
Either
%col.setPlayerScale(1);
or
%col.setScale("1 1 1");

Code: [Select]
function ScaleJetRayProjectile::Damage(%this,%obj,%col,%fade,%pos,%normal)
{
%col.setScale("1 1 1");
}
I tried this and it didn't work. so Ill try the other..

Keep in mind that setting the scale to 1 will make the person normal size.

Keep in mind that setting the scale to 1 will make the person normal size.
DURRR, pulled a brain fart.


function ScaleJetRayProjectile::Damage(%this,%obj,%col,%fade,%pos,%normal, %client)
{
%col.setScale("0.1 0.1 0.1");
}



I tried this and it didn't work.

Quick question, would the bolded code make a difference?
NOTE: I took away the code tags because they somehow interfered with the bold tags
« Last Edit: February 27, 2010, 11:40:40 PM by Butler »

They don't make a difference, but you don't actually need %client in there.

All that matters is that you're calling setScale on the 3rd argument, as in you could have
::Damage(%cat,%dog,%mouse
as long as you call .setScale (or .setPlayerScale) on %mouse.

Ok.. so this?


function ScaleJetRayProjectile::Damage(%this,%col,%client,)
{
%col.setScale("0.1 0.1 0.1");
}


WAIT, I think I get it, so because I have "%client" as the 3rd arguement, I should make the line like so?
Code: [Select]
{
%client.setScale("0.1 0.1 0.1");
}

no, like this
function ScaleJetRayProjectile::Damage(%this,%obj,%col,%fade,%pos,%normal, %client)
{
%col.setScale("0.1 0.1 0.1");
}