Ripper question

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!)
tennokenshin
Posts: 1
Joined: Sat Aug 23, 2025 12:58 am

Ripper question

Post by tennokenshin »

So, this is more of a technical issue than a scripting one. I have already ran into it affecting a script I wrote, so I am curious on what is going on.

First, the script:

Code: Select all

override int SpecialMissileHit(Actor other)
{
	if (other.bIsMonster && other.bINVULNERABLE == false)
	{
		other.GiveInventory("arcaneChargeCounter",1);
		console.printf("%s has %d of counter", other.GetClassName(), other.CountInv('arcaneChargeCounter'));
	}
	if (other.CountInv('arcaneChargeCounter') >= 50)
	{
		other.A_Explode(100, 100);
		other.A_TakeInventory("arcaneChargeCounter", 999);
	}
	return -1;
}
What it does is make the MageWandMissile projectile drop a counter into a mob's inventory when it hits it. With it reaches 50 of them, it causes an explosion. Works perfectly right now.

The surprise I got was shown by the printf check. I always had thought it was only hitting a mob 2 or 3 times with each shot. However, the counter was going up by more than 30 per shot. This would have to mean, each shot is hitting multiple times per tick or a fast projectile lasts in a multiple spots for multiple ticks as it is getting hit for the equivalent of a full 1 second.

So yeah, what is really going on here? Trying to figure out if there will be issues down the road or not.

Return to “Scripting”