Multiplier is based on distance to dynlight OR sound source?

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!)

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Multiplier is based on distance to dynlight OR sound source?

Re: Multiplier is based on distance to dynlight OR sound sou

by Void Weaver » Wed May 29, 2019 9:05 am

Well, currently I have use a row of A_Explode calls indeed:

Code: Select all

<...>
A_JumpIfInventory("AuraLevel",6,"DarknessLevel6")
A_JumpIfInventory("AuraLevel",5,"DarknessLevel5")
A_JumpIfInventory("AuraLevel",4,"DarknessLevel4")
<...>
DarknessLevel5:
A_Explode(1,256,XF_NOSPLASH,0,256);
DarknessLevel4:
A_Explode(1,128,XF_NOSPLASH,0,128);
DarknessLevel3:
A_Explode(1,64,XF_NOSPLASH,0,64);
DarknessLevel2:
A_Explode(1,32,XF_NOSPLASH,0,32);
DarknessLevel1:
A_Explode(1,16,XF_NOSPLASH,0,16);
<...>
But since damage source is monster's aura leveling actor with dynamic growing dynlight radius, I consider calls of different A_Explode as placeholder. I. e. I want to use only 1 damage function, damage value inside of which takes into account pointerless distance from center of its source to any abstract actor within its dynlight(or sound) radius.
Caligari87 wrote:A_Explode already has damage falloff, why not use that?
Yeah, but I dunno its progression formula and seems there is no way to precise handle it, so I don't want use it blindly. Or I am wrong about this?

Well, ofc I can define a lot of A_Explode calls with checks for dynlight*(its level) but I whant to achieve the same effect without ladder of checks for A_Explode's or another damage function. Something like:

Code: Select all

A_Explode(1*CountInv("AuraLevel")*<(dynlight_radius)/(proximity_to_dynlight_source_distance)>,<dynlight_radius>)
OR

Code: Select all

A_Explode(1*CountInv("AuraLevel")*<(sound_audibility_max_distance)/(sound_attenuation)>,<sound_audibility_max_distance>)
Caligari87 wrote:Why do you keep writing "f-tion" in place of "function"?
Sorry, it's my habit to shorten a some words, but in my native language a similar shortens are quite acceptable. :oops: Thank you, I'll try to avoid so stupid usage further.

Re: Multiplier is based on distance to dynlight OR sound sou

by Caligari87 » Wed May 29, 2019 7:42 am

It makes no sense to base this on dynlights or sounds when you can just check against the position/radius of the actor performing the damage (such as a rocket). This would be trivial in zscript as you can just compare xyz positions and do some math. It's been too long since I used DECORATE but I don't think there's any simple way to calculate distance cleanly; you'd have to use a set of [wiki]A_JumpIfCloser[/wiki] calls for example.

A_Explode already has damage falloff, why not use that?

PS: Why do you keep writing "f-tion" in place of "function"?

8-)

Multiplier is based on distance to dynlight OR sound source?

by Void Weaver » Wed May 29, 2019 12:49 am

I want to get a some custom (?) dynamic multiplier for damage f-tions, which should been based on radius distance from dynlight source OR on heaing distance from sound source.
I. e. the closer to the source, the higher the multiplier (and therefore damage).

Can it be done on DECORATE only? Via userVars for ex. or by something else tricky way?

Top