[HELP?] Weird attack, need explanation?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

[HELP?] Weird attack, need explanation?

Post by Dan_The_Noob »

ok, so i have HammerHound as a possible Spider Mastermind replacement...

and one of it's attacks seem to just spawn rocks at the player and deal ridiculous damage.

the code for the attack is really strange ( HHRockSpawner is spawned by A_MissileAttack)

Code: Select all

ACTOR HHRockSpawner
{
//SPAWNID 243
Speed 7
RENDERSTYLE None
+SEEKERMISSILE
+NoTarget
MissileType HHRock
Obituary "%o was snuffed by a hammer hound."
States
{
Spawn:
HSHK A 1 A_Jump(224, 3)
HSHK A 4 A_Fire
HSHK A 1 A_MissileAttack
HSHK A 1
Stop
}
}

ACTOR HHRock
{
Speed 0
Damage 3
ExplosionDamage 5
ExplosionRadius 64
PROJECTILE
+SEEKERMISSILE
+SpawnCeiling
+CeilingHugger
+LowGravity
- NoGravity
- NODAMAGETHRUST
DeathSound "hammerhound/rocks"
Obituary "%o was smashed by a rock."
States
{
Spawn:
HRCK B 0 A_Jump (36, 7)//C
HRCK B 0 A_Jump (43, 7)//D
HRCK B 0 A_Jump (51, 7)//E
HRCK B 0 A_Jump (64, 7)//F
HRCK B 0 A_Jump (85, 7)//G
HRCK B 0 A_Jump (128, 7)//H
HRCK B 35
Goto Spawn+6
HRCK C 35
Goto Spawn+7
HRCK D 35
Goto Spawn+8
HRCK E 35
Goto Spawn+9
HRCK F 35
Goto Spawn+10
HRCK G 35
Goto Spawn+11
HRCK H 35
Goto Spawn+12
Death:
HRKE ABCDE 6 A_Explode

Stop
}
}
Can somebody explain to me why it has all the weird ceiling flags etc.?
User avatar
Tartlman
Posts: 226
Joined: Thu Oct 11, 2018 5:24 am
Location: meme hell
Contact:

Re: [HELP?] Weird attack, need explanation?

Post by Tartlman »

'm going to take a guess and say that this is how it works:

The hammer hound spawns a ton of HHRockSpawners. The A_Jump function makes them have a high chance to not spawn for each spawner (a 224/256 chance). I believe that the code here might have been written wrong and should have a TNT1 A 0 before the HSHK A 1, but i haven't worked with DECORATE for a while so i'm not sure.

HHRock then proceeds to spawn on the ceiling. This seems to spawn at the ceiling (done by +SpawnCeiling) and move along the ceiling (done by +ceilinghugger, which is weird, how's it supposed to hit the player then?) and seeks the player. Then it goes through some animation code and detonates when it hits the player.

I might be wrong, since i don't know exactly how +ceilinghugger behaves.
User avatar
Void Weaver
Posts: 724
Joined: Thu Dec 18, 2014 7:15 am
Contact:

Re: [HELP?] Weird attack, need explanation?

Post by Void Weaver »

Yep, the first lines in both actors doen't work since any first action in the Spawn state should be opened via buffer frame (like as TNT1 A 0) OR via NoDelay keyword.

Both Ceiling flags purposed to emulate "bomb rain" behaviour effect in simpliest way: SpawnCeiling means that actor will be spawned at ceiling, but since projectile will die immediately as soon as it collide with ceiling, then CeilingHugger flag should be toggled on. Meanwhile the missile have 0 speed AND its NoGravity flag toggled off, so HHRock will slowly fall down from ceiling.

And finally, NO, none of both actors wouldn't seek for foes since HHRockSpawner have warping A_Fire function and just will warp HHRocks directly into original shooter's target instead.
User avatar
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: [HELP?] Weird attack, need explanation?

Post by Dan_The_Noob »

Void Weaver wrote:Yep, the first lines in both actors doen't work since any first action in the Spawn state should be opened via buffer frame (like as TNT1 A 0) OR via NoDelay keyword.

Both Ceiling flags purposed to emulate "bomb rain" behaviour effect in simpliest way: SpawnCeiling means that actor will be spawned at ceiling, but since projectile will die immediately as soon as it collide with ceiling, then CeilingHugger flag should be toggled on. Meanwhile the missile have 0 speed AND its NoGravity flag toggled off, so HHRock will slowly fall down from ceiling.

And finally, NO, none of both actors wouldn't seek for foes since HHRockSpawner have warping A_Fire function and just will warp HHRocks directly into original shooter's target instead.

OHHHH so A_Fire is used to cause projectiles to spawn on the player... interesting.

that makes the other flags make more sense i guess... there's no way to balance this attack so i may have to remove it and change the earthquake type attack to a melee with the shockwave causing knockback and a little more damage.

or i can just rip that enemy out of the list for now... it's the only massively unfair one far as i can tell but would be useless without the rock.
User avatar
Void Weaver
Posts: 724
Joined: Thu Dec 18, 2014 7:15 am
Contact:

Re: [HELP?] Weird attack, need explanation?

Post by Void Weaver »

Dan_The_Noob wrote:OHHHH so A_Fire is used to cause projectiles to spawn on the player... interesting.
No. A_Fire is part of attack sequence of classic Archvile, and de-facto simpliest version of A_Warp. Obviously that both functions have a wide usage area with lot of tricks.
Dan_The_Noob wrote:there's no way to balance this attack so i may have to remove it and change the earthquake type attack to a melee with the shockwave causing knockback and a little more damage.
Why not? Any old coded behaviour can be edited in more progressive way, I guess. :)

What about this glitchy code I can assume that its creator wanted to make something really a bit looking as homing rocks rain. At least I'd make it in this manner indeed, without stupid HHRockSpawner at all. Smth. like:

Code: Select all

Actor HammerHound 
{
+DONTHARMSPECIES
MissileType "HHRock"
States
{
Missile:
<...>
SPRT A 0 A_MissileAttack
<...>
}
}

ACTOR HHRock
{
Speed 10
Damage 3
ExplosionDamage 5
ExplosionRadius 64
Gravity 10
PROJECTILE
+SEEKERMISSILE
+SpawnCeiling
+CeilingHugger
- NoGravity
- NODAMAGETHRUST
DeathSound "hammerhound/rocks"
Obituary "%o was smashed by a rock."
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Fire(ceilingz)
SpawnL:
HRCK B 0 A_Jump (36,"C")//C
HRCK B 0 A_Jump (43, "D")//D
HRCK B 0 A_Jump (51, "E")//E
HRCK B 0 A_Jump (64, "F")//F
HRCK B 0 A_Jump (85, "G")//G
HRCK B 0 A_Jump (128, "H")//H
BAL1 B 1 A_Tracer2
Loop
C:
HRCK C 1 A_Tracer2
Loop
D:
HRCK D 1 A_Tracer2
Loop
E:
HRCK E 1 A_Tracer2
Loop
F:
HRCK F 1 A_Tracer2
Loop
G:
HRCK G 1 A_Tracer2
Loop
H:
HRCK H 1 A_Tracer2
Loop
Death:
HRKE ABCDE 6 A_Explode
Stop
}
}
But maybe he did what he want. But very clumsy. :|
User avatar
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: [HELP?] Weird attack, need explanation?

Post by Dan_The_Noob »

i did change it to Rock and make it a projectile from the enemy etc. but it was kind of limp...

but doing it the normal way causes the rocks to just totally annihilate you because you can't see them coming and can't dodge them for some reason?
Post Reply

Return to “Scripting”