Page 1 of 1

Call to Spawn; type mismatch in parameter 1

PostPosted: Fri Feb 15, 08 2:39 am
by Cozmo
This has been bugging me for some time:

Code: Select all
TheBombPack = Spawn( BombPack,,,Location + (CollisionRadius+BombPack.Default.CollisionRadius+30) * Vector(Rotation) + vect(0,0,1) * 15 );


TheBombPack is a variable of type class BombPack, so I can set it's owner as who gets the kills and when it should explode etc. I've used that Spawn line before, as I copied it straight from Summon. :? Worked before. Anyone spot anything wrong?

PostPosted: Fri Feb 15, 08 7:57 am
by Alex
Please, give the entire function? ;)
Including the
Code: Select all
local var var;
part.

PostPosted: Fri Feb 15, 08 2:20 pm
by Cozmo
Oh, I didn't use a local variable, changed now, but same error.

Might as well post whole script. :P
Code: Select all
//================================
// Bomb Pack thing
//================================
Class BombPackPickup extends DeusExPickup;

state Activated
{
   function Activate()
   {
   }

   function BeginState()
   {
      local DeusExPlayer player;
      local BombPack TheBombPack;
      Super.BeginState();

      player = DeusExPlayer(Owner);
      if (player != None)
      {
         TheBombPack = Spawn( BombPack,,,Location + (CollisionRadius+BombPack.Default.CollisionRadius+30) * Vector(Rotation) + vect(0,0,1) * 15 );
         TheBombPack.TheOwner = player;
         TheBombPack.SetTimer(1.0, true);
      }

   UseOnce();
   }
Begin:
}

defaultproperties
{
     ItemName="Bomb"
     Mesh=LodMesh'DeusExDeco.Trashbag'
     CollisionRadius=26.360001
     CollisionHeight=26.760000
}


Code: Select all
//===============================
// BombPack
//===============================
Class BombPack extends CrateExplosiveSmall;

Var int TimeLeft;
Var Pawn TheOwner;
Var float proxRadius;

function Timer()
{
   local DeusExPlayer Player;

   TimeLeft -= 1;

   if(TimeLeft <= 0)
   {
      TakeDamage(1, DeusExPlayer(TheOwner), Location, vect(0,0,0), 'Shot');
   }

   foreach RadiusActors(class'DeusExPlayer', Player, proxRadius)
   {
      if(Player.PlayerReplicationInfo.Team != TheOwner.PlayerReplicationInfo.Team)
      {
         TakeDamage(1, DeusExPlayer(TheOwner), Location, vect(0,0,0), 'Shot');
      }
   }
}

defaultproperties
{
     TimeLeft=60
     proxRadius=80
     HitPoints=10
     FragType=Class'DeusEx.PaperFragment'
     ItemName=";D"
     Mesh=LodMesh'DeusExDeco.Trashbag'
     CollisionRadius=26.360001
     CollisionHeight=26.760000
     Mass=30.000000
     Buoyancy=40.000000
}


EDIT: I think I didn't include the player's location. :| Before I had used it in an NPC. So how would I add the player's location to that line, if that's the case? :oops:

PostPosted: Fri Feb 15, 08 2:29 pm
by ~ River ~
BOOOM?

this is not a 1 word post

PostPosted: Fri Feb 15, 08 4:42 pm
by Alex
Code: Select all
TheBombPack = Spawn( BombPack,,,Location + (CollisionRadius+BombPack.Default.CollisionRadius+30) * Vector(Rotation) + vect(0,0,1) * 15 );

Into
Code: Select all
TheBombPack = Spawn( Class'BombPack',,,Location + (CollisionRadius+BombPack.Default.CollisionRadius+30) * Vector(Rotation) + vect(0,0,1) * 15 );

PostPosted: Fri Feb 15, 08 9:07 pm
by Cozmo
That compiled, thanks Alex. :)

PostPosted: Fri Feb 15, 08 11:10 pm
by SnakeEater
well sounds cool, a bomb pack, crazy stuff haha :lol: this might be a great mod if i saw it