Call to Spawn; type mismatch in parameter 1

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Call to Spawn; type mismatch in parameter 1

Postby Cozmo » Fri Feb 15, 08 2:39 am

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?
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby Alex » Fri Feb 15, 08 7:57 am

Please, give the entire function? ;)
Including the
Code: Select all
local var var;
part.
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Cozmo » Fri Feb 15, 08 2:20 pm

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:
Last edited by Cozmo on Fri Feb 15, 08 2:28 pm, edited 2 times in total.
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby ~ River ~ » Fri Feb 15, 08 2:29 pm

BOOOM?

this is not a 1 word post
<center>Image</Center>
AquaShock wrote:Stop looking at child porn klop!
User avatar
~ River ~
Poster
 
Posts: 243
Joined: Sat Jan 19, 08 8:35 pm
Location: United Kingdom, St Helens.

Postby Alex » Fri Feb 15, 08 4:42 pm

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 );
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Cozmo » Fri Feb 15, 08 9:07 pm

That compiled, thanks Alex. :)
Cozmo_RPG (v1 & v2)
MPConversations - A tool for creating multiplayer RPG stuff
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby SnakeEater » Fri Feb 15, 08 11:10 pm

well sounds cool, a bomb pack, crazy stuff haha :lol: this might be a great mod if i saw it
The eye sore has been removed!

I really do think Deus Ex is the all-time best game ever made.
User avatar
SnakeEater
Poster
 
Posts: 193
Joined: Wed Sep 12, 07 2:26 am
Location: Inside the void of your hard drive space


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 2 guests