[DECORATE] Cone AOE or spread attack with only one hit?

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

[DECORATE] Cone AOE or spread attack with only one hit?

#1

Post by FranckyFox2468 » Fri Mar 30, 2018 4:37 am

Basically im wondering if its possible to make a cone based AOE with explicit damage (since bfgspray seems to be extremely limited in the current version of zandro) or perhaps being able to do something like a shotgun/rail blast but having it so an enemy can only take 1 damage per hitscan/rail and thus if hit by two, it will only receive damage of one?

I dunno, just checking in case there is some secret techniques i never heard of because trying to work with spread attacks has been hard since its either a full 360 or a spread of projectiles/hitscan that stacks their damage.

Basically i'm just trying to do some piercing/aoe attacks with a certain range that only hits their target once rather than going batshit crazy and deal crazy damage every tic

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

[DECORATE] Re: Cone AOE or spread attack with only one hit?

#2

Post by Ænima » Fri Mar 30, 2018 11:35 pm

Manually spawn like 30 ripper projectiles, one for every degree of angle and pitch, for a 15° “square” damage cone.

Or you could try rails i guess. That might look ugly though because IIRC there’s a limit to how many railgun particles can exist.
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !


ZandroSkins
: a pack made by our community

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

[DECORATE] Re: Cone AOE or spread attack with only one hit?

#3

Post by FranckyFox2468 » Sat Mar 31, 2018 12:50 am

Ænima wrote:
Fri Mar 30, 2018 11:35 pm
Manually spawn like 30 ripper projectiles, one for every degree of angle and pitch, for a 15° “square” damage cone.

Or you could try rails i guess. That might look ugly though because IIRC there’s a limit to how many railgun particles can exist.
Well a solution to that would be making the rails invisible and launching projectiles at the same angle to simular an affect, but wouldn't a 30 ripper projectile have damage stacking on each individual projectile? Cause my goal would be to apply a specific ammount of damage for only 1 hitting until a new projectile burst hits

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

[DECORATE] Re: Cone AOE or spread attack with only one hit?

#4

Post by Konda » Sat Mar 31, 2018 6:19 pm

if one actor stands between 2 ripper projectiles, it receives twice the damage.
I have a couple of ideas:
  • Do what Aenima said with ripper projectiles, but give each of the projectiles a unique damage type. If you want to spawn 10 rippers to emulate the blast effect, each of the rippers should have damagetype "aoe1", "aoe2", ..., "aoe10". When an actor gets hit by a rippper projectile with damagetype "aoe1" for example, the actor should receive powerups that inherit from PowerProtection to completely protect it from the other 9 damagetypes (by having the powerup have properties like 'DamageFactor "aoe2", 0' etc. You can achieve this via damagetype-specific pain states for all actors or have the ripper projectiles continuously do A_RadiusGive to give the approperiate powerup. You're also going to have to make sure that the actor gets at most one of these powerups at a time (meaning it shouldn't get powerups that protect it from everything but "aoe2" and everything but "aoe1" at the same time - I think you can do this by forcing 'DamageType "aoe1", 1' in the powerup given by the ripper projectile with damagetype "aoe1", this way the effects of the powerups will just override each other).
  • Execute A_RaidusGive from the center of the actor which fires the cone-shaped blast. Have the inventory given via A_RadiusGive autoatctivate and execute an ACS script upon activation. This way all the actors within the blasting actor's sight are affected. In the ACS script (which each of the affected actors execute), do some math that takes into account the blasting actor's position and angle, and the caling actor's position to determine if the calling actor is within the blasting actor's cone-shaped field of effect. If yes, then damage the calling actor.

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

[DECORATE] Re: Cone AOE or spread attack with only one hit?

#5

Post by Empyre » Sun Apr 01, 2018 4:50 am

That''s a clever idea that I wouldn't have thought of. Here is what I hope is a refinement of that idea. I haven't tested it, but I have done something similar, but without the damage immunity part.

Instead of projectiles, use rails. Because you can't specify a damage type for rails, have the rail itself do no damage, but it makes an invisible custom puff that does the damage with a small-radius explosion, which can have a custom damage type. The puff needs to have the +PUFFONACTORS, +ALWAYSPUFF, +PUFFGETSOWNER, and +NODAMAGETHRUST flags. They can all have the same custom damage type. Each puff will do its damage and then give the short-lived immunity powerup that Konda described. If another puff hits the same target in the same tic, the target will already have immunity given by the first puff.
"For the world is hollow, and I have touched the sky."

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

