Add parameter to SetDamage() to disable randomization.

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Add parameter to SetDamage() to disable randomization.

Postby Jarvis Wesslefoot » Fri May 31, 2019 5:45 pm

Use case: A projectile is deflected by a shield and has its damage increased. Shield overrides CanCollideWith and sets projectile's damage to (damage * 2). Ok, for vanilla projectiles that works wonderfully, but once the projectiles start having expressions or other static numbers that require a lack of randomization, things get complicated.

That said, would it be possible to add a bool to disable randomization for damage changed by SetDamage()?
Jarvis Wesslefoot
 

Re: Add parameter to SetDamage() to disable randomization.

Postby Matt » Fri May 31, 2019 7:57 pm

Seconded... on the proviso that if someone knows a better way to set this stuff that already exists I'd like to know (and make a note somewhere on the wiki where people can actually see it).

That said:
Shield overrides CanCollideWith and sets projectile's damage to (damage * 2)
Please do not do this. It should be a lot better documented, but doing things that change or affect actors in the playsim with a data function like CanCollideWith can lead to a lot of bad things happening because a lot of different things will be relying on this check and it can happen many more times than you might think.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Add parameter to SetDamage() to disable randomization.

Postby Jarvis Wesslefoot » Sat Jun 01, 2019 2:06 am

Oh right, thanks for the reminder. I did read about that in the wiki, multiple times in fact, but forgot it was quite problematic. Will fix it.
Jarvis Wesslefoot
 


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests