Page 1 of 1

[DECORATE] (Solved) Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't?

Posted: Sun Apr 29, 2018 3:11 am
by FranckyFox2468
Okay so i am going to explain the situation. I made a Bouncy grenade projectile a la quake/team fortress and a stick bomb mine that can be manually detonated via some script.
I made it so once the sticky missile hits a floor or a ceiling, it stops its movement alltogheter and is only nullified if detonated or if the user die. The projectile is made shootable/killable so enemy players/enemies have a chance to destroy it.

My current problem is, i've been goofing around a bit with both projectiles and when a grenade hitsa sticky mine that is on the floor, it not only kills it, but it bounces off as if it hit a wall or a prop actor and keeps rolling until it explodes rather than explode on direct hit like enemies. My goal is to make it so if the grenade was to impact the sticky, both would explode. But i can't get my hand on where the issue is between both projectiles.

EDIT: I feel like i will have to be more specific because so far we have no been going anywhere with this. My goal is NOT to have the grenade go through the sticky and no touch it, i actually WANT this to happen. What i want too, is for them to both enter their death state when they imapct with eachother. The problem is, only the sticky bomb does, and the grenade bounces off as if it was a mere wall rather than die like it was hitting a monster.

Here's the codes

the grenade:

Code: Select all

ACTOR Grenader
{
  Radius 6
  Height 6
  Speed 25.35 
  Damage (50)
  Gravity 0.50
  Projectile
  +Randomize
  +ROCKETTRAIL
  +DONTHARMSPECIES
  +MTHRUSPECIES
  -NoGravity
  +DoomBounce
  +USEBOUNCESTATE
  -BOUNCEAUTOOFF
  +BOUNCEAUTOOFFFLOORONLY
  Alpha 0.75
  BounceFactor 0.50 
  Obituary "%o was destroyed by %k's Grenade."
  SeeSound "GLBounce"
  States
  {
  Spawn:
    GRL2 A 1 Bright
    Loop
	Bounce:
	GRL2 DCBA 2 Bright
	goto Spawn
  Death:
   GRL2 A 0 Bright A_ChangeFlag("NoGravity", 1)
   GRL2 A 0 Bright A_ChangeFlag("FORCEXYBILLBOARD", 1)
   GRL2 A 0 Bright A_Explode(25, 128)
   GRL2 A 0 Bright A_Explode(25, 128, 0)
   GRL2 A 0 A_Playsound("BaBoom")
    MISL B 8 Bright
    MISL C 6 Bright
    MISL D 4 Bright
    Stop
  }
}
the sticky:

Code: Select all

ACTOR Sticky
{
  Radius 6
  Height 6
  Speed 25
  Damage 0
  Gravity 0.65
  Health 20
  Projectile
  -NOBLOCKMAP
  +Randomize
  -NoGravity
  +DoomBounce
  +NOTARGETSWITCH
  +THRUGHOST
  +ALLOWBOUNCEONACTORS
  +BOUNCEONACTORS
  -BOUNCEAUTOOFF
  //+BOUNCEAUTOOFFFLOORONLY
  +SHOOTABLE
  //+DONTGIB
 // +NOICEDEATH
 // -NOBLOOD
  Alpha 0.75
  BounceFactor 0.05
  WallBounceFactor 0.05
  Obituary "%o came across %k's Sticky Bomb."
  States
  {
  Spawn:
    GL21 A 0 nodelay ACS_ExecuteAlways(700)
	goto spawn2
	spawn2:
    SIK1 A 0 A_CheckFloor ("FloorSucker")
	SIK1 A 0 A_CheckCeiling ("CeilingSucker")
    SIK1 A 1
	////
	SIK1 A 0 A_CheckFloor ("FloorSucker")
	SIK1 A 0 A_CheckCeiling ("CeilingSucker")
    SIK1 B 1
	////
	SIK1 A 0 A_CheckFloor ("FloorSucker")
	SIK1 A 0 A_CheckCeiling ("CeilingSucker")
    SIK1 C 1
    Loop
	
  FloorSucker:
    SIK1 A 0 A_Stop
	SIK1 A 0 A_ChangeFlag("NoGravity", TRUE)
	SIK1 A 0 A_ChangeFlag("FLOORHUGGER", TRUE)
    SIK1 A 1
    Loop
	
  CeilingSucker:
    SIK1 A 0 A_Stop
	SIK1 A 0 A_ChangeFlag("NoGravity", TRUE)
	SIK1 A 0 A_ChangeFlag("CEILINGHUGGER", TRUE)
    SIK1 A 1
    Loop
	
  Death:
   SIK1 A 0 A_ChangeFlag("NoGravity", TRUE)
   SIK1 A 0 A_Stop
   GRL2 A 0 Bright A_Explode(50, 128)
   GRL2 A 0 Bright A_Explode(50, 128, 0)
   GRL2 A 0 A_Playsound("weapons/rocklx")
    MISL B 8 Bright
    MISL C 6 Bright
    MISL D 4 Bright
    Stop
   Canceled:
    PUFF ABCD 3 Bright
    Stop
  }
}

