• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How to make a triggered spell like Chain Lightning?

Status
Not open for further replies.
Level 7
Joined
Jul 20, 2009
Messages
295
I need it so that, 3 units takes damage respectively, 1 by 1 and showing the special effect.
I want this so that damage can be variable and not static, e.g. damage is reduced as defense increases.
 
Level 7
Joined
Jul 20, 2009
Messages
295
I tried editing the map in the link to my wanting, but it isn't working, it wont hit all of the units that are near to each other, i mean by all, as in 4-8, it mostly hits 1-2 units only...
 

Attachments

  • Chain test.w3x
    20.4 KB · Views: 40
Level 7
Joined
Jul 20, 2009
Messages
295
  • Chain Mana Burn
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Mana Burn
    • Actions
      • Set MB_targ = (Target unit of ability being cast)
      • Set MB_level = (Level of Chain Mana Burn for (Triggering unit))
      • Set MB_targetsnum = (2 + (2 x MB_level))
      • For each (Integer MB_cur) from 1 to MB_targetsnum, do (Actions)
        • Loop - Actions
          • Unit Group - Add MB_targ to MB_alltargs
          • -------- Waiting part --------
          • Wait 0.35 game-time seconds
          • -------- Spell part --------
          • Set MB_TempPoint = (Position of MB_targ)
          • Special Effect - Create a special effect at MB_TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_MB_TempPoint)
          • Game - Display to (All players) the text: (String((Custom value of MB_targ)))
          • Unit - Cause (Triggering unit) to damage MB_targ, dealing 200.00 damage of attack type Normal and damage type Normal
          • Set MB_TempPoint = (Position of MB_targ)
          • Set MB_TmpGroup = (Units within 350.00 of MB_TempPoint)
          • Unit Group - Pick every unit in MB_TmpGroup 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) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
                  • ((Picked unit) is dead) Equal to False
                  • ((Picked unit) is in MB_alltargs) Equal to False
                • Then - Actions
                  • Set MB_targ = (Picked unit)
                • Else - Actions
                  • Set MB_targ = No unit
          • Custom script: call RemoveLocation(udg_MB_TempPoint)
          • Custom script: call DestroyGroup(udg_MB_TmpGroup)
      • Unit Group - Remove all units from MB_alltargs
      • Game - Display to (All players) the text: ==============
There you go.
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
Error occured because you were picking all units in group instead of chosing just one and refer action to that one only.
Here is your fixed map, don't use waits and spell isn't MUI. If you will have problems with making it MUI make sure you tell me that.
 

Attachments

  • Chain test.w3x
    21 KB · Views: 67
Level 7
Joined
Jul 20, 2009
Messages
295
The map you gave me still bugs. =/
At lvl 3 of the ability, when i cast, sometimes it hits 6 sometimes it hits 3 or 2, also the
  • Game - Display to (All players) the text: ==========
Doesn't show =/

