by Gez » Fri Feb 08, 2019 11:43 pm
Kzer-Za wrote:First, it takes not more than 9 arguments. I don't know if it is a bug, but at least it is not mentioned here:
https://zdoom.org/wiki/A_Explode. So you can't, e.g. specify a third flag (in addition to the two that are given) in this:
Code: Select all
A_Explode(50, 81, 1, XF_NOTMISSILE, XF_EXPLICITDAMAGETYPE, false, 41, "None", "Acid")
Flags are not supposed to be given as separate arguments. You have to combine them with the | operator if you want to specify several flags.
Here what you're doing is that you pass these values to the parameters:
- damage: 50
- radius: 81
- flags: 1
- alert: XF_NOTMISSILE
- fulldamageradius: XF_EXPLICITDAMAGETYPE
- nails: false
- naildamage: 41
- pufftype: None
- damagetype: Acid
Kzer-Za wrote:Second, with the same code: the third argument (int flags) seems to miscount. If I give "1" in the code above, everything works. If I give "2" (I tried it first, since I give two flags: XF_NOTMISSILE, XF_EXPLICITDAMAGETYPE), the damage is not dealt.
This is because you have misunderstood how flags work. You do not give a count, then each flag as a separate parameter: you give the flags directly, combining them into a single parameter with |. For example:
A_Explode(50, 81, XF_NOTMISSILE|XF_EXPLICITDAMAGETYPE, false, 41, false, 0, "None", "Acid")
Kzer-Za wrote:Third, fulldamageradius does not seem to work as described: "The area within which full damage is inflicted". In my experience it just significantly increases damage, but the damage dealt still drops with the distance from the center. I created a projectile that has A_Explode, and if I shoot it in the wall standing right next to it with this code:
Code: Select all
TNT1 A 0 A_Explode(50,64,1, XF_HURTSOURCE, false);
then it deals exactly 50 damage, as it should. If I change the code to this:
Code: Select all
TNT1 A 0 A_Explode(50,64,1, XF_HURTSOURCE, false, 64);
then I die even if I have 300 hitpoints, if I stand next to the wall. But if I step out from the wall, the damage gradually decreases.
Again, same confusion. Here you pass those values to the parameters:
- damage: 50
- radius: 64
- flags: 1
- alert: XF_NOTMISSILE
- fulldamageradius: false
- nails: 64
This is why you don't get the behavior you're expecting. You did not actually specify a fulldamageradius greater than 0 ("false" is worth zero when interpreted as a numerical value); and you're shooting 64 nails from the explosion so if you're standing right next to a wall you get a lot of hitscan damage from these nails in addition to explosion damage.
[quote="Kzer-Za"]First, it takes not more than 9 arguments. I don't know if it is a bug, but at least it is not mentioned here: https://zdoom.org/wiki/A_Explode. So you can't, e.g. specify a third flag (in addition to the two that are given) in this:
[code]
A_Explode(50, 81, 1, XF_NOTMISSILE, XF_EXPLICITDAMAGETYPE, false, 41, "None", "Acid")
[/code][/quote]
Flags are not supposed to be given as separate arguments. You have to combine them with the | operator if you want to specify several flags.
Here what you're doing is that you pass these values to the parameters:
[list][*]damage: 50
[*]radius: 81
[*]flags: 1
[*]alert: XF_NOTMISSILE
[*]fulldamageradius: XF_EXPLICITDAMAGETYPE
[*]nails: false
[*]naildamage: 41
[*]pufftype: None
[*]damagetype: Acid[/list]
[quote="Kzer-Za"]Second, with the same code: the third argument (int flags) seems to miscount. If I give "1" in the code above, everything works. If I give "2" (I tried it first, since I give two flags: XF_NOTMISSILE, XF_EXPLICITDAMAGETYPE), the damage is not dealt.[/quote]
This is because you have misunderstood how flags work. You do not give a count, then each flag as a separate parameter: you give the flags directly, combining them into a single parameter with |. For example:
[quote]A_Explode(50, 81, XF_NOTMISSILE|XF_EXPLICITDAMAGETYPE, false, 41, false, 0, "None", "Acid")[/quote]
[quote="Kzer-Za"]Third, fulldamageradius does not seem to work as described: "The area within which full damage is inflicted". In my experience it just significantly increases damage, but the damage dealt still drops with the distance from the center. I created a projectile that has A_Explode, and if I shoot it in the wall standing right next to it with this code:
[code]
TNT1 A 0 A_Explode(50,64,1, XF_HURTSOURCE, false);
[/code]
then it deals exactly 50 damage, as it should. If I change the code to this:
[code]
TNT1 A 0 A_Explode(50,64,1, XF_HURTSOURCE, false, 64);
[/code]
then I die even if I have 300 hitpoints, if I stand next to the wall. But if I step out from the wall, the damage gradually decreases.[/quote]
Again, same confusion. Here you pass those values to the parameters:
[list][*]damage: 50
[*]radius: 64
[*]flags: 1
[*]alert: XF_NOTMISSILE
[*]fulldamageradius: false
[*]nails: 64[/list]
This is why you don't get the behavior you're expecting. You did not actually specify a fulldamageradius greater than 0 ("false" is worth zero when interpreted as a numerical value); and you're shooting 64 nails from the explosion so if you're standing right next to a wall you get a lot of hitscan damage from these nails in addition to explosion damage.