Problem with ability...

Level 14
Joined
Aug 8, 2010
Messages
1,022
Hi! I wanna ask why my spell doesn't work, triggers here :

  • Da hashtable
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set HashForDamage = (Last created hashtable)
  • Damage
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Bear
    • Actions
      • Hashtable - Save (Damage taken) as 1 of 1 in HashForDamage
  • Da actual spell
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Power Slam [Bear]
    • Actions
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - ((Load 1 of 1 from HashForDamage) + ((Load 1 of 1 from HashForDamage) x 10.00)))
What i actually want is when my bear uses the spell 'Power Slam' - the damage taken to be 11 times X the normal damage of the bear. The dummy spel i use is Storm bolt. +rep 4 help!
 
Level 27
Joined
Jan 26, 2007
Messages
4,788
The event "A unit is attacked" fires before any damage is taken (when a unit is ordered to attack).
Therefore, the "Damage taken" value is incorrect.

If a damage detection system was this easy, there wouldn't be many of those systems around.
Unfortunately, it is not. Creating a smooth system requires some time (because "unit takes damage" fires with triggered damage, spells and regular attacks. Differentiating them is sometimes tricky.
Well, I advise you use http://www.hiveworkshop.com/forums/spells-569/gui-friendly-damage-detection-v1-2-1-a-149098/ for a damage detection system (since you use GUI).
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
ap0calypse, i don't actually understand how to use the thing you've sent... i will try again, but before that - is there a way to capture the base damage of an unit, because that's what i really need, i don't need the damage taken - i tried to improvise... :D
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
I created a little test map for you, since i wont write here triggers while you are not familiar with any of damage systems.

I used GUI friendly damage system, as metioned above its great for GUI users.
(i used it for unit type, not for signle unit, and for testing its just a footman)

EDIt if its not what are you looking for, or you are not satysty with it, post it.
 

Attachments

  • bear strike.w3x
    24 KB · Views: 46
Level 14
Joined
Aug 8, 2010
Messages
1,022
Thanks, Spinnaker! But i saw that in the tutorial for the friendly damage capture system that i can copy the triggers and the variables from one map to another. Can you show me how to do it - i can't open 2 maps at the same time... And where i can find the function "Automatically create unknown variables while pasting trigger data" and enable it???
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Go File -> preferences and make sure you have turned on "automatically create new variables when pasting new trigger" or smth like that.
To implement this system simply copy the category GDD into your map, and to use it with triggers use as event:

  • Events
    • Game - value of real variable becomes 0
as variable use GDD_Event
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hmmm... i found the function and enable it, but when i copy the trigg, it isn't pasting... Exactly what i do is this : I open your map, copy the trigger (also i tried with 'copy as text'), close your map, open my map, try to paste it and nothing happens, i mean i can't click the 'Paste' button... ?

You may think i am dumb and that i am noob - i am! :D :X
 
Last edited:

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Every one was a beginer. First copy category - here trigger forlder - GDD into your map: you have to right-click ->copy, close map, open ur's go to trigger editor, hold cursor on triggers category field (there is a map init trigger already) and paste it. Your GDD should now be implemented if you enabled creating new variables as metioned above. Rest you know - i hope so.
 
Top