Page 1 of 1

Mikk's ZScript resources [Smooth fire 2.0!]

Posted: Fri Aug 04, 2017 12:03 pm
by Mikk-
I've been tinkering away at some small resources as a practice for ZScript modding

Here's what I've come up with:

Smooth Fire v2.0

Nicely animated (non-particle) fire FX, comes in 2 shapes and almost unlimited colours! - massively customisable!!
Spoiler: Things to note:
Universal Headshots

Simple mod which adds headshot hit-boxes to all enemy types, also includes an enemy blacklist for those that shouldn't take headshot damage.
Spoiler: Things to note:

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Thu Sep 28, 2017 8:14 pm
by Matt
Nice! I didn't even realize you could do that with eventhandlers! [apparently I had completely glossed over that fact when you posted it on the other thread -_-]
Revenant shoots own hitbox, so it has been blacklisted.
I take it that there's no precaution against when an imp is shooting at a target at a very steep pitch upwards? That's always been the reason why I've tended to avoid headshot actors.
This does not currently transfer ownership of kills to the player
If you use master.DamageMobj() instead of A_DamageMaster() (and use the hitbox's DamageMobj() instead of constantly polling hitpoints) you can specify the inflictor and source so that the monster is recorded as being damaged by whatever hit the headbox.

anyway, bumping because this deserves more attention than the other spaghetti headshot thread.

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Thu Oct 05, 2017 7:31 pm
by Ryuhi
Loving this system, but a quick question:

Is there a way to set the headshot hitbox to take on the species of the monster that calls it? If so, you could theoretically use mthruspecies to allow its own projectiles to pass through it to avoid enemies from hitting themselves (especially when aiming upward) I don't think you can do it in decorate, but I was wondering if it was maybe possible with zscript?

edit: Giving the headshot hitbox +Spectral did the trick, but its a bit hacky since it means the player will need to apply +Spectral to any projectiles that can score a headshot (and no enemy projectiles will be able to use the flag in the process, lest they repeat the problem)

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Mon Oct 09, 2017 12:15 pm
by Leon_Portier
It looks very nice and works well!
The code looks complex though, may I ask questions if any come up?

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Mon Oct 09, 2017 12:50 pm
by Mikk-
Yeah sure. If you have any questions feel free to post them here or message me privately

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Sun Jan 27, 2019 7:57 am
by Enjay
Sorry to necro this one but does anyone know why this mod flags this warning and what can be done about it?

Code: Select all

Script warning, "mk-zscr-headshots.pk3:zscript.txt" line 127:
Truncation of floating point value
The bit of code in question is:

Code: Select all

			if(self.health < self.lastHealth)
				{ 
				hs_SpawnBlood(10);
				A_DamageMaster((self.lastHealth - self.Health)*hsfactor,"default"); self.lasthealth = self.health;
				}
and the relevant line is the one with A_DamageMaster

I'm going to assume that it's because (from the wiki) the amount of damage done is an int...
A_DamageMaster (int amount...
but that (self.lastHealth - self.Health) is a float. However, I don't know how to address that.

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Sun Jan 27, 2019 9:53 am
by Blue Shadow
I'm assuming 'hsfactor' is a float/double. Multiplying an integer with a double produces a double still. Casting the following expression to an integer should silence the warning:

Code: Select all

(self.lastHealth - self.Health)*hsfactor
After the cast:

Code: Select all

int((self.lastHealth - self.Health)*hsfactor)

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Sun Jan 27, 2019 10:25 am
by Enjay
Thank you. That seems to be working perfectly.

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Sat Nov 23, 2019 4:11 am
by DoomedRabbit
Hi,

Sorry for the bump but the Smooth Fire resource does not seem to be working properly on my end.
When I put the resource into my GZDoom Builder Game Config Resources it gives me this error:

"Failed to apply MAPINFO DoomEdNum override "10101 = zfire": failed to find corresponding actor class..."
"Failed to apply MAPINFO DoomEdNum override "10102 = zfire2": failed to find corresponding actor class..."

I don't know what this is all about but if anyone can help me with this I would appreciate it.

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Mon Mar 02, 2020 7:15 pm
by vólentiæn
sorry for the bump but it seems gzdoom wont reconise decorate actors when i add them to the exclusion area (its a custom flying lost soul type enemy)
really wish it could considering they end up killing them selves

Code: Select all

Script error, "’.K 2.1.wad:ZSCRIPT" line 15:
Unknown class name 'AgroPropeller' of type 'Actor'

is what i get back
i honestly know nothing about zscript to rewrite it in zcsript instead

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Thu Mar 05, 2020 9:20 am
by Mikk-
vólentiæn wrote:sorry for the bump but it seems gzdoom wont reconise decorate actors when i add them to the exclusion area (its a custom flying lost soul type enemy)
really wish it could considering they end up killing them selves

Code: Select all

Script error, "’.K 2.1.wad:ZSCRIPT" line 15:
Unknown class name 'AgroPropeller' of type 'Actor'

is what i get back
i honestly know nothing about zscript to rewrite it in zcsript instead
I can take a look into this, at some point.

in other news I've updated the Smooth Fire to be even more modular, it can now take the colour value set in your UDMF editor of choice! Also some code improvements here and there have been made over the past few years. Check it out in the main post

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Tue Jan 19, 2021 6:14 am
by XLightningStormL
Ryuhi wrote: edit: Giving the headshot hitbox +Spectral did the trick, but its a bit hacky since it means the player will need to apply +Spectral to any projectiles that can score a headshot (and no enemy projectiles will be able to use the flag in the process, lest they repeat the problem)
Sounds like a great bypass in theory, but you are screwed if you use hitscans, since they don't care if either the weapon or the puff has +Spectral or not, it just won't allow the damage to be dealt.

Re: Mikk's ZScript resources [Smooth fire 2.0!]

Posted: Tue Jan 19, 2021 7:59 am
by Mikk-
Adding the +SOLID flag and a CanCollideWith override can alleviate the Revenant issue all together, something I didn't know 3 years ago when making this simple resource.

Code: Select all

    override bool CanCollideWith(actor other, bool passive)
        {
        // if the potential collision is with the master, or the master's projectile do not collide.
         if((other.target && (other.target == master)) || (other == master))
            return false;
            
        return super.CanCollideWith(other, passive);
        } 
Here's a small updated version of the actor-based headshots. It's not intended to be used as a gameplay mod, so some tweaking may be required.

Re: Mikk's ZScript resources [Smooth fire / Universal Headsh

Posted: Wed Feb 02, 2022 11:51 pm
by The T_W_C
Mikk- wrote:Yeah sure. If you have any questions feel free to post them here or message me privately

How would I change the damage of the headshots so it does insta kill enemies