Help to fix a spell trigger?

Warplord

Cool Member
Reaction score
0
Ok, hello guys.
I want to make a spell that basically creates a boulder that moves forward and can only hit a unit ONCE for (75 x Lvl of ability) damage.

Here are my triggers:

cast

Rolling Bouldr Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Rolling Boulder
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RB_Index Equal to 0
Then - Actions
Trigger - Turn on Rolling Bouldr Loop <gen>
Else - Actions
Set RB_Index = (RB_Index + 1)
Set RB_MUI = (RB_MUI + 1)
Set RB_check[RB_MUI] = True
Set TempLoc[1] = (Position of (Casting unit))
Set TempLoc[2] = (Target point of ability being cast)
Set RB_Angle[RB_MUI] = (Angle from TempLoc[1] to TempLoc[2])
Set TempLoc[3] = (TempLoc[1] offset by 17.00 towards RB_Angle[RB_MUI] degrees)
Unit - Create 1 Spell Dummy for (Owner of (Casting unit)) at TempLoc[1] facing RB_Angle[RB_MUI] degrees
Animation - Change (Last created unit)'s size to (350.00%, 350.00%, 350.00%) of its original size
Animation - Change (Last created unit)'s animation speed to 65.00% of its original speed
Special Effect - Create a special effect attached to the origin of (Last created unit) using abilities\weapons\catapult\catapultmissile.mdl
Set RB_Boulder[RB_MUI] = (Last created unit)
Set RB_Distance[RB_MUI] = 800.00
Set RB_Distance_Traveled[RB_MUI] = 0.00
Set RB_Speed[RB_MUI] = 6.20
Set RB_AlreadyHit[RB_MUI] = RB_AlreadyHit[RB_MUI]
Set RB_Damage[RB_MUI] = (75.00 x (Real((Level of Rolling Boulder for (Casting unit)))))
Custom script: call RemoveLocation(udg_TempLoc[1])
Custom script: call RemoveLocation(udg_TempLoc[2])
Custom script: call RemoveLocation(udg_TempLoc[3])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Binding Slam for (Casting unit)) Greater than 0
Then - Actions
Set BS_Level = (Level of Binding Slam for (Casting unit))
Set TempLoc[1] = (Position of (Casting unit))
Unit - Create 1 Spell Dummy for (Owner of (Casting unit)) at TempLoc[1] facing Default building facing degrees
Unit - Add dummy_BS_clap to (Last created unit)
Unit - Set level of dummy_BS_clap for (Last created unit) to BS_Level
Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_TempLoc[1])
Else - Actions



loop

