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

Assistance requested

Status
Not open for further replies.
Level 16
Joined
Sep 3, 2004
Messages
2,086
Doing the last spell in my submission, but this one spell, which is a targeted multishot that fires in waves, USES variables to bypass damned wait queues, all order strings done correctly, and IT STILL DOESN"T WORK. :evil:
The bolt ability is based of chain lightning to stop perma stun, and it still doesn't work
Code:
Mana Flare
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Mana Flare 
    Actions
        Set CastingPoint = (Target point of ability being cast)
        Unit - Create 1 Flare Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
        Set DummyReference = (Last created unit)
        For each (Integer A) from 1 to (1 + (Level of Mana Flare  for (Triggering unit))), do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in (Units within (200.00 + ((Real((Level of (Ability being cast) for (Triggering unit)))) x 50.00)) of CastingPoint) and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Owner of (Picked unit)) is an enemy of (Owner of (Triggering unit))) Equal to True
                            Then - Actions
                                Unit - Order DummyReference to Orc Far Seer - Chain Lightning (Picked unit)
                                Wait 0.20 seconds
                            Else - Actions
                                Do nothing
        Unit - Remove DummyReference from the game
        Set DummyReference = No unit
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
I would do the spell a little different though. It looks very fishy to me. What you should do is forget aobut the variable and about creating the unit anyway, and do the following stuff at (Pick Up Every Unit lalala):

Condition - Same
Actions - Create 1 Dummy Unit at position of casting unit, for owner of casting unit
- Add Last Created Unit to (UnitGroup)
- Order (Last Created Unit) to Far Seer - Chain Lightning (Picked Unit)

Now, after you have done this, put the Wait 0.20 seconds or whatever OUTSIDE the IF-All Conditions are true stuff but INSIDE the loop. Also, add the following action after the while, still inside the loop:

Pick Up Every Unit in (UnitGroup) and do Action - Remove (Picked Unit).

That should fix your problem I hope. What you wanted to do had two mistakes:

1. The Wait stuff was totally wrong done because practically it would've happened for each Picked Unit and I don't really know what exactly you would've got.
2. One unit cannot cast Chain Lightning at multiple units at the same time.

Ok, maybe I'm wrong about what you want the spell to do so tell me if I am.
 
Status
Not open for further replies.
Top