Spells - Making a Chain spell (GUI Version)

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Is this just me or does the chain in the demo map always target 2 units and deals 50 damage? Also it laggs the first time without a preloader.:p (Yeah, like Daelin said, it would be better to do this whole thing in jass)

Made a debug mode to test it out, type reset to set life and mana of all units to 100%.
 
S

somael

Guest
You didn't introduce the smax, temppoint or tempgroup variables at all.. it was very confusing(and it still is) :S
 

Daelin

Kelani Mage
Reaction score
172
somael said:
You didn't introduce the smax, temppoint or tempgroup variables at all.. it was very confusing(and it still is) :S

Daelin said:
In order to understand this tutorial you need basic knowledge about Gui/manipulating the trigger editor.

I think that includes variable initialization too. Go to the variable editor and add them from there.

~Daelin
 

H34DhUnT3r

Ultra Cool Member
Reaction score
36
Mana Healing Wave

Hi,

Can anyone help me? :confused:
I've tried to create a mana healing wave using your chain spell trigger
But it doesn't work:banghead:

Code:
HealingWaveMana
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Mana Healing Wave 
    Actions
        Set MHW_prev = (Triggering unit)
        Set MHW_target = (Target unit of ability being cast)
        Set MHW_level = (Level of (Ability being cast) for MHW_prev)
        Set MHW_targetsnum = (4 + (2 x (MHW_level - 1)))
        For each (Integer A) from 1 to MHW_targetsnum, do (Actions)
            Loop - Actions
                Unit Group - Add MHW_target to MHW_alltargs
                -------- Effect Part --------
                Set MHW_temppoint = (Position of MHW_prev)
                Unit - Create 1 Albatross for (Owner of MHW_prev) at MHW_temppoint facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_MHW_temppoint)
                Animation - Change (Triggering unit) flying height to 50.00 at 0.00
                Unit - Hide (Last created unit)
                Unit - Add Mana Healing Wave (EFFECT) to (Last created unit)
                Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike MHW_target
                Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
                -------- Waiting part --------
                Wait until ((MHW_target has buff Mana Healing Wave ) Equal to True), checking every 0.35 seconds
                -------- Spell part --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (MHW_target is dead) Equal to False
                    Then - Actions
                        Set MHW_temppoint = (Position of MHW_target)
                        Unit - Create 1 Albatross for (Owner of (Triggering unit)) at MHW_temppoint facing Default building facing degrees
                        Custom script:   call RemoveLocation(udg_MHW_temppoint)
                        Unit - Hide (Last created unit)
                        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                        Unit - Add Healing Wave Mana (4 Chain Spell) to (Last created unit)
                        Unit - Set level of Mana Burn (4 Chain Spell) for (Last created unit) to ((8 x (MHW_level - 1)) + MB_cur)
                        Unit - Order (Last created unit) to Night Elf Druid Of The Claw - Rejuvenation MHW_target
                    Else - Actions
                        Set MHW_cur = (MHW_targetsnum + 1)
                -------- Choice Part --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        MHW_cur Less than MHW_targetsnum
                    Then - Actions
                        Set MHW_prev = MHW_target
                        Set MHW_SMax = -1.00
                        Set MHW_temppoint = (Position of MHW_prev)
                        Unit Group - Pick every unit in (Units within 500.00 of (Position of MHW_prev)) and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Picked unit) is A structure) Equal to False
                                        ((Picked unit) is Mechanical) Equal to False
                                        ((Picked unit) is Magic Immune) Equal to False
                                        ((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to False
                                        ((Picked unit) is dead) Equal to False
                                        ((Picked unit) is in MB_alltargs) Equal to False
                                        (Mana of (Picked unit)) Less than (Max mana of (Picked unit))
                                        MB_SMax Greater than (Mana of (Picked unit))
                                    Then - Actions
                                        Set MHW_target = (Picked unit)
                                        Set MHW_SMax = (Mana of (Picked unit))
                                    Else - Actions
                    Else - Actions
                Custom script:   call RemoveLocation(udg_MHW_temppoint)
        Unit Group - Remove all units from MHW_alltargs

If someone finds the problem please reply

Thank you in forward

Greetings H34DhUnT3r[NL]

H34DhUnt3r Custom War3 FT Maps
 

hoeyad

New Member
Reaction score
3
When I put a wait inside the For Each Integer A from 1 to X... loop, everything after the first loop just stops working - nothing happens. Without the wait, it works (obviously everything happens instantly), but with the wait, only the first target is affected and then nothing happens.

I am using a wait 1 second rather than wait for condition, is that the problem?
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
waits do work in loops
but not in pick every unit or player group loops
 

vypur85

Hibernate
Reaction score
803
To make things clear, loops work fine in any Integer Loop (A or B). However, Integer A and B loops usually get interrupted or overwritten in another trigger. So to prevent this, a Custom Variable Integer Loop is used instead (which is also used in this tutorial).

So, change this:
For Each Integer A from 1 to X... loop

into this:
Code:
For Each Custom Integer Variable from 1 to X do
 

Charapanga

New Member
Reaction score
46
I've tried it, i did it exactly like the tutorial, and yet it does not work...

here's what i got...
JASS:
ChainManaBurn
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to ChainManaBurn 
    Actions
        Set prev = (Triggering unit)
        Set Targ = (Target unit of ability being cast)
        Set Level = (Level of ChainManaBurn  for prev)
        Set targetsnum = (4 + (2 x (Level - 1)))
        For each (Integer Cur) from 1 to targetsnum, do (Actions)
            Loop - Actions
                Unit Group - Add Targ to Alltargs
                Set TempPoint = (Position of prev)
                Unit - Create 1 DummyCMB for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_TempPoint)
                Unit - Hide (Last created unit)
                Animation - Change (Last created unit) flying height to 50.00 at 0.00
                Unit - Add Buff Dummy  to (Last created unit)
                Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike Targ
                Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                Wait until ((((Triggering unit) has buff Mana Burn ) Equal to True) or (((Triggering unit) is dead) Equal to True)), checking every 0.10 seconds
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Targ is dead) Equal to False
                    Then - Actions
                        Set TempPoint = (Position of Targ)
                        Unit - Create 1 DummyCMB for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
                        Custom script:   call RemoveLocation(udg_TempPoint)
                        Unit - Hide (Last created unit)
                        Animation - Change (Last created unit) flying height to 100.00 at 0.00
                        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                        Unit - Add Chain Mana Burn Dummy  to (Last created unit)
                        Unit - Order (Last created unit) to Night Elf Demon Hunter - Mana Burn Targ
                    Else - Actions
                        Set Cur = (targetsnum + 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Cur Less than targetsnum
                    Then - Actions
                        Set prev = Targ
                        Set SMax = -1.00
                        Set TempPoint = (Position of prev)
                        Set TempGroup = (Units within 600.00 of TempPoint)
                        Unit Group - Pick every unit in TempGroup and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Picked unit) is A structure) Equal to False
                                        ((Picked unit) is Mechanical) Equal to False
                                        ((Triggering unit) is Magic Immune) Equal to False
                                        ((Picked unit) belongs to an enemy of (Owner of prev)) Equal to True
                                        ((Picked unit) is dead) Equal to False
                                        ((Picked unit) is in Alltargs) Equal to False
                                        (Max mana of (Picked unit)) Greater than 0.00
                                        SMax Less than (Mana of (Picked unit))
                                    Then - Actions
                                        Set Targ = (Picked unit)
                                        Set SMax = (Mana of (Picked unit))
                                    Else - Actions
                    Else - Actions
                Custom script:   call RemoveLocation(udg_TempPoint)
                Custom script:   call DestroyGroup(udg_TempGroup)
        Unit Group - Remove all units from Alltargs


EDIT: Nevermind, found it, i made the most noob mistake ever...

JASS:
Wait until ((((Triggering unit) has buff Mana Burn ) Equal to True) or (((Triggering unit) is dead) Equal to True)), checking every 0.10 seconds


And replaced with

JASS:
Wait until (((Targ has buff Mana Burn ) Equal to True) or ((Targ is dead) Equal to True)), checking every 0.10 seconds


EDIT2: Now it wont bounce...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top