Checking if collision still persists?

You need help? It's here!
Post Reply
LegendaryAgent
Member
Posts: 80
Joined: Thu 29 Sep , 2011 12:26 am
Contact:

Checking if collision still persists?

Post by LegendaryAgent » Sat 29 Oct , 2011 5:38 am

Hey all im trying: when a player touches a specific actor, it triggers the touch event, that touch event will then offer that specific actor a item, the item should destroy itself right away if the player exists that actor area (the actor can be trespassed by players but not by bullets, this is similar to the shield i was making before), what i want now, is for when the item no longer detects its owner inside that actor to destroy itself, is there any event for this? right now i have tried it with a looping timer, and when timer is ticked and player is no longer in, the item (which is based on a subclass of an inventory class) will auto destroy itself.

The problem is not even this way it works, because im almost sure there must be something syntaxically incorrect, wheres what i have:
shield like actor:

Code: Select all

var Actor TheOwnerOfThis; (the player)

var Actor ProtectionOwner: (the shield)
simulated event Touch(Actor Other)

  if(TheOwnerOfThis!=None && Pawn(TheOwnerOfThis).Health<=0)
  Destroy();
  else if(Pawn(Other).GetTeamNum()==Pawn(TheOwnerOfThis).GetTeamNum() && Pawn(Other).Health>0 && Pawn(Other)!=Pawn(TheOwnerOfThis))
  SSSP1=Pawn(Other).spawn(class'DreamsProtectionShield1A', Pawn(Other).Controller,,Pawn(Other).Location);
  SSSP1.giveto(Pawn(Other));
  SSSP1.ProtectionOwner=self;
  SSSP1.TheOriginalOwner=TheOwnerOfThis;

}
And the item:

Code: Select all

var Actor TheOwnerOfThis;

simulated function Timer()
{
if(Pawn(Owner)!=None && Pawn(Owner).TouchingActor(ProtectionOwner)==false && Pawn(Owner)!=Pawn(TheOriginalOwner))
Destroy();
}
The item extends armor: and here is the full tree

Core.Object
|
+-- Engine.Actor
|
+-- Engine.Inventory
|
+-- Engine.Powerups
|
+-- Engine.Armor

Any ideas? Thanks in advance!

EDIT:SSSP1 is the item, sorry for forgeting that.

LegendaryAgent
Member
Posts: 80
Joined: Thu 29 Sep , 2011 12:26 am
Contact:

Re: Checking if collision still persists?

Post by LegendaryAgent » Mon 31 Oct , 2011 7:47 pm

hmmm some said the getteamnum works with the pawn controller only, however even when i have tried this :

var Actor ThisOne;

Code: Select all

if(Pawn(Other).Controller.GetTeamNum()==Pawn(ThisOne).Controller.GetTeamNum())
it always returns to false for some reason, im pretty sure that theres something im missing, anyone can give me a hint plz? xD

LegendaryAgent
Member
Posts: 80
Joined: Thu 29 Sep , 2011 12:26 am
Contact:

Re: Checking if collision still persists?

Post by LegendaryAgent » Mon 31 Oct , 2011 8:01 pm

LegendaryAgent wrote:hmmm some said the getteamnum works with the pawn controller only, however even when i have tried this :

var Actor ThisOne;

Code: Select all

if(Pawn(Other).Controller.GetTeamNum()==Pawn(ThisOne).Controller.GetTeamNum())
it always returns to false for some reason, im pretty sure that theres something im missing, anyone can give me a hint plz? xD
NVM its working :D i forgot to assign setcollision(true) and TheOwnerOfThis from a different class, all working like a charm ^^

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests