Chain-Linked towers spells glitchy, need help

Cal1991

New Member
Reaction score
7
I made a spell that is supposed to work as follows:

The hero gets 2 abilitys, one to place a power generator and one to place a tower.

A power generator can be placed anywere, but when you place one it gets rid of your old network of towers.

A tower can only be placed within linking distance of a generator or another tower. If a tower or a generator dies, the entire network of towers dies.

when a tower is placed, it creates a link to any towers or generators nearby. the link is like an electirc fence, anyone that touches it get zapped.

This is what I have so far:
(it is all done in GUI, I know how to use basic jass but GUI is 100x easier for me to work with)

Trigger1:
Code:
Ability add
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Special Balnazzar - Rain Of Chaos
    Actions
        Unit - Add Create Power Generator (Neutral Hostile) to (Triggering unit)

Trigger2:
Code:
Power generator
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Create Power Generator (Neutral Hostile)
    Actions
        Set Point = (Target point of ability being cast)
        Unit Group - Pick every unit in ChainTower[(Player number of (Owner of (Triggering unit)))] and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
                Unit Group - Remove (Picked unit) from ChainTower[(Player number of (Owner of (Triggering unit)))]
        Unit Group - Pick every unit in Lightnings[(Player number of (Owner of (Triggering unit)))] and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
                Unit Group - Remove (Picked unit) from Lightnings[(Player number of (Owner of (Triggering unit)))]
        Unit - Create 1 Power Generator for (Owner of (Triggering unit)) at Point facing Default building facing degrees
        Unit Group - Add (Last created unit) to ChainTower[(Player number of (Owner of (Triggering unit)))]

Trigger3:
Code:
Chain tower start
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Chain-Link Towers (Balnazzar)
    Actions
        Set Point = (Target point of ability being cast)
        Set Unitgroup = (Units within (500.00 + (100.00 x (Real((Level of Chain-Link Towers (Balnazzar) for (Casting unit)))))) of Point)
        Set one = 0
        Unit Group - Pick every unit in ChainTower[(Player number of (Owner of (Casting unit)))] and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is in Unitgroup) Equal to True
                    Then - Actions
                        Set one = 1
                    Else - Actions
                        Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                one Equal to 0
            Then - Actions
                Set Point = (Position of (Triggering unit))
                Unit - Order (Triggering unit) to Move To Point
                Game - Display to (Player group((Owner of (Triggering unit)))) the text: Must connect to a P...
            Else - Actions
                Do nothing

