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

[Trigger] Chain spell

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Now I tried making this chain spell just to see if it will work. It didn't >.<

Someone spot any problem ?

  • Unknown
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Firebolt (Neutral Hostile)
    • Actions
      • Custom script: local unit udg_Unit1
      • Custom script: local unit udg_Unit2
      • Set Unit1 = (Triggering unit)
      • Set Unit2 = (Target unit of ability being cast)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Wait until ((Unit2 has buff My_Buff ) Equal to True), checking every 0.30 seconds
          • Unit - Cause Unit1 to damage Unit2, dealing ((Real((Intelligence of Unit1 (Include bonuses)))) + 50.00) damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation(udg_Point)
          • Set Point = (Position of Unit2)
          • Set Unit2 = (Random unit from (Units within 400.00 of Point))
          • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Point facing Default building facing degrees
          • Unit - Order (Last created unit) to Neutral - Firebolt Unit2
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Just a random guess, but try changing this
Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Point facing Default building facing degrees
into this:
Unit - Create 1 Dummy Unit for (Owner of (Unit1)) at Point facing Default building facing degrees

Another problem can be that you cast firebolt IN a trigger that is activated by casting firebolt. In other words: you cast firebolt, then a dummy casts firebolt causing a dummy to cast firebolt, and you get an infinite loop

Oh, and don't forget to remove your dummy unit (add an expiration timer)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Removed infinity, changed owner (no reason that should help though).
Still doesn't work >.<

  • Unknown
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frost Bolt
    • Actions
      • Custom script: local unit udg_Unit1
      • Custom script: local unit udg_Unit2
      • Set Unit1 = (Triggering unit)
      • Set Unit2 = (Target unit of ability being cast)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Wait until ((Unit2 has buff Shuriken ) Equal to True), checking every 0.20 seconds
          • Unit - Cause Unit1 to damage Unit2 , dealing ((Real((Intelligence of Unit1 (Include bonuses)))) + 50.00) damage of attack type Spells and damage type Normal
          • Set Point = (Position of Unit2)
          • Set Unit2= (Random unit from (Units within 400.00 of Point))
          • Unit - Create 1 Dummy Unit for (Owner of Unit1) at Point facing Default building facing degrees
          • Unit - Order (Last created unit) to Neutral - Firebolt Unit2
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_Point)
 
Level 6
Joined
Nov 28, 2007
Messages
203
>.> hmm.. does the loop begin again when the one b4 is done? <.< cus if it does, then that's the problem. If it is, then the Wait function makes that all loops will happen at the same time.
P.S: BTW, I don't know anything about integer loops, so this is prolly not the problem -.-
 
Level 3
Joined
Oct 23, 2007
Messages
36
Um, this may be a stupid question to ask, but did you add "firebolt (neutral hostile)" to the dummy unit before asking it to cast it, or have the dummy unit already have the spell. If either of those are true, did you set the mana cost of the ability to 0 or give the dummy unit a mana pool of 9999? Lack of either of those would cause the dummy caster to not fire the spell.

Also, does the buff mentioned here:
  • Wait until ((Unit2 has buff Shuriken ) Equal to True), checking every 0.20 seconds
match the buff the the triggering spell AND the firebolt spell will give? If not, it will wait indefinitely.

For debugging purposes, put a line in the loop that will display a message to all players saying something like "Part 1 of the trigger has fired". That way you can rule out any problem with the loop itself.
 
Level 3
Joined
Oct 23, 2007
Messages
36
I'm not 100% on this, but I believe that one of the flaws of GUI is that the loops execute immediately regardless of wait commands within the loops. As a test I made a map with the two following triggers.

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Wait until (TempInteger Equal to 1), checking every 1.00 seconds
          • Game - Display to (All players) the text: Trigger has fired.
  • Loop Check
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set TempInteger = 1
It seems that after 5 seconds, the loop DID fire 5 times, making my hypothesis false.

Regardless, the fault lies in the condition line. Which means either unit 2 is incorrectly defined or dead, or the buff is incorrect. At this moment I'm stumped
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Ok here is my map (lol censored everything , even the terrain ^^) with every thing that has to do with the ability (pretty much nothing).

The Fire Bolt/Frost Bolt are the original abilities with some edits.

Please check it and tell me if you find any problems or reasons why it doesn't work.
 

Attachments

  • Fire Bolts Chain.w3x
    137.8 KB · Views: 50
Level 3
Joined
Oct 23, 2007
Messages
36
OMG, I found the problem and I feel like an idiot for missing it.

  • Set FireBoltsChain2= (Random unit from (Units within 400.00 of Point[0]))
should be
  • Set FireBoltsChain2 = (Random unit from (Units within 400.00 of Point[0] matching (((Matching unit) belongs to an enemy of (Owner of FireBoltsChain1)) Equal to True)))
The chain spell was targeting the caster and dummy caster randomly. Since they are friendly units, it would not fire, and the chain was broken. HOWEVER, your spell was still intrinsically faulty. Dead units lose all buffs, so that if a unit died from the effect, it would break the chain. I tried rewriting the code to bypass this, but I wasn't able to. At any rate that is one question answered.
 
Level 3
Joined
Dec 17, 2007
Messages
28
My Version

This is my version of Chained Spell. This thing is preety bugged:wthumbsdown:, but also preety cool:wthumbsup:... Anyway I think I have got the basics done...:wgrin:
Enjoy!
 

Attachments

  • Chain Spell.w3x
    14 KB · Views: 62
Last edited:
Level 3
Joined
Dec 18, 2007
Messages
40
What about if you made a dummy unit at position of triggering unit ..
then Order it to move to (Unit position of(target of ability being cast)
Dummy units should have the model file o frost bolt so you dont loose the effect
And all things like that

Whether you can ask on www.getdota.com As Which doctor has an ability like that!! i am sure Dota Editors will help you :)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
[Offtopic] Thanks warcryergr for giving me a tutorial that shows exacly what I did.

Funny I made it exacly the same... not funny you bring me a tutorial that helps me not a bit.

[Ontopic] WildField, when I made the trigger I really wonderd if they would work with the loop, ill try it.
 
Status
Not open for further replies.
Top