• 🏆 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!

[Spell] Issues with Rigwarl, the Bristleback's Quillspray

Status
Not open for further replies.
Level 7
Joined
Aug 11, 2010
Messages
269
The Ability:
Sprays enemy units with quills dealing 60 damage in a 625 AoE. Deals 30 extra damage for every time the unit was struck by a quill in the last 14 seconds.

Other Information:
Originally I couldn't exactly figure out how to go about making the trigger work in general; thankfully, a kind fellow by the name of 'Accname' helped me figure out where to start. Unfortunately... I'm still having issues getting the stacking damage to reset. I've tried everything and can't quite get the reset working. I'm not quite sure what i've been doing wrong; my script looks a little like this (It's GUI)

  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Fan of Knives
  • Actions
  • Unit Group - Pick every unit in (Units within 650 of (Position of (Triggering unit)) and do (Actions)
    • If (All conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Owner of (Picked unit)) is an enemy of Player 1 (Red)) Equal to True
        • ((Picked unit) is A structure) Equal to False
      • Then - Actions
        • Set damage = (40.00 + (30.00 x (Real(timeshit[(Custom value of (Picked unit))
        • Unit - Cause (Triggering unit) to damage (Picked unit), dealing damage damage of attack type Hero and damage type Normal
        • Set timeshit[(Custom value of (Picked unit))] = (timeshit[(Custom value of (Picked unit))] + 1)
        • Countdown Timer - Start timer[(Custom value of (Picked unit))] as a One-shot timer that will expire in 14.00 seconds
        • Wait until ((Remaining time of timer[(Custom value of (Picked unit))] Less than or equal to 0), checking every 1.00 seconds
        • Set timeshit[(Custom value of (Picked unit))]=0
      • Else - Actions
Yes, I now realize that waits and the picked unit function don't go well together; but i'm still not quite sure on how to keep it's stack timer across separate units, unfortunately.

Variables used in trigger:
'damage' controls the amount of damage dealt for ease of access
'timeshit' controls the amount of times targets were hit by the spell, allowing the stacking damage
'timer' controls the timer which I assumed would be the proper way to keep track of the time, but I am probably missing a crucial system or something to make it alot less finicky.

Any help is greatly appreciated.
 
Last edited:
Level 10
Joined
Feb 22, 2008
Messages
619
I'm having much trouble understanding the issue here.
It looks like every time the ability is cast, it will reset timer to 14 for every unit hit, is that correct?
So I guess the issue here is that if you hit enemy A and then run over and hit enemy B somewhere else, hitting enemy B will reset the timer for enemy A... Is that right?
First of all I would suggest creating a separate trigger for the timer, with an event for the timer expiring, since it looks like this trigger might leak? (I'm not sure about that)
Anyway, like I said it's really hard to understand the issue that you're having,
is the timer not running out? Is the timer running out when you don't want it to?
I'd love a well-phrased explanation of the issue, sorry if this didn't help at all.
 
Level 7
Joined
Aug 11, 2010
Messages
269
@DeadZero

Yes sir, that is correct.

Basically whenever the spell is casted I want it to create a seperate timer for units around the caster, when said timer expires -- the variable that indicates the amount of times that the unit has been hit by the spell becomes 0. The spell is an AoE spell, though. So the timer needs to be MUI, which is why my system is having troubles. I'm not quite sure how to make a seperate timer for multiple units that works properly; since the 'Picked unit' GUI action combined with the 'Wait' action literally do nothing together for some arbitrary engine reason.

But as far as your other question. The variety of ways i'm trying to implement the system (The above trigger was just the example of one of the ways that worked best for me, but i've been testing other triggers trying to get the timer working.)

Sometimes the timer works but merely doesn't reset when the ability is casted again; other times the trigger doesn't work at all. I'm just looking for an easier way to create timers -- there must be something i'm doing wrong since I simply cannot figure out how to fix the issue.


@Adiktuz

While I appreciate the suggestion, i'm fine with everything in the trigger except for the wait function that i've created, which i'm aware of doesn't work already... Unfortunately I have no idea how to create a proper way to time an event. It all works, and doesn't seem to lag out horribly. I realize the wait action IS flawed but I haven't a clue how to fix it. I'm not quite sure how to make the system work with it. I've looked everywhere but I can't seem to find a fix for it. The trigger works without the broken wait function, it simply doesn't reset the amount of times it's hit someone.

For the best explanation I can provide; what I need is an AoE stacking incinerate-like spell, when the unit casts it base damage is dealt (30 damage); the units that were hit are then stored inside of a variable -- their custom value, which is from a indexing system I have installed. When the Hero casts the spell again, new targets take (30) damage, meanwhile; targets that were hit again take the base (30) damage plus (10) damage for every time that they were hit by the spell. After 14 seconds of not being hit by this spell; the times hit by spell are cleared. (This is the part i'm having trouble with.)

Needless to say, when the 'timeshit' variable is reset to 0 the unit begins to only take 30 damage from the Spell, as it starts to slowly stack back to the amount of damage it was dealing initially.
 
Wait's do not work inside group loops AFAIK, plus that would be game breaking actually if it did... why? like in your trigger, if it did work, it will WAIT before iterating the next unit, so unit 2 will be checked only 14 seconds after unit 1... see how game breaking that would be?

Take a look at tutorials for Dynamic Indexing and using timers... look for the GUI triggering tutorial
 
Level 7
Joined
Aug 11, 2010
Messages
269
@Adiktuz

As I said multiple times already; I know the wait function doesn't work with picked unit. I'm merely trying to see if someone can recommend a way to create a timer sort of system that works in MUI.
As I have also stated, i'm already using unit indexing; which is the check for the (Custom value of (Picked unit)) check.
I've also tried looking for a system similar to what I want with no success; since most of the time tracker systems are coded into JASS, which i'm not entirely familiar with coding in.
 
Level 7
Joined
Aug 11, 2010
Messages
269
Ohhhh... Thanks! I'll try that out and see if I can't make a system based on it, i'll report back with my findings relatively soon. If it works you have my unfiltered gratitude; i've been tweaking this spell for the better part of 10 or 11 hours now and it's still been giving me issues.

Thanks again!
 
all you need basically is 1 trigger that runs on a timer every 1 second or so, which iterate thru all units (thru the unit indexer I think), which then reduces the value of a "timer" integer for that unit, once it reaches 0, set timeshit to 0

then when a unit is hit by the spell, just add to his timeshit, and reset the "timer" integer to 14
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Just answer this question:
Do you want the timer to refresh each time a new stack hits OR do you want to have a separate timer for each stack (each stack only last for 14 seconds instead of refreshed - the only thing that is refreshed is its stackCounter, responsible for damaging formula for the stacking damage) ?

PS: I'm making this one for you, provided with detailed information (refer to the question above).
 
Level 7
Joined
Aug 11, 2010
Messages
269
I want the timer to refresh the stack hits on the unit. But yes, 'timeshit' is responsible for the damage, it's an integer based variable (Should I be using a real instead, or is integer best for that? I assumed integer.)

Edit: I've tried the dynamic indexing system, I still couldn't get it to work properly unfortunately.

Edit 2: Anyone got anymore advice or help? All I need is a link to a timer or a tutorial that shows how to make a GUI MUI timer so that I can use it to reset the acquired stacks.
 
Status
Not open for further replies.
Top