[DECORATE] Re: Cone AOE or spread attack with only one hit?

#6

Post by FranckyFox2468 » Sun Apr 01, 2018 3:51 pm

Won't using an invincibility power up make it so if two cons are fired at once by different players by the same target have one of the players' damage ignored? Also the problem with doing acs called damage is that unless you go into batshit crazy TID assignement and stuff (which makes it further painful with things already with a TID) is that the kill is not assigned to the killer in pvp and such, so if the target is a player, it will get -1 to its score and the killer will get nothing. So if you have a mechanic based upon making sure who the killer is to assign something, it becomes worthless.

Also i assume the damage immunity powerup would last 1 tic? Cause in that case i already experimented with 1 tic powerups and for some reason its as if the character that gets it never had the item in the first place.

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

[DECORATE] Re: Cone AOE or spread attack with only one hit?

#7

Post by Konda » Sun Apr 01, 2018 5:59 pm

I think you can transfer the kill by making the player spawn some invisible actors in the weapon's Fire state, then teleporting them to the target's position and making them do A_Explode... Or I think the invisible actor has to fire a projectile that does A_Explode for the points/kill to be transferred to the original player. Also I think the invisible actors have to be spawned via A_SpawnItemEx with some flags like SXF_TRANSFERPOINTERS. Have a player spawn like 100 invisible actors with unique tids each, then have some algorithm in the acs script to find the tid of an available invisible actor and transfer it to the calling actor's position and change its state into the one which fires the exploding projectile....

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

[DECORATE] Re: Cone AOE or spread attack with only one hit?

#8

Post by Empyre » Sun Apr 01, 2018 10:31 pm

Here is kind of what I was talking about, with no ACS required. This is from my OPWeapons, with the alt-fire zoom edited out because it is irrelevant. You would need to add the invulnerability stuff.

Code: Select all

ACTOR OPPistol : Pistol replaces Pistol
{
  Weapon.SlotNumber 2
  Tag "Rail Pistol"
  Inventory.PickupMessage "You got a Rail Pistol?"
  DamageType "PlayerDamage"
  Obituary "%o was blasted by %k's rail pistol."
  States
  {
  Ready:
    COLT A 1 A_WeaponReady
    Loop
  Deselect:
    COLT A 1 A_Lower
    Loop
  Select:
    COLT A 1 A_Raise
    Loop
  Fire:
    COLT A 0
    TNT1 A 0 A_PlaySound ("Weapon/COLTFIRE", CHAN_WEAPON)
    TNT1 A 0 A_GunFlash
    COLF A 1 Bright A_RailAttack(0,0,1,"None","FF 60 60",RGF_SILENT,0,"OPRailPuff")
    COLF A 1 Bright A_Light2
    COLF A 1 Bright A_Light1
    COLT B 3 A_Light0
    COLT CDE 3
    COLT B 3 A_ReFire
    Goto Ready
  Flash:
    COLF A 3 Bright A_Light1
    COLF A 3 Bright A_Light0
    Goto LightDone
 }
}

ACTOR OPRailPuff : BulletPuff
{
  DamageType "PlayerDamage"
  +ALWAYSPUFF
  +NODAMAGETHRUST
  +FORCERADIUSDMG
  +PUFFGETSOWNER
  +MTHRUSPECIES
  -CLIENTSIDEONLY
  States
  {
  Spawn:
  Melee:
    TNT1 A 0
    TNT1 A 1 A_Explode(256,16,FALSE,FALSE,16)
    Stop
  }
}
The +PUFFGETSOWNER flag ensures that the player gets credit for the kill.

If a 1-tic powerup won't work, make it last 2 tics. Keep adding 1 tic until you have the minimum number that works. That is going to be a rather small chance for more than one player hitting the same target within that window. The only solution I can think of would be to assign each player his own unique custom damage type, but I don't know of a way to do that. It should be rare enough to not be a big problem if it can't be fixed.
"For the world is hollow, and I have touched the sky."

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

[DECORATE] Re: Cone AOE or spread attack with only one hit?

#9

Post by FranckyFox2468 » Wed Apr 04, 2018 2:41 pm

Wait what, you can use a melee state on a projectile? Does it work with rippers?

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

[DECORATE] Re: Cone AOE or spread attack with only one hit?

#10

Post by Empyre » Wed Apr 04, 2018 8:10 pm

It is not a projectile. It is a puff, used by hitscans and rails. There is a chart on this page that shows what the different states do.
"For the world is hollow, and I have touched the sky."

Post Reply