• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Solved] Problem with damage engine 3.8

Status
Not open for further replies.
Level 24
Joined
Jun 26, 2020
Messages
1,853
I used damage engine 3.8 (because I'm in the 1.26) but for some reason after a unit receives a spell, the next attack it does (or I think the last target of the caster) do 15 times the normal damage, what happen this? I asked help to @Bribe but he didn't answer me, so I ask to you, I will attach the map.
 

Attachments

  • The escape of draenei vBeta21.w3x
    4 MB · Views: 41
I made this trigger (with Damage Engine 3.8) that blocks and returns damage after a certain number of hits:
  • Lizard Scales
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (Level of Lizard Scales for DamageEventTarget) Greater than 0
      • IsDamageSpell Equal to False
    • Actions
      • Set Atemp_Int4 = (Player number of (Owner of DamageEventTarget))
      • Set LS_hits[Atemp_Int4] = (LS_hits[Atemp_Int4] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LS_hits[Atemp_Int4] mod (8 - (2 x (Level of Lizard Scales for DamageEventTarget)))) Equal to 0
        • Then - Actions
          • Set DamageEventAmount = 0.00
          • Set NextDamageType = DamageEventType
          • Unit - Cause DamageEventTarget to damage DamageEventSource, dealing ((0.25 x (Real((Level of Lizard Scales for DamageEventTarget)))) x DamageEventPrevAmt) damage of attack type Hero and damage type Normal
          • Trigger - Run ClearDamageEvent (checking conditions)
          • Special Effect - Create a special effect attached to the chest of DamageEventTarget using Abilities\Spells\Orc\Devour\DevourEffectArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set LS_hits[Atemp_Int4] = 0
        • Else - Actions
But sometimes returns much more damage than it should be (I think this has to be with the unit receive non-triggered critical damages, or the source cast a spell on the target), what's wrong?
Pls, don't tell me I have to trigger my critical strikes from now.
And another problem, I made this ability to reduce damage based in how many life remains of the target, but after the source cast a spell (in this case a storm bolt) the next attack of the target is 15 times than normal:
  • Dark Blood
    • Events
      • Game - DamageModifierEvent becomes Igual a 1.00
    • Conditions
      • (Level of Dark Blood for DamageEventTarget) Greater than 0
      • IsDamageSpell Equal to False
    • Actions
      • Custom script: set udg_DamageEventAmount=(1.00-(((100.00-GetUnitLifePercent(udg_DamageEventTarget))/8.00)*((0.02+0.02*I2R(GetUnitAbilityLevelSwapped('A06S',udg_DamageEventTarget))))))*udg_DamageEventAmount

I would recommend two things:

1) Switch to Damage Engine 3A. This mainly requires you update the JASS code (but you need to be using JassHelper).

2) Get rid of ClearDamageEvent as it won't be needed.

3) Debug the DamageEventAmount (run a gameplay message to determine) and name the trigger in which it is dealt, so you know exactly which of your triggers has set the DamageEventAmount to the unintended value
 
Level 24
Joined
Jun 26, 2020
Messages
1,853
I would recommend two things:

1) Switch to Damage Engine 3A. This mainly requires you update the JASS code (but you need to be using JassHelper).

2) Get rid of ClearDamageEvent as it won't be needed.

3) Debug the DamageEventAmount (run a gameplay message to determine) and name the trigger in which it is dealt, so you know exactly which of your triggers has set the DamageEventAmount to the unintended value
In reality the real problem is after a unit cast a spell (in this case stormbolt, I didn't test another case) the last unit target of the attacks of the caster when attacks him back it do over 1000 damage and this vary depending of the unit so I think it depends of the damage or the life, and the problem is I don't know why.

And I don't know how to add JassHelper to my editor, JNG is discontinued, Sharpcraft is not different to the normal editor and JNGP-lua is for the current version.
 
In reality the real problem is after a unit cast a spell (in this case stormbolt, I didn't test another case) the last unit target of the attacks of the caster when attacks him back it do over 1000 damage and this vary depending of the unit so I think it depends of the damage or the life, and the problem is I don't know why.

And I don't know how to add JassHelper to my editor, JNG is discontinued, Sharpcraft is not different to the normal editor and JNGP-lua is for the current version.

One of your Damage Event triggers is dealing too much damage in a way you didn't control for. You have to debug it.
 
Level 24
Joined
Jun 26, 2020
Messages
1,853
Ok, this will be stupid, but I found the reason, without noticing the unit that I used to test have a berserk ability and in the stats the increased damage was at 20.00 and not at 0.20, sorry for the problems.

But @Bribe you can still tell me how to get the JassHelper.
 
Level 24
Joined
Jun 26, 2020
Messages
1,853
Help, I don't know what I did, but the editor doesn't recognize the normal functions
upload_2020-12-4_18-32-48.png

I tried reinstalling it, but know when I press "Test map" the game doesn't open, at the end, I think the first problem happen because I disabled the option "Don't allow WE disable triggers" and "Always allow enable triggers" so at the end how can I check if a custom script is ok?
 
Last edited:
Status
Not open for further replies.
Top