Rolling Bouldr Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer RB_loop) from 1 to RB_MUI, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RB_check[RB_loop] Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RB_Distance_Traveled[RB_loop] Less than RB_Distance[RB_MUI]
Then - Actions
Set TempLoc[1] = (Position of RB_Boulder[RB_loop])
Set TempLoc[2] = (TempLoc[1] offset by RB_Speed[RB_loop] towards RB_Angle[RB_loop] degrees)
Unit - Move RB_Boulder[RB_loop] instantly to TempLoc[2]
Special Effect - Create a special effect at TempLoc[1] using Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
Special Effect - Destroy (Last created special effect)
Set RB_Distance_Traveled[RB_loop] = (RB_Distance_Traveled[RB_loop] + RB_Speed[RB_loop])
Set TempGroup[1] = (Units within 45.00 of TempLoc[2] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of RB_Boulder[RB_loop])) Equal to True) and (((Matching unit) is
Unit Group - Pick every unit in TempGroup[1] and do (Actions)
Loop - Actions
Unit - Cause RB_Boulder[RB_loop] to damage (Picked unit), dealing RB_Damage[RB_loop] damage of attack type Spells and damage type Universal
Unit Group - Add (Picked unit) to RB_AlreadyHit[RB_loop]
Unit Group - Remove all units from TempGroup[1]
Custom script: call DestroyGroup(udg_TempGroup[1])
Custom script: call RemoveLocation(udg_TempLoc[1])
Custom script: call RemoveLocation(udg_TempLoc[2])
Else - Actions
Set TempLoc[1] = (Position of RB_Boulder[RB_loop])
Unit - Kill RB_Boulder[RB_loop]
Unit - Remove RB_Boulder[RB_loop] from the game
Special Effect - Create a special effect at TempLoc[1] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
Special Effect - Destroy (Last created special effect)
-------- -------------------- --------
Set RB_Index = (RB_Index - 1)
-------- -------------------- --------
Set RB_Boulder[RB_loop] = No unit
Set RB_Angle[RB_loop] = 0.00
Set RB_Distance[RB_loop] = 0.00
Set RB_Distance_Traveled[RB_loop] = 0.00
Set RB_Speed[RB_loop] = 0.00
Set RB_Damage[RB_loop] = 0.00
Unit Group - Remove all units from RB_AlreadyHit[RB_loop]
Custom script: call DestroyGroup(udg_RB_AlreadyHit[udg_RB_loop])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RB_Index Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Set RB_MUI = 0
Else - Actions
Else - Actions



Ecerything seemed to work fine with moving and the spells looks MUI etc but the damage is applied every 0.03 seconds inspite of my check for unit is in group "AlreadyHit". Any idea where I was wrong? And also if u find any wrong or not good parts of the spell - pls infor me!

Ty very much :)

P.S
Apparently I cant make it look like GUI, if anyone knows how to - pls say so and I will.
 

thorhunter

You can change this now in User CP.
Reaction score
32
Use [<wc3>] tags (without <>)

Code:
Set RB_AlreadyHit[RB_MUI] = RB_AlreadyHit[RB_MUI]
Code:
Custom script: call DestroyGroup(udg_RB_AlreadyHit[udg_RB_loop])

From what I see, these two don't corespond. You should use 'empty group' or something when initializing the group.

Also:
Code:
Set TempGroup[1] = (Units within 45.00 of TempLoc[2] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of RB_Boulder[RB_loop])) Equal to True) and (((Matching unit) is

Some of this lane is missing, perhaps it would be easier for you to cut some of these requirements and put the rest in the 'If/then/else statement'.[/wc3]
 

Warplord

Cool Member
Reaction score
0
1. you are right.
Set RB_AlreadyHit[RB_MUI] = RB_AlreadyHit[RB_MUI]
This line is illogical and not right, Ijust don't find a preset value of "Empty group" or something like that? What should I use ?

2. The line cheks 4 things:
unit dead = false
unit building = false
unit enemy = true
unit is in RB_AlreadyHit = false

Any idea how to make the loop trigger 'read' the correct group or something?
 

thorhunter

You can change this now in User CP.
Reaction score
32
Another faulty line:
Code:
RB_Distance_Traveled[RB_loop] Less than RB_Distance[RB_MUI]

From what I remember you could possibly use UnitGroup->convert unit to unit group-> no unit, but if there's no empty group preset I'm not sure whether it would work. Theoretically it should, since there is 'Unit group is empty' boolean check.
 

Warplord

Cool Member
Reaction score
0
I do not hink there is such an option in the Set variable line. I know it exists but it is not there. Perhaps "= Last created unit group should work" OR something? :(
 

Imp Midna

Active Member
Reaction score
52
Preset would be pointless because if you use destroy group on a variable using the preset, the preset would be dead. There is no "create new unitgroup" in gui because there also is no "destroy unit group" in guy, and this function would do nothing but leak unless you use destroy unitgroup somewhere, which requires custom script, and if you use custom script to destroy it, you could just as well use custom script to create a new empty one.
In words:
Trigger:
  • Custom Script: set udg_RB_AllreadyHit[RB_MUI] = CreateGroup() //&lt;--- new empty group


Oc, thinking about how you destroy it and then create a new empty group, you might as well ask yourself if simply clearing the unit group would do the same work. (i must confess i didnt look into your triggers so i dont know)

edit:
"P.S
Apparently I cant make it look like GUI, if anyone knows how to - pls say so and I will."

waiting ^.^
note: go in the "More Options" part first, THEN paste your trigger between the wc3 tags. Else, shit will happen.
 

thorhunter

You can change this now in User CP.
Reaction score
32
He's not destroying the group using preset, he destroys it then presets.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top