trigger4:
Code:
Chain tower create
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chain-Link Towers (Balnazzar)
    Actions
        Set Point = (Target point of ability being cast)
        Unit - Create 1 Chain-Link Tower for (Owner of (Triggering unit)) at Point facing Default building facing degrees
        Unit Group - Add (Last created unit) to ChainTower[(Player number of (Owner of (Triggering unit)))]
        Set TempUnit = (Last created unit)
        Set Unitgroup = (Units within (500.00 + (100.00 x (Real((Level of Chain-Link Towers (Balnazzar) for (Casting unit)))))) of Point)
        Unit Group - Pick every unit in Unitgroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is in ChainTower[(Player number of (Owner of (Triggering unit)))]) Equal to True
                        (Picked unit) Not equal to TempUnit
                    Then - Actions
                        Unit Group - Add (Picked unit) to TempGroup
                    Else - Actions
                        Do nothing
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                Set Point = (Position of TempUnit)
                Set point2 = (Position of (Picked unit))
                Set Real[1] = (Angle from Point to point2)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Distance between Point and point2) Greater than 949.00
                    Then - Actions
                        Set PointArray[1] = (Point offset by 105.00 towards Real[1] degrees)
                        Set PointArray[2] = (Point offset by 210.00 towards Real[1] degrees)
                        Set PointArray[3] = (Point offset by 315.00 towards Real[1] degrees)
                        Set PointArray[4] = (Point offset by 420.00 towards Real[1] degrees)
                        Set PointArray[5] = (Point offset by 525.00 towards Real[1] degrees)
                        Set PointArray[6] = (Point offset by 630.00 towards Real[1] degrees)
                        Set PointArray[7] = (Point offset by 735.00 towards Real[1] degrees)
                        Set PointArray[8] = (Point offset by 840.00 towards Real[1] degrees)
                        Set PointArray[9] = (Point offset by 945.00 towards Real[1] degrees)
                        For each (Integer A) from 1 to 9, do (Actions)
                            Loop - Actions
                                Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Distance between Point and point2) Greater than 844.00
                            Then - Actions
                                Set PointArray[1] = (Point offset by 105.00 towards Real[1] degrees)
                                Set PointArray[2] = (Point offset by 210.00 towards Real[1] degrees)
                                Set PointArray[3] = (Point offset by 315.00 towards Real[1] degrees)
                                Set PointArray[4] = (Point offset by 420.00 towards Real[1] degrees)
                                Set PointArray[5] = (Point offset by 525.00 towards Real[1] degrees)
                                Set PointArray[6] = (Point offset by 630.00 towards Real[1] degrees)
                                Set PointArray[7] = (Point offset by 735.00 towards Real[1] degrees)
                                Set PointArray[8] = (Point offset by 840.00 towards Real[1] degrees)
                                For each (Integer A) from 1 to 8, do (Actions)
                                    Loop - Actions
                                        Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                        Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Distance between Point and point2) Greater than 739.00
                                    Then - Actions
                                        Set PointArray[1] = (Point offset by 105.00 towards Real[1] degrees)
                                        Set PointArray[2] = (Point offset by 210.00 towards Real[1] degrees)
                                        Set PointArray[3] = (Point offset by 315.00 towards Real[1] degrees)
                                        Set PointArray[4] = (Point offset by 420.00 towards Real[1] degrees)
                                        Set PointArray[5] = (Point offset by 525.00 towards Real[1] degrees)
                                        Set PointArray[6] = (Point offset by 630.00 towards Real[1] degrees)
                                        Set PointArray[7] = (Point offset by 735.00 towards Real[1] degrees)
                                        For each (Integer A) from 1 to 7, do (Actions)
                                            Loop - Actions
                                                Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                                Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Distance between Point and point2) Greater than 634.00
                                            Then - Actions
                                                Set PointArray[1] = (Point offset by 105.00 towards Real[1] degrees)
                                                Set PointArray[2] = (Point offset by 210.00 towards Real[1] degrees)
                                                Set PointArray[3] = (Point offset by 315.00 towards Real[1] degrees)
                                                Set PointArray[4] = (Point offset by 420.00 towards Real[1] degrees)
                                                Set PointArray[5] = (Point offset by 525.00 towards Real[1] degrees)
                                                Set PointArray[6] = (Point offset by 630.00 towards Real[1] degrees)
                                                For each (Integer A) from 1 to 6, do (Actions)
                                                    Loop - Actions
                                                        Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                                        Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (Distance between Point and point2) Greater than 529.00
                                                    Then - Actions
                                                        Set PointArray[1] = (Point offset by 105.00 towards Real[1] degrees)
                                                        Set PointArray[2] = (Point offset by 210.00 towards Real[1] degrees)
                                                        Set PointArray[3] = (Point offset by 315.00 towards Real[1] degrees)
                                                        Set PointArray[4] = (Point offset by 420.00 towards Real[1] degrees)
                                                        Set PointArray[5] = (Point offset by 525.00 towards Real[1] degrees)
                                                        For each (Integer A) from 1 to 5, do (Actions)
                                                            Loop - Actions
                                                                Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                                                Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                                                    Else - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                (Distance between Point and point2) Greater than 424.00
                                                            Then - Actions
                                                                Set PointArray[1] = (Point offset by 105.00 towards Real[1] degrees)
                                                                Set PointArray[2] = (Point offset by 210.00 towards Real[1] degrees)
                                                                Set PointArray[3] = (Point offset by 315.00 towards Real[1] degrees)
                                                                Set PointArray[4] = (Point offset by 420.00 towards Real[1] degrees)
                                                                For each (Integer A) from 1 to 4, do (Actions)
                                                                    Loop - Actions
                                                                        Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                                                        Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                                                            Else - Actions
                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                    If - Conditions
                                                                        (Distance between Point and point2) Greater than 319.00
                                                                    Then - Actions
                                                                        Set PointArray[1] = (Point offset by 105.00 towards Real[1] degrees)
                                                                        Set PointArray[2] = (Point offset by 210.00 towards Real[1] degrees)
                                                                        Set PointArray[3] = (Point offset by 315.00 towards Real[1] degrees)
                                                                        For each (Integer A) from 1 to 3, do (Actions)
                                                                            Loop - Actions
                                                                                Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                                                                Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                                                                    Else - Actions
                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                            If - Conditions
                                                                                (Distance between Point and point2) Greater than 214.00
                                                                            Then - Actions
                                                                                Set PointArray[1] = (Point offset by 105.00 towards Real[1] degrees)
                                                                                Set PointArray[2] = (Point offset by 210.00 towards Real[1] degrees)
                                                                                For each (Integer A) from 1 to 2, do (Actions)
                                                                                    Loop - Actions
                                                                                        Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                                                                        Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                                                                            Else - Actions
                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                    If - Conditions
                                                                                        (Distance between Point and point2) Greater than 109.00
                                                                                    Then - Actions
                                                                                        Set PointArray[1] = (Point offset by 105.00 towards Real[1] degrees)
                                                                                        For each (Integer A) from 1 to 1, do (Actions)
                                                                                            Loop - Actions
                                                                                                Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                                                                                Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                                                                                    Else - Actions
                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                            If - Conditions
                                                                                                (Distance between Point and point2) Greater than 39.00
                                                                                            Then - Actions
                                                                                                Set PointArray[1] = (Point offset by 20.00 towards Real[1] degrees)
                                                                                                For each (Integer A) from 1 to 1, do (Actions)
                                                                                                    Loop - Actions
                                                                                                        Unit - Create 1 Lightning Dummy for (Owner of TempUnit) at PointArray[(Integer A)] facing Default building facing degrees
                                                                                                        Unit Group - Add (Last created unit) to Lightnings[(Player number of (Owner of TempUnit))]
                                                                                            Else - Actions
                                                                                                Do nothing

