Passive skill with cooldown.

zero9x

Active Member
Reaction score
1
Hi guys, i got a spell like this:

When HERO has been target by a spell, creat a dummy and order dummy to use that spell to CASTER.

But this spell is so strong, then i want make it cooldown-able, can you guys help me :( ?

Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Level of SPELL for (Target unit of ability being cast)) Greater than or equal to (>=) 1
    • Actions
      • Set AACaster = (Casting unit)
      • Set AAUnit = (Target unit of ability being cast)
      • Set AALoc1 = (Position of AAUnit)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Ability being cast) Equal to (==) Knock Shot
          • Then - Actions
            • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
            • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
            • Unit - Add Knock Shot to (Last created unit)
            • Unit - Set level of Knock Shot for (Last created unit) to (Level of Knock Shot for AACaster)
            • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt AACaster
          • Else - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Ability being cast) Equal to (==) Lightning Strike
              • Then - Actions
                • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                • Unit - Add Lightning Strike to (Last created unit)
                • Unit - Set level of Lightning Strike for (Last created unit) to (Level of Lightning Strike for AACaster)
                • Unit - Order (Last created unit) to Neutral Naga Sea Witch - Forked Lightning AACaster
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Ability being cast) Equal to (==) Electron Shock
                  • Then - Actions
                    • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                    • Unit - Add Electron Shock to (Last created unit)
                    • Unit - Set level of Electron Shock for (Last created unit) to (Level of Electron Shock for AACaster)
                    • Unit - Order (Last created unit) to Neutral Fire Lord - Soul Burn AACaster
                  • Else - Actions
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Ability being cast) Equal to (==) Lightning Storm
                      • Then - Actions
                        • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                        • Unit - Add Lightning Storm to (Last created unit)
                        • Unit - Set level of Lightning Storm for (Last created unit) to (Level of Lightning Storm for AACaster)
                        • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning AACaster
                      • Else - Actions
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Ability being cast) Equal to (==) Storm Hammer
                          • Then - Actions
                            • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                            • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                            • Unit - Add Storm Hammer to (Last created unit)
                            • Unit - Set level of Storm Hammer for (Last created unit) to (Level of Storm Hammer for AACaster)
                            • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt AACaster
                          • Else - Actions
                            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • (Ability being cast) Equal to (==) Telekinetic Grasp
                              • Then - Actions
                                • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                                • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                                • Unit - Add Telekinetic Grasp to (Last created unit)
                                • Unit - Set level of Telekinetic Grasp for (Last created unit) to (Level of Telekinetic Grasp for AACaster)
                                • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt AACaster
                              • Else - Actions
                                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  • If - Conditions
                                    • (Ability being cast) Equal to (==) Wrath of Nature
                                  • Then - Actions
                                    • Unit - Create 1 Craggy Exterior Dummy for (Owner of AAUnit) at AALoc1 facing Default building facing (270.0) degrees
                                    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                                    • Unit - Add Wrath of Nature to (Last created unit)
                                    • Unit - Set level of Wrath of Nature for (Last created unit) to (Level of Wrath of Nature for AACaster)
                                    • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning AACaster
                                  • Else - Actions
      • Custom script: call RemoveLocation(udg_AALoc1)
      • Set AAUnit = No unit
      • Set AACaster = No unit


Knock Shot, Lightning Strike, Electron Shock, Lightning Storm, Storm Hammer..... are spells in my map ;)
Help me plz :(
 

jnZ

I
Reaction score
64
MUI: save information in the units custom value indicating whether the spell is on cooldown or not (set it to 1 after the ability triggered, run a wait, set it to 0 at the end of the wait). Also add a integer condition to only cast the ability when the custom value of the casting unit is 0. NOTE: use a local variable to refer to the casting unit after the wait

MPI: use a boolean that indicates whether the spell is on cooldown or not (set it to true after the ability triggered, run a wait, set it to false at the end of the wait). Also add a boolean condition to only cast the ability when this boolean is false.
 

zero9x

Active Member
Reaction score
1
If i put
Trigger:
  • Then - Actions
    • A
    • B
    • C
    • D
    • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning AACaster
    • Trigger - Turn off (This trigger) <-
    • Wait 1.00 seconds <-
    • Trigger - Turn on (This trigger) <-


So, the skill will has cooldown, and it dont has any bug ?
 

jnZ

I
Reaction score
64
but it would only work with a single unit. as soon as there are at least 2 units with that spell it won't work.
 

vypur85

Hibernate
Reaction score
803
> MUI: save information in the units custom value...

Just add the Triggering unit into a Unit Group, and remove Triggering unit from the group few seconds later. In the primary condition, add a Boolean check to see if the Triggering unit is not in the unit group. I guess this will be simpler.


Then again, no matter how I see this, I can't in any way possible relate this to Passive Skill Cooldown....
 

jnZ

I
Reaction score
64
My impression was that its some kind of passive double-cast ability.
unit group, hash table, custom values, whatever works. well i guess custom value always could cause problems when you also use them in some other way.
 

jnZ

I
Reaction score
64
I'm not sure if I'm right, but you can also use a hashtable for this, isn't it? (I'm kinda new with hashtables)

yeah i already mentioned that in my post earlier. well in my opinion custom values are the easiest solution.
 

Ayanami

칼리
Reaction score
288
yeah i already mentioned that in my post earlier. well in my opinion custom values are the easiest solution.

Various indexing systems use Custom Values to index/deindex units. Thus, Custom Value isn't really the best solution.
 

jnZ

I
Reaction score
64
Various indexing systems use Custom Values to index/deindex units. Thus, Custom Value isn't really the best solution.

i never said its the best. i also mentioned that custom values can easily cause problems when they are already used in other triggers. i simply meant that in my opinion custom values are the user-friendliest to use in terms of difficulty.

well i guess his question was more than answered so lets stop here - it almost sounds like people bitching at each other already.
 

Inflicted

Currently inactive
Reaction score
63
You will want to avoid turning on and off the trigger.

It would be alot easier to suggest solutions if we knew how many units would be using the ability.

It will most probably be MUI in which use a Hashtable or Custom Values as mentioned above.
However I do forsee a problem with using Custom Values in this case, you have quite a handful of abilities there and if you use Custom Values they would have a shared cooldown.

Also another quick comment on making your trigger more efficient, you could just make one IF/ELSE with many conditions and creating the units but then changing the cast order and added ability depending on ability cast. That would make your code abit shorter. Just a thought.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top