• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

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

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.
Back
Top