Modifying projectile's damage in its states

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!)
User avatar
Tango
Posts: 183
Joined: Mon Jul 31, 2006 6:39 pm

Modifying projectile's damage in its states

Post by Tango »

I have a projectile whose damage I want to increase at certain points during its states (specifically, in its bounce states). I have tried the following in ZScript:

Code: Select all

	Bounce:
		TNT1 A 0
		{
			damage = 20;
		}
		Goto Spawn;
However, doing so gives me the following error:

Code: Select all

Expression must be a modifiable value
Is there another way in ZScript for me to modify a projectile's damage on the fly?
Blue Shadow
Posts: 5032
Joined: Sun Nov 14, 2010 12:59 am

Re: Modifying projectile's damage in its states

Post by Blue Shadow »

Use [wiki]SetDamage[/wiki].
User avatar
Tango
Posts: 183
Joined: Mon Jul 31, 2006 6:39 pm

Re: Modifying projectile's damage in its states

Post by Tango »

Wow I did a terrible job searching for that. I didn't bother searching for anything without an A_ prefix, and didn't check the list of ZScript functions. Thanks for saving the day as always Blue Shadow, you are an angel

Return to “Scripting”