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

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
FranckyFox2468
Forum Regular
Posts: 167
Joined: Sat May 07, 2016 8:30 pm

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

#1

Post by FranckyFox2468 » Sun Apr 29, 2018 3:11 am

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
  }
}
Last edited by FranckyFox2468 on Tue May 01, 2018 10:46 pm, edited 3 times in total.

User avatar
Ænima
Addicted to Zandronum
Posts: 3406
Joined: Tue Jun 05, 2012 6:12 pm
Location: Shpongleland

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

#2

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

Image ­ ­
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: Doom64 and Diablo2 had a baby


ZandroSkins
: a pack made by our community
Squad Radio: a WASD-powered chat menu, add your own sounds
AeniPuffs: neat blood and puff effects

User avatar
FranckyFox2468
Forum Regular
Posts: 167
Joined: Sat May 07, 2016 8:30 pm

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

#3

Post by FranckyFox2468 » Sun Apr 29, 2018 3:42 pm

Æ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.

User avatar
Ænima
Addicted to Zandronum
Posts: 3406
Joined: Tue Jun 05, 2012 6:12 pm
Location: Shpongleland

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

#4

Post by Ænima » 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.
Image ­ ­
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: Doom64 and Diablo2 had a baby


ZandroSkins
: a pack made by our community
Squad Radio: a WASD-powered chat menu, add your own sounds
AeniPuffs: neat blood and puff effects

User avatar
FranckyFox2468
Forum Regular
Posts: 167
Joined: Sat May 07, 2016 8:30 pm

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

#5

Post by FranckyFox2468 » Mon Apr 30, 2018 4:15 pm

Æ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.

User avatar
Empyre
Zandrone
Posts: 1159
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

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

#6

Post by Empyre » 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.
"For the world is hollow, and I have touched the sky."

User avatar
FranckyFox2468
Forum Regular
Posts: 167
Joined: Sat May 07, 2016 8:30 pm

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

#7

Post by FranckyFox2468 » Mon Apr 30, 2018 5:30 pm

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.

User avatar
Empyre
Zandrone
Posts: 1159
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

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

#8

Post by Empyre » Tue May 01, 2018 10:23 pm

In that case, maybe +SHOOTABLE is the answer.
"For the world is hollow, and I have touched the sky."

User avatar
FranckyFox2468
Forum Regular
Posts: 167
Joined: Sat May 07, 2016 8:30 pm

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

#9

Post by FranckyFox2468 » Tue May 01, 2018 10:46 pm

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.

User avatar
Empyre
Zandrone
Posts: 1159
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

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

#10

Post by Empyre » Wed May 02, 2018 3:29 pm

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
"For the world is hollow, and I have touched the sky."

Post Reply