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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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