Trigger Error

Mind

New Member
Reaction score
7
What is wrong with this trigger?

Code:
Major Forces Self Defense
    Events
        Unit - A unit Is attacked
    Conditions
        (((Owner of (Triggering unit)) slot status) Not equal to Is playing) or (((Owner of (Triggering unit)) controller) Not equal to User)
    Actions
        Player - Make (Owner of (Triggering unit)) treat (Owner of (Attacking unit)) as an Enemy
        Player - Make (Owner of (Attacking unit)) treat (Owner of (Triggering unit)) as an Enemy
        If ((((Triggering unit) is A structure) Equal to True) and ((Owner of (Triggering unit)) Equal to CitysDefenses)) then do (Unit Group - Pick every unit in CityDefensesUnitGroup and do (Unit - Order (Picked unit) to Attack (Attacking unit))) else do (Do nothing)
        If ((((Triggering unit) is A structure) Equal to True) and ((Owner of (Triggering unit)) Equal to Insurgents)) then do (Unit Group - Pick every unit in InsurgentsUnitGroup and do (Unit - Order (Picked unit) to Attack (Attacking unit))) else do (Do nothing)
        If ((((Triggering unit) is A structure) Equal to True) and ((Owner of (Triggering unit)) Equal to UndeadScourge)) then do (Unit Group - Pick every unit in UndeadScourgeUnitGroup and do (Unit - Order (Picked unit) to Attack (Attacking unit))) else do (Do nothing)
        Trigger - Turn off (This trigger)
        Wait 20.00 seconds
        Trigger - Turn on (This trigger)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
It isn't working?


Here's a couple random thoughts:
  • "A unit is attacked" happens way too often.
  • The alliance never switches back to what it was before.
  • If "attacking unit" is dead or invulnerable before the "reinforcements" are sent, they will never arrive...
  • Always wait for "game" seconds (or so they say)
  • Can't you test for "controller = computer"?
  • Is "triggering unit" = "attacked unit"?
  • Use multi-line "if then"s :)
  • Could it happen that the CityDefenses suddenly start attacking the Undead?


HTH
AceHart
 

Mind

New Member
Reaction score
7
[*]"A unit is attacked" happens way too often.


The trigger has a cooldown of 20 seconds.

[*]The alliance never switches back to what it was before.


It is not supposed to.

[*]If "attacking unit" is dead or invulnerable before the "reinforcements" are sent, they will never arrive...


Sounds interesting… What do you suppose I do? Use the "Move" command instead?

[*]Can't you test for "controller = computer"?


What do you mean?

[*]Is "triggering unit" = "attacked unit"?


Precisely.

[*]Use multi-line "if then"s :)


There was only 1 trigger action.

[*]Could it happen that the CityDefenses suddenly start attacking the Undead?


They are supposed to.

Notice: The trigger is evaluated correctly, but only partially executed; The unit group doesn't attack the attacked unit.
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
quote:
--------------------------------------------------------------------------------
[*]If "attacking unit" is dead or invulnerable before the "reinforcements" are sent, they will never arrive...
--------------------------------------------------------------------------------



Sounds interesting… What do you suppose I do? Use the "Move" command instead?

You can stop thsi by setting the unit into a variable so it won't interfere. That's what I did for one of my spells to cancel it out when the hero casted another ability while the skill was taking place.
 

Mind

New Member
Reaction score
7
Is this trigger action sufficient enough?

Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        ((Triggering unit) is A structure) Equal to True
    Then - Actions
        If ((Owner of (Attacked unit)) Equal to CitysDefenses) then do (Unit Group - Pick every unit in CityDefensesUnitGroup and do (Unit - Order (Picked unit) to Attack-Move To (Position of (Attacking unit)))) else do (Do nothing)
        If ((Owner of (Attacked unit)) Equal to Insurgents) then do (Unit Group - Pick every unit in InsurgentsUnitGroup and do (Unit - Order (Picked unit) to Attack-Move To (Position of (Attacking unit)))) else do (Do nothing)
        If ((Owner of (Attacked unit)) Equal to UndeadScourge) then do (Unit Group - Pick every unit in UndeadScourgeUnitGroup and do (Unit - Order (Picked unit) to Attack-Move To (Position of (Attacking unit)))) else do (Do nothing)
    Else - Actions
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
Wait, your structures can move? The condition is triggered to structures only. Unless, of course I'm missing something.
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
Yes but it sais to order the attacked unit to move to the position of the attacking unit. SO it would order the structure which is attacked to mvoe to the position of the attacked unit.
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
O wait, I missed that, it orders every single unit to attack move to the position of the attacking unit when the structure is hit. Whoops looked at that wrong. I don't see anything wrong with it. Your first trigger on the first psot looked a little odd though.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
May I suggest to change "Position of (Attacking unit)" to
"Position of (Attacked unit)"?
Cosmetics, mostly. But looks "cleaner" to me ;)

Positional attack is definetly better.
When you attack something by hand (select unit/s, attack, click on target),
and, unfortunately, said target is invulnerable,
you'll get something like "Sorry, can't do that"...
Well, for comps this means that the order will simply be ignored!
Attack-move to "there" looks much better, indeed.

Testing only once for "is a structure" is a good idea too...
It won't help gameplay, but it helps me for reading this :)


Well, and? Still not working?




[*]"A unit is attacked" happens way too often.

I have several towers that do this in my TD, and it doesn't seem to cause any problems or lag.

Interesting. Good to know :)


Yours
AceHart
 

Mind

New Member
Reaction score
7
It hasn't changed much…

Code:
Major Forces Self Defense
    Events
        Unit - A unit Is attacked
    Conditions
        ((Owner of (Triggering unit)) Equal to CitysDefenses) or (((Owner of (Triggering unit)) Equal to Insurgents) or ((Owner of (Triggering unit)) Equal to UndeadScourge))
        (((Owner of (Triggering unit)) slot status) Not equal to Is playing) or (((Owner of (Triggering unit)) controller) Not equal to User)
    Actions
        Player - Make (Owner of (Triggering unit)) treat (Owner of (Attacking unit)) as an Enemy
        Player - Make (Owner of (Attacking unit)) treat (Owner of (Triggering unit)) as an Enemy
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Attacked unit) is A structure) Equal to True
            Then - Actions
                If ((Owner of (Attacked unit)) Equal to Insurgents) then do (Unit Group - Pick every unit in InsurgentsUnitGroup and do (Unit - Order (Picked unit) to Attack (Attacking unit))) else do (Do nothing)
                If ((Owner of (Attacked unit)) Equal to CitysDefenses) then do (Unit Group - Pick every unit in CityDefensesUnitGroup and do (Unit - Order (Picked unit) to Attack (Attacking unit))) else do (Do nothing)
                If ((Owner of (Attacked unit)) Equal to UndeadScourge) then do (Unit Group - Pick every unit in UndeadScourgeUnitGroup and do (Unit - Order (Picked unit) to Attack (Attacking unit))) else do (Do nothing)
                Trigger - Turn off (This trigger)
                Wait 20.00 seconds
                Trigger - Turn on (This trigger)
            Else - Actions
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Well, it still says "attack (attacking unit)"...

What exactly is happening?
They don't come at all?
Only half of them ?
Half way only then they turn back?
They come but don't attack?
They come, attack once then return?

You do, of course, have shared vision with them to see this?


Yours
AceHart
 

Mind

New Member
Reaction score
7
They eventually stop hunting the unit which attempted to demolish one of their structures.

I've found why they did; The base of the owner of the attacked unit was attacked by another foe while the unit who attacked the structure, who I controlled, fled.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • 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
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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