Page 1 of 1
Changing a damagetype's damagefactor on the fly?
Posted: Sun Jan 31, 2016 3:41 pm
by Lollipop
Hey there, I just stumbled upon this possible limitation, granted that I didn't miss anything.
I was looking around the Zdoom wiki and I noticed that there didn't seem to be any way of setting an actors damagefactor for a specific damagetype on the fly. The only option I could find was to change its overall damagefactor, which isn't very flexible.
A possible reason one would use this is to say, if one has a monster which gets increased resistance against a specific damagetype proportionally with the health it has missing.
Just curious, and I am posting this here to make sure before I do anything on the tracker.
RE: Changing a damagetype's damagefactor on the fly?
Posted: Sun Jan 31, 2016 5:12 pm
by Vincent(PDP)
I don't think there is any way to do so, no.
The best solution at the moment I'd say is to create a new power up:
Code: Select all
Actor HalfFireDamage : PowerProtection
{
DamageFactor "Fire", 0.5
Powerup.Duration 0x7FFFFFFF
}
RE: Changing a damagetype's damagefactor on the fly?
Posted: Sun Jan 31, 2016 5:50 pm
by Lollipop
In that case it is impossible to change the damagefactor precisely as a result of a mathematical equation. I don't know how much there would be for this except for special RPG circumstances, which I suppose has its own merit.
I will post a suggestion on the tracker, then it can be decided wether or not there is enough of a use for it.
RE: Changing a damagetype's damagefactor on the fly?
Posted: Sun Jan 31, 2016 7:08 pm
by Catastrophe
Can't you just do what All Out War does, and use armor-types to adjust damageFactors?
Edit: Oh I see, monsters too? I'm not sure then.
RE: Changing a damagetype's damagefactor on the fly?
Posted: Sun Jan 31, 2016 7:10 pm
by Combinebobnt
I was looking for something like this yesterday and found nothing, wish zdoom had a deprecated +HALFDAMAGE flag or something. I don't know if vincent's powerup solution works on monsters, but it does for players.
RE: Changing a damagetype's damagefactor on the fly?
Posted: Sun Jan 31, 2016 7:15 pm
by Lollipop
What I am trying to issue here is directly setting the property of the actor through ACS for flexibility purposes.
RE: Changing a damagetype's damagefactor on the fly?
Posted: Mon Feb 01, 2016 2:32 am
by Untitled
The way you do it is through powerups; damagefactor powerups do in fact work on monsters. So basically any time you set the damagefactor, you give it the powerup, and similarly take it away when he doesn't have it. It's a hack, but it's the only method that I know works.
EDIT: I'd be a bit more detailed but I'm not feeling 100% right now
RE: Changing a damagetype's damagefactor on the fly?
Posted: Tue Feb 02, 2016 4:38 pm
by Vincent(PDP)
Combinebobnt wrote:
I don't know if vincent's powerup solution works on monsters, ...
They do, that's why I suggested it. :)
RE: Changing a damagetype's damagefactor on the fly?
Posted: Tue Feb 02, 2016 5:24 pm
by Konda
Lollipop wrote:
In that case it is impossible to change the damagefactor precisely as a result of a mathematical equation.
If you make a program that prints 100 powerup definitions with damagefactors going from 0.01 to 0.99 and 1.0, you could technically achieve that flexibility :v
Edit: If it's possible to stack the powerups of the same type, then you only need an actor definition for damagefactor of 0.01
RE: Changing a damagetype's damagefactor on the fly?
Posted: Tue Feb 02, 2016 10:57 pm
by Vincent(PDP)
Konda wrote:
If it's possible to stack the powerups of the same type, then you only need an actor definition for damagefactor of 0.01
Don't think so... :I
Konda wrote:
If you make a program that prints 100 powerup definitions with damagefactors going from 0.01 to 0.99 and 1.0, you could technically achieve that flexibility :v
Done

(for normal damage):
http://ideone.com/Q2xnKb
If you want to use something else than the standard damage type, copy the output from the above link and paste it into something like Notepad.
In Notepad press "CTRL + H" to bring up the replace menu, then in the first box type "Normal" (without the quotes) and in the second box type in the name of the damage type you want to use, then press "Replace all".
RE: Changing a damagetype's damagefactor on the fly?
Posted: Wed Feb 03, 2016 3:49 am
by Konda
Cheers! Hax all the way.