These are the triggers:
  • Chain Mana Burn
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Mana Burn
    • Actions
      • Set MB_prev = (Triggering unit)
      • Set MB_targ = (Target unit of ability being cast)
      • Set MB_level = (Level of Chain Mana Burn for (Triggering unit))
      • Set MB_targetsnum = (2 + MB_level)
      • Unit Group - Add MB_targ to MB_alltargs
      • Unit - Cause (Triggering unit) to damage MB_targ, dealing 200.00 damage of attack type Normal and damage type Normal
      • Set MB_TempPoint = (Position of MB_targ)
      • Special Effect - Create a special effect at MB_TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_MB_TempPoint)
      • Trigger - Turn on Loop <gen>
      • Game - Display to (All players) the text: (String((Custom value of MB_targ)))
  • Loop
    • Events
      • Time - Every 0.35 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MB_targetsnum Greater than 0
        • Then - Actions
          • Set MB_TempPoint = (Position of MB_targ)
          • Set MB_TempGroup = (Units within 500.00 of MB_TempPoint matching (((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Not equal to True) and (((Matching unit) belongs to an enemy of (Owner of MB_prev)) Equal to True))) and (((Matching unit) is in
          • Custom script: call RemoveLocation(udg_MB_TempPoint)
          • Set MB_targ = (Random unit from MB_TempGroup)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MB_targ Not equal to No unit
            • Then - Actions
              • Game - Display to (All players) the text: (String((Custom value of MB_targ)))
              • Set MB_TempPoint = (Position of MB_targ)
              • Unit - Cause MB_prev to damage MB_targ, dealing 200.00 damage of attack type Normal and damage type Normal
              • Unit Group - Add MB_targ to MB_alltargs
              • Special Effect - Create a special effect at MB_TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set MB_targetsnum = (MB_targetsnum - 1)
              • Custom script: call RemoveLocation(udg_MB_TempPoint)
            • Else - Actions
              • Set MB_targetsnum = 0
              • Game - Display to (All players) the text: ==========
              • Unit Group - Remove all units from MB_alltargs
              • Trigger - Turn off (This trigger)
        • Else - Actions
The spell is supposed to hit a max of 5 at level 3. and not random numbers =/
 

Attachments

  • Chain test2.w3x
    21.1 KB · Views: 34
Level 7
Joined
Jul 20, 2009
Messages
295
I wouldn't mind if you do it, but I can try doing it myself, if it wont work, I'll ask for your help :D

Edit:
Ok, this is what I did to make it MUI:
  • Chain Mana Burn
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Mana Burn
    • Actions
      • Set MB_Caster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Set MB_Target[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
      • Set MB_Level[(Player number of (Owner of (Triggering unit)))] = (Level of Chain Mana Burn for (Triggering unit))
      • Set MB_TargetNumber[(Player number of (Owner of (Triggering unit)))] = (2 + MB_Level[(Player number of (Owner of (Triggering unit)))])
      • Trigger - Turn on Loop <gen>
  • Loop
    • Events
      • Time - Every 0.75 seconds of game time
    • Conditions
    • Actions
      • For each (Integer IntegerLightning) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MB_TargetNumber[IntegerLightning] Greater than 0
            • Then - Actions
              • Unit Group - Add MB_Target[IntegerLightning] to MB_AllTargets[IntegerLightning]
              • Unit - Cause MB_Caster[IntegerLightning] to damage MB_Target[IntegerLightning], dealing 200.00 damage of attack type Normal and damage type Normal
              • Game - Display to (All players) the text: (String((Custom value of MB_Target[IntegerLightning])))
              • Set MB_TempPoint = (Position of MB_Target[IntegerLightning])
              • Special Effect - Create a special effect at MB_TempPoint using Abilities\Weapons\Bolt\BoltImpact.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set MB_TargetNumber[IntegerLightning] = (MB_TargetNumber[IntegerLightning] - 1)
              • Set MB_TempGroup = (Units within 500.00 of MB_TempPoint matching (((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Not equal to True) and (((Matching unit) belongs to an enemy of (Owner of MB_Caster[IntegerLightning])) Equal to True))) and (((M
              • Set MB_Target[IntegerLightning] = (Random unit from MB_TempGroup)
              • Custom script: call RemoveLocation(udg_MB_TempPoint)
              • Custom script: call DestroyGroup(udg_MB_TempGroup)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MB_Target[IntegerLightning] Equal to No unit
                • Then - Actions
                  • Set MB_TargetNumber[IntegerLightning] = 0
                  • Unit Group - Remove all units from MB_AllTargets[IntegerLightning]
                  • Game - Display to (All players) the text: ==========
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MB_TargetNumber[1] Equal to 0
                      • MB_TargetNumber[2] Equal to 0
                      • MB_TargetNumber[3] Equal to 0
                      • MB_TargetNumber[4] Equal to 0
                      • MB_TargetNumber[5] Equal to 0
                      • MB_TargetNumber[6] Equal to 0
                      • MB_TargetNumber[7] Equal to 0
                      • MB_TargetNumber[8] Equal to 0
                      • MB_TargetNumber[9] Equal to 0
                      • MB_TargetNumber[10] Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
            • Else - Actions
              • Unit Group - Remove all units from MB_AllTargets[IntegerLightning]
              • Game - Display to (All players) the text: ==========
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MB_TargetNumber[1] Equal to 0
                  • MB_TargetNumber[2] Equal to 0
                  • MB_TargetNumber[3] Equal to 0
                  • MB_TargetNumber[4] Equal to 0
                  • MB_TargetNumber[5] Equal to 0
                  • MB_TargetNumber[6] Equal to 0
                  • MB_TargetNumber[7] Equal to 0
                  • MB_TargetNumber[8] Equal to 0
                  • MB_TargetNumber[9] Equal to 0
                  • MB_TargetNumber[10] Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
Though, when I cast in-game, messages appears like this:

(Custom Value)
==========
==========
==========
==========
==========
==========
========== (9x Times)
(Custom Value)
========== (9x Times)

and so on... does my triggers not make the spell less efficient and/or buggy? As in, making the trigger run many times even if it is not needed. If so, help me improve it. Also, these messages are there just for testing, they'll be removed when this is made into a fully perfect MUI.
 

Attachments

  • Chain test3.w3x
    21.5 KB · Views: 23
Last edited:
Status
Not open for further replies.
Top