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()?
Add parameter to SetDamage() to disable randomization.
Moderator: GZDoom Developers
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Add parameter to SetDamage() to disable randomization.
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:
That said:
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.Shield overrides CanCollideWith and sets projectile's damage to (damage * 2)
Re: Add parameter to SetDamage() to disable randomization.
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.
Re: Add parameter to SetDamage() to disable randomization.
OP here. This can be closed because I realized a while ago that I could just make a variable and use it in DamageFunction, rendering this feature suggestion unnecessary. For my goals at least. Maybe someone else can find an actual use for it.