Poison via Zscript?

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!)
Heisanevilgenius
Posts: 54
Joined: Wed Dec 15, 2021 8:38 pm
Graphics Processor: nVidia (Modern GZDoom)

Poison via Zscript?

Post by Heisanevilgenius »

Hi all. I wanted to use a projectile that has a customizable poison duration. So instead of putting "PoisonDamage X, X, X;" as a property, I could have it as a DoSpecialDamage or such, and I could make the damage and duration based on a script that can vary. I'm having a hard time finding info on this in the documentation, but I have seen discussion in other threads about variables such as PoisonDurationReceived and am just wondering how to implement that? I want to make sure I'm using Zdoom poison and not Hexen poison since they seem to be completely different functions?

Thank you.

P.S. When I first started posting in this forum I had no idea how ZScript works and from all the help I've gotten I've been able to figure out a lot of really cool stuff and now it's all clicking! I can't thank you folks enough.

Edit: Nevermind! I figured it out on my own!

Just in case anyone wants to do something similar, this was added to the projectile:

Code: Select all

	override int DoSpecialDamage (Actor victim, int damage, Name damagetype)
	{
		if (victim.player)
		{
			victim.PoisonDamageReceived=(formula);
			victim.PoisonDurationReceived=(formula);
			return damage;
		}
		return 0;
	}
Blue Shadow
Posts: 5019
Joined: Sun Nov 14, 2010 12:59 am

Re: Poison via Zscript?

Post by Blue Shadow »

Typically, you'd want to use PoisonMobj.
Heisanevilgenius
Posts: 54
Joined: Wed Dec 15, 2021 8:38 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Poison via Zscript?

Post by Heisanevilgenius »

Thank you, that's very useful :)

Return to “Scripting”