how to make a wide melee swing?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Lagi
Posts: 677
Joined: Sat Jun 23, 2018 12:51 pm
Location: Thou shalt alter thy beliefs with new evidence

how to make a wide melee swing?

Post by Lagi »

I have a sword weapon.

I would like this sword to hit every enemy in some arch.




By now im simulating this by shooting mulitple projectiles, but this solution is not good, because
  • I cannot hit more monsters,
  • monster in front blocking the monster behind.
  • there are gap between projectile (blue golem will not be hit)
  • i can hit 1x monster with multiple projectile, if stand close, which screw the control of damage dealt

Spoiler:
Jarewill
 
 
Posts: 1768
Joined: Sun Jul 21, 2019 8:54 am

Re: how to make a wide melee swing?

Post by Jarewill »

You could try using A_RailAttack to fire a few hitscan attacks in an arc that can pierce enemies.
spread_xy and spread_z parameters with the RGF_EXPLICITANGLE flag should work for angles.

It's not perfect, but might be better than projectiles.
Maybe someone else will know of a better way.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: how to make a wide melee swing?

Post by wildweasel »

I had meant to experiment with using BFG sprays to mimic this effect. Never got around to trying it, but it might be worth looking into.
User avatar
Dan_The_Noob
Posts: 872
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: how to make a wide melee swing?

Post by Dan_The_Noob »

maybe make a couple massive low-damage ripper projectiles that last for a few frames.
User avatar
Lagi
Posts: 677
Joined: Sat Jun 23, 2018 12:51 pm
Location: Thou shalt alter thy beliefs with new evidence

Re: how to make a wide melee swing?

Post by Lagi »

thanks,

railattack point me to the explosion.

making multiple projectiles, result in hitting one target multiple times, when you stand touching one monster. Its bad because i have OP close weapon, and pathetic weak area damaging.

excuse my ignorance, but I skip the BFG research.

i think i would create circle explosion


"not great, not terrible"
-Dyatlov
User avatar
Dan_The_Noob
Posts: 872
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: how to make a wide melee swing?

Post by Dan_The_Noob »

BFGSpray would probably be your best bet.

https://zdoom.org/wiki/A_BFGSpray

if you aren't limited to zandronum you can set the angle, range, height etc. to your liking.
User avatar
Lagi
Posts: 677
Joined: Sat Jun 23, 2018 12:51 pm
Location: Thou shalt alter thy beliefs with new evidence

Re: how to make a wide melee swing?

Post by Lagi »

https://doomwiki.org/wiki/BFG9000

nah.. looks like the rays are separate attacks penetrating targets. I dont want to hurt single target with multiple rays. plus the bfg behavior is very odd, i need to shoot some projectile and then it spawn rays from player?
User avatar
eharper256
Posts: 1038
Joined: Sun Feb 25, 2018 2:30 am
Location: UK
Contact:

Re: how to make a wide melee swing?

Post by eharper256 »

There is a janky method: Use A_SpawnItemEx to create invisible objects at various calculated points around the player, and have the objects immediately enter their death state and explode, and tada, you have an arc of damage. Has problems though:
A) Its lumpy in shape.
B) It may have overlapping areas if you don't perfectly calculate the explosion radii.
C) It might fail to spawn in walls and telefrag itself even with NOCLIP set.
So yeah. I used to use a similar thing for the vorpal slashes in Walpurgis, but its a bit finicky and caused the whole shenigans with not working in tight spaces very well.

BFG's are also fine for arcs and cones, though, just use an invisible projectile with 5000 or more speed and an instant death state triggering the blast.
User avatar
Lagi
Posts: 677
Joined: Sat Jun 23, 2018 12:51 pm
Location: Thou shalt alter thy beliefs with new evidence

Re: how to make a wide melee swing?

Post by Lagi »

Thanks harper,
this is what i done. I just use single exploasion cause im lazy.

With single explosion, its not so great beacuse the swing feel its deeper than it should (but at least there is no damage overlapping).


i use this. You need to launch both files.

i create monster Radius 50, and kill him.
this is monster corpse box of radius 50, so the box lenght is 100 = this i find to be optimal melee range, or explosion radius.
this is handy in measuring area of effects for many things.
Post Reply

Return to “Scripting”