• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Complex Damage System Problem

Status
Not open for further replies.
Level 4
Joined
Jul 4, 2009
Messages
48
All right, here I am back again with another problem.
I built a complex combat system which allows you to only damage enemies when right clicking them. Also contains a hit chance and critical strike system in it.
But it does not work properly. I looked at it multiple times but cannot find the problem. My unit does not damage the enemy when clicked and the floating texts somehow not showing. Please if you could help me fixing it i'd be very happy and you would help me building my Hack'n Slash based map.
Thank you!
 

Attachments

  • RP.w3x
    636.5 KB · Views: 26
Level 37
Joined
Mar 6, 2006
Messages
9,240
The wait causes issues I believe.

Add "turn off this trigger" as the first action and "turn on this trigger" as the last action.


Also this this is the same...

  • Combat
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Owner of (Target unit of issued order)) Not equal to (Owner of (Ordered unit))
      • And - All (Conditions) are true
        • Conditions
          • AttSpeed Equal to 0
          • (Ordered unit) Equal to Hero[(Player number of (Owner of (Ordered unit)))]
          • ((Owner of (Target unit of issued order)) is an ally of Player 1 (Red)) Equal to False
...as this:

  • Combat
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Owner of (Target unit of issued order)) Not equal to (Owner of (Ordered unit))
      • AttSpeed Equal to 0
      • (Ordered unit) Equal to Hero[(Player number of (Owner of (Ordered unit)))]
      • ((Owner of (Target unit of issued order)) is an ally of Player 1 (Red)) Equal to False
You shouldn't use wait, use a timer system using a periodic trigger and a unit group.

For example, save 0.3 (seconds) for the unit in some variable or hashtable and add the unit to a unit group. Then in a periodic trigger that runs every 0.03 seconds, loop through all units in the unit group and check the variable, if it is >0 then subtract 0.03 from it and save it.

You can take a look at the spell database to see how it's done, that kind of system is very common in spells.
 
Status
Not open for further replies.
Top