[DECORATE] Re: Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't

Posted: Sun Apr 29, 2018 11:18 am
by Ænima

[DECORATE] Re: Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't

Posted: Sun Apr 29, 2018 3:42 pm
by FranckyFox2468
Ænima wrote:
Sun Apr 29, 2018 11:18 am
-BOUNCEONACTORS


https://zdoom.org/wiki/Actor_flags#BOUNCEONACTORS
I can't remove this because the stickies then explodes on impact with enemies when they aren't mean't to be. They are mean't to explode only through detonation, not on direct hit. And i tried setting this on the grenade and it does absolutely nothing. Although i still tried it and regardless of if its here or not on either actors, the grenade still bounce off the stick as if nothing was rather than explode on it like a bleeding actor. Thus, not solving the problem in the first place.

[DECORATE] Re: Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't?

Posted: Mon Apr 30, 2018 1:40 am
by Ænima
Why not just make the grenade and sticky the same species and then giving them both +THRUSPECIES?

A hacky-er method which works everytime is giving them both the +GHOST and +THRUGHOST tags. I’ve done it several times.

[DECORATE] Re: Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't?

Posted: Mon Apr 30, 2018 4:15 pm
by FranckyFox2468
Ænima wrote:
Mon Apr 30, 2018 1:40 am
Why not just make the grenade and sticky the same species and then giving them both +THRUSPECIES?

A hacky-er method which works everytime is giving them both the +GHOST and +THRUGHOST tags. I’ve done it several times.
Because i intend to add that later but it won't solve the problem if a character of a different species also uses a similar grenade. Won't it be frustrating if not only your sticky gets destroyed but then the grenade keeps bouncing off it and kills something else?

And won't both of these options make the sticky indestructible? Cause my goal is to actually make it killable.

[DECORATE] Re: Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't?

Posted: Mon Apr 30, 2018 4:51 pm
by Empyre
+THRUGHOST will make a thing pass through things that are flagged +GHOST. That is all those flags do. Things that are not flagged +THRUGHOST will collide like normal with things that are flagged +GHOST, and things that are flagged +GHOST will collide normally with things that are not flagged +THRUGHOST.

Also, AEnima was suggesting to make all the grenades and stickies themselves the same species as each other, not the creatures that shoot them.

[DECORATE] Re: Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't?

Posted: Mon Apr 30, 2018 5:30 pm
by FranckyFox2468
Empyre wrote:
Mon Apr 30, 2018 4:51 pm
+THRUGHOST will make a thing pass through things that are flagged +GHOST. That is all those flags do. Things that are not flagged +THRUGHOST will collide like normal with things that are flagged +GHOST, and things that are flagged +GHOST will collide normally with things that are not flagged +THRUGHOST.

Also, AEnima was suggesting to make all the grenades and stickies themselves the same species as each other, not the creatures that shoot them.
Well then this creates a problem because i WANT them to go through the shooting actors so they don't bounce off other players in co-op and actually goes through them. And i want them to actually be able to kill stickies regardless.

Like you guys seem to misunderstand, i DO NOT want the Grenade to go THROUGH the sticky, i want it to collide with it and have both die on impact. The problem is, the grenade bounces off as it it was a wall rather than die with it. I want it to explode on the sticky oon hit, as if it was a monster.

[DECORATE] Re: Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't?

Posted: Tue May 01, 2018 10:23 pm
by Empyre
In that case, maybe +SHOOTABLE is the answer.

[DECORATE] Re: Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't?

Posted: Tue May 01, 2018 10:46 pm
by FranckyFox2468
Empyre wrote:
Tue May 01, 2018 10:23 pm
In that case, maybe +SHOOTABLE is the answer.
I don't think you read the codes then cause its literally there. Anyway, for those with a similar issue someone, someone on another community brought an answer:
Adding A_ChangeFlag("IsMonster",1) sticky right at the spawn seems to solve the problem but it should be taken in account that the projectile will become elligible A_RadiusGive if used with the RGF_MONSTERS flag.

Anyway, thanks for trying to help guys.

[DECORATE] Re: (Solved) Bouncing grenade projectile bounces a top of a shootable/bleeding projectile actor when it shouldn't?

Posted: Wed May 02, 2018 3:29 pm
by Empyre
I confess that you are right that I hadn't read the code.

So, you are trying to get the stickies and grenades to explode on contact with each other, but not on contact with any other thing? That sounds like it would hard to do. One very hacky solution would be to have the stickies and grenades constantly exploding with a small-radius invisible explosion that does a custom damage type and flagged not to damage self, and make a custom version of each and every other thing (players, monsters, decorative items, etc.) that is immune to that damage type, so only the grenades and stickies are vulnerable to that, so they would kill each other. Then, when you detonate, have it spawn another actor that would be the visible explosion, doing normal damage.

I haven't investigated this, but maybe in ACS you could detect what type of actor the grenade or sticky has collided with, and explode only if it is another grenade or sticky. That might be worth checking out.
http://zdoom.org/wiki/ACS