trigger5:
Code:
Chain tower death
    Events
        Unit - A unit Dies
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Dying unit) is in ChainTower[(Integer A)]) Equal to True
                    Then - Actions
                        Unit Group - Pick every unit in ChainTower[(Player number of (Owner of (Triggering unit)))] and do (Actions)
                            Loop - Actions
                                Unit - Kill (Picked unit)
                                Unit Group - Remove (Picked unit) from ChainTower[(Player number of (Owner of (Triggering unit)))]
                        Unit Group - Pick every unit in Lightnings[(Player number of (Owner of (Triggering unit)))] and do (Actions)
                            Loop - Actions
                                Unit - Kill (Picked unit)
                                Unit Group - Remove (Picked unit) from Lightnings[(Player number of (Owner of (Triggering unit)))]
                    Else - Actions
                        Do nothing

If anyone can help with this, I'll give +rep.... I'm not that great with triggers, and I can't understand why it screws up.

Edit:
It does work sometimes, just not always.

I can post the map if you need it.
 

Cal1991

New Member
Reaction score
7
>It does work sometimes, just not always.

Then it leaks...? :rolleyes:

I am aware it leaks, that has nothing to do with my problem, though.
Leaks just make more lag, when they do anything.

The problems that sometimes acur are as follows:
-When you place a tower, it doesn't link to anything.
-When you place a tower, it only links to a few of the towers close enough, instead of all of them like it should.
-When you place a tower, it try to link to dead towers, even though they should be removed from the link group apon dying.
-When you place a tower, it trys to link to a tower that is too far away, and the plasma beam only reaches 3/4th of the way to the other tower.
 

Cal1991

New Member
Reaction score
7
Still flummoxed

I have been working on this spell for like a week myself, without managing to get it entirely working.

If no one has an idea why my way of triggering it is so buggy, can they suggest a better way?

Shall I upload the map for people to look at the spell?

I Need halp :confused:
 

Cal1991

New Member
Reaction score
7
Upload the map and I'll take a look at it.

Okay, thanks. I deleted all the custom models so it would be small enough to attach.

Oh, I almost forgot... I've been using the Newgen pack

I'm not sure how well you will be able to edit the map if you don't have newgen. If you don't have it, I would suggest trying it out. It's very reliable and helpful.
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
What on earth did you do to make the map totally unplayable? I can't play it at all.

Edit: Can't open it either.
 

Cal1991

New Member
Reaction score
7
What on earth did you do to make the map totally unplayable? I can't play it at all.

Edit: Can't open it either.

Oh, I almost forgot... I've been using the Newgen pack

I'm not sure how well you will be able to edit the map if you don't have newgen. If you don't have it, I would suggest trying it out. It's very reliable and helpful.

..


Anyway, it will work fine if you open it and test it without saving even if you don't have newgen. It's only if you save it that it screws up.

I can't think of any reason to not use newgen... but if you don't want to, I can remake the spell in a different map in normal editor.
 

Terrabull

Veteran Member (Done that)
Reaction score
38
I might be able to help you, but I'm to tired to make sense of your triggers tonight. Are all the triggers the same as up there? And is that add-on map still correct?
 

Cal1991

New Member
Reaction score
7
I might be able to help you, but I'm to tired to make sense of your triggers tonight. Are all the triggers the same as up there? And is that add-on map still correct?

Yes, and yes. Just download the add-on map and look at it, if you're willing to help. Thanks in advance.

Btw, nice icon. I had a bunch of little plastic guys that looked like that.
 
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