Author Topic: New bow errors.  (Read 1885 times)

%col.damage(%obj, %pos, %directDamage, %damageType);


%col.damage(%obj, %pos, %directDamage, %damageType);
How would I run that on a scedule?

Got firebow to work. Thanks mr wallet and everyone else that helped.

Now I need to fix the icebow. When it hits a vehicle, it crashes the game. Is there something to make the icebow not run the function when it connects with a vehicle?

After parent::damage(%this,%obj,%col,%fade,%pos,%normal);

add

Code: [Select]
if(!%col.getType() & $Typemasks::PlayerObjectType)
{
      return;
}

After parent::damage(%this,%obj,%col,%fade,%pos,%normal);

add

Code: [Select]
if(!%col.getType() & $Typemasks::PlayerObjectType)
{
      return;
}
It still crashes the game. I put in this.

Code: [Select]
package iceBow
{
function Icebowprojectile::damage(%this,%obj,%col,%fade,%pos,%normal)
{
   parent::damage(%this,%obj,%col,%fade,%pos,%normal);

if(!%col.getType() & $Typemasks::PlayerObjectType)
{
      return;
}
   %col.lastDatablock = %col.getDatablock(); 
   %col.setDatablock(Icebowarmor);
   %col.schedule(5000,setDatablock,%col.lastDatablock);
   %col.setTempColor("0.66 0.75 1 1",5000);     
}
};
activatePackage(iceBow);

try this

Code: [Select]
if(!%col.getClassName $= "AIPlayer" && !%col.getClassName $= "Player")
{
      return;
}

Still crashes. Maybe we should do something with an else command. THis is what I did in case it is my fault. For failing to enter it correctly.

Code: [Select]
package iceBow
{
function Icebowprojectile::damage(%this,%obj,%col,%fade,%pos,%normal)
{
   parent::damage(%this,%obj,%col,%fade,%pos,%normal);

if(!%col.getClassName $= "AIPlayer" && !%col.getClassName $= "Player")
{
      return;
}

   %col.lastDatablock = %col.getDatablock(); 
   %col.setDatablock(Icebowarmor);
   %col.schedule(5000,setDatablock,%col.lastDatablock);
   %col.setTempColor("0.66 0.75 1 1",5000);     
}
};
activatePackage(iceBow);





Try an if statement like this:
Code: [Select]
if(%col.getType() & $Typemasks::VehicleObjectType)
{
   return;
}

Try an if statement like this:
Code: [Select]
if(%col.getType() & $Typemasks::VehicleObjectType)
{
   return;
}
Worked, thanks.

Yay it worked.  Now we are one step closer to heed's awesome miedeval weaponry pack.

I need something that will register a headshot for the Arbalest

I need something that will make the icebow make it so your items get put back in your inventory so you cannot switch weapons/use weapons while frozen

Try an if statement like this:
Code: [Select]
if(%col.getType() & $Typemasks::VehicleObjectType)
{
   return;
}

Code: [Select]
if(!%col.getType() & $Typemasks::PlayerObjectType)
   return;

Just in case we get other damageable object types in future or something.

1. I need something that will register a headshot for the Arbalest

2. I need something that will make the icebow make it so your items get put back in your inventory so you cannot switch weapons/use weapons while frozen

look at the SVD :3
Code: [Select]

package headshot{
 function ProjectileData::damage(%this, %obj, %col, %fade, %pos, %normal){
  %this2=%this;
  if(%col.getClassName()$="Player"){
   if(getword(%pos,2)>getword(%col.getWorldBoxCenter(),2)-3.3){
    %name = %this.GetName();
    if(%name$="sniperrifleLVProjectile"){
     %this2=sniperrifleLVheadshotprojectile;
     showheadshot(%obj,%col);
     %obj.emote(WinStarProjectile);
    }
   }
  }
   return Parent::damage(%this2, %obj, %col, %fade, %pos, %normal);
 }
};
ActivatePackage(headshot);

function showheadshot(%obj,%col){
 if(!$TG_headshots){
  bottomprint(%obj.client,"<bitmap:add-ons/Weapon_SVD/star> \c3Headshot "@%col.client.name,3,4);
  bottomprint(%col.client,"<bitmap:add-ons/Weapon_SVD/star> \c7"@%obj.client.name@" Headshot",3,4);
 }
}



2. i would try something like when the player is hit, %client.isarrowfrozen and stopping the fire function
and not sure if this works this way...
Code: [Select]
function ShapebaseImageData::Fire(%this, %obj, %col){
 if(%obj.isarrowfrozen)
  return;
 Parent::fire(%this, %obj, %col);
 }
hope it helps
« Last Edit: July 06, 2009, 08:49:37 PM by Healbadbad »