How to make a simple object that does only 2 things?

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

Re: How to make a simple object that does only 2 things?

Post by LegendaryAgent » Wed 19 Oct , 2011 10:19 pm

for now ill use the setbase, if i ever run into weird display or location problems ill move back to replicate location and tick system.

i do not enjoy the way i have made the SPUP class destroy itself when its owner dies because there must be a better way to do this...

Code: Select all

simulated event Touch(Actor Other)
{
  if(Projectile(Other) != none && !Other.bDeleteMe)
  {
    Other.Destroy();
  }
  else if(TheOwnerOfThis!=None && Pawn(TheOwnerOfThis).Health<=0)
  Destroy();
}

Anyone got some better suggestion for this? when player dies and match ends right away the spup class doesnt get destroyed, but if its in mid of a match it destroys fine...

Now for the real problems:
1)Is there really no way to get the team of the owner who fired the projectile which collides with the SPUP?
what i want is something like this if(Projectile(Other).Owner.Controller.GetTeamNum!=Pawn(TheOwnerOfThis).Controller.GetTeamNum) please help me make this statement work, i just want to block projectiles from the enemy team not my own team.

2)InstantHit bullets go through the touch event and damages the players inside the shield, how can i block instant hit bullets for this class? right now nothing is set in default properties for this class to block, nothing except the CollisionRadius=100 & CollisionHeight=100 & bIgnoreEncroachers=True & bUseCylinderCollision=True, and the projectile blocking is done by the touch event and nothing more.

Thanks in advance!

User avatar
Azarael
UT2004 Administrator
Posts: 5365
Joined: Thu 11 Feb , 2010 10:52 pm

Re: How to make a simple object that does only 2 things?

Post by Azarael » Wed 19 Oct , 2011 10:24 pm

Don't really know about blocking instant hits. Could look at shieldgun alt.

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

Re: How to make a simple object that does only 2 things?

Post by LegendaryAgent » Wed 19 Oct , 2011 11:12 pm

Azarael wrote:Don't really know about blocking instant hits. Could look at shieldgun alt.
hey thanks for your answear, ive tried setting its variables but oddly enough it doesnt work :S

here are my defaultproperties

Code: Select all

defaultproperties
{
     TeamSkins(1)=FinalBlend'AW-ShieldShaders.Shaders.BlueShieldFinal'
     DrawType=DT_StaticMesh
     StaticMesh=StaticMesh'AW-ShieldShaders.ONS.EnergonShield'
     bAcceptsProjectors=False
     bIgnoreEncroachers=True
     DrawScale3D=(X=1.000000,Y=1.000000)
     CollisionRadius=200.000000
     CollisionHeight=200.000000
     bUseCylinderCollision=True
     bHidden=false
     RemoteRole=ROLE_SimulatedProxy
}
ive tried to use bReplicateInstigator=True and Physics=PHYS_Trailer and nothing...

And as if that wasnt enough, the most weird thing is that i havent found any touch event or anything similar to that in the shieldeffect3rd


BTW do u have any advice for the projectile team problem?

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

Re: How to make a simple object that does only 2 things?

Post by LegendaryAgent » Thu 20 Oct , 2011 1:09 am

hmmm i was thinking, im almost sure t here has to be a way to get the team of a projectile because think of it like this: if it would be impossible to know the team of a projectile which has been fired torwards lets say a bot, that bot instead of voice chatting "Same TEAM!!" it would be damaged by it normally, and since my shield is also an actor i think it should also be possible in the touch event to determine the team of the projectile fired, possibly by determining the owner who fired it and determining its controller or whatever and finally detecting the team which is set to that controller. Where can i check this code up? im rly stuck into this :\

User avatar
Azarael
UT2004 Administrator
Posts: 5365
Joined: Thu 11 Feb , 2010 10:52 pm

Re: How to make a simple object that does only 2 things?

Post by Azarael » Thu 20 Oct , 2011 11:08 pm

A projectile's Instigator is the player / pawn (not sure which) who fired it.

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

Re: How to make a simple object that does only 2 things?

Post by LegendaryAgent » Thu 20 Oct , 2011 11:53 pm

Azarael wrote:A projectile's Instigator is the player / pawn (not sure which) who fired it.

hmm so it really is projectile(other).instigator?

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

Re: How to make a simple object that does only 2 things?

Post by LegendaryAgent » Fri 21 Oct , 2011 2:25 pm

LegendaryAgent wrote:
Azarael wrote:A projectile's Instigator is the player / pawn (not sure which) who fired it.

hmm so it really is projectile(other).instigator?

meh, so ive just figured out that its impossible to make instanthit projectiles have some sort of hitevent or touch event without colliding with actors making touch event obsolete...-.- which means that my moving shield will not be able to block projectiles from a specific team, instead itll block all of them.

Limited engine if that is trully the case, another thing that ticks me off is that how come u get playername, playerzone and stuff like that and theres no way to get player health??
its pretty lame because i needed to broadcast a player hp and turns out that such variable in PRI doesnt even exist to report it in a localized message...

User avatar
Azarael
UT2004 Administrator
Posts: 5365
Joined: Thu 11 Feb , 2010 10:52 pm

Re: How to make a simple object that does only 2 things?

Post by Azarael » Fri 21 Oct , 2011 9:52 pm

bCollideActors = True
bBlockActors = False
bBlockZeroExtentTraces = false

an actor with said properties should collide, triggering Touch, but not block.

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

Re: How to make a simple object that does only 2 things?

Post by LegendaryAgent » Sat 22 Oct , 2011 2:26 am

Azarael wrote:bCollideActors = True
bBlockActors = False
bBlockZeroExtentTraces = false

an actor with said properties should collide, triggering Touch, but not block.
yes thats true, but the main issue is hitscan or "tracers" ignores it completely, thats what i want, i want it to be able to also block hitscan (but to do this on an event which i can control which [hitscan or instant hit] to block)

Because mainly, i want this shield to block enemy projectiles only, including hitscan weapons, but not team projectiles, do you think its possible to achieve this?

i mean if its possible for both projectiles and hitscans to be stopped at touch event it would be awsome, or at any other event i can use to determine which player.team is hiting me to stop only the enemy and allow my team to fire through.

BTW thx as usual for ur effort to reply me

User avatar
Azarael
UT2004 Administrator
Posts: 5365
Joined: Thu 11 Feb , 2010 10:52 pm

Re: How to make a simple object that does only 2 things?

Post by Azarael » Sat 22 Oct , 2011 1:10 pm

Hmm. I'm not sure you can have a shield which will act so selectively without quite a bit of work - blocking Hitscan is an absolute thing. The Ballistic Weapons mod contains code which allows weapons to penetrate geometry and meshes, but it's fairly useless unless you're planning to subclass every weapon to work with your shield.

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests