need the right trigger (help)

MissKerrigan

Active Member
Reaction score
23
Hello,

There are 20 enemy units in the level (excluding your unit)

When your unit dies:

- all enemy units must removed from the level (20 units will be created when the level starts)
- a text message should appear with the text 'Failed'

When your unit enters the region 'Finish:

- all enemy units must removed from the level (20 units will be created when the level starts)
- a text message should appear with the text 'Concratiolations'

I tried to create 2 triggers, but only ONE trigger should create the 'text tag failed' and ONE trigger should create the text 'Concratiolations'
Which trigger action can I use to remove the enemy units? and do I have to create this action in both triggers?

What is the easiest way to create this?

MissKerrigan
 

Dave312

Censored for your safe viewing
Reaction score
269
Trigger for when the unit dies:
Trigger:
  • Failed
    • Events
      • Unit - [Your_Hero] dies
    • Local Variables
    • Conditions
    • Actions
      • UI - Display "Failed!" for (All players) to Subtitle area
      • Unit Group - Pick each unit in [Level_Units] and do (Actions)
        • Actions
          • Unit - Remove (Picked unit) from the game

Trigger for when the unit enters the finish region:
Trigger:
  • Completed
    • Events
      • Unit - [Your_Hero] Enters Finish
    • Local Variables
    • Conditions
    • Actions
      • UI - Display "Congratulations!" for (All players) to Subtitle area
      • Unit Group - Pick each unit in [Level_Units] and do (Actions)
        • Actions
          • Unit - Remove (Picked unit) from the game


[Level_Units] is a Unit Group variable which contains all 20 enemy units in the level. I think I remember reading something in another thread where you had set this up already.
 

MissKerrigan

Active Member
Reaction score
23
Thanks for your example Dave but did you actually tried it?

Pick each unit from 'level 1 unit' does work, but when I try to remove picked units it's not working at all. Well actually it works but for some reason the unit are NOT removing all in the same time, they are only removing 1 by 1 every 2 seconds, dunno why

So this screws my next attempt if this is without 40 seconds (20 x 2 seconds = 40 seconds)

Because if I start my level again, there are still some units of the last created unit group which are not removed yet, + the new units which are created will be added in the unit group (maybe they even would be removed by the trigger action of the last attempt. omg I explain this really stupid, hope that 1 of you get it


Also the text message should only displayed for the player of which unit has been killed, this seems also impossible, I can select 'triggering player' but nothing is happening
 

X-maul

AKA: Demtrod
Reaction score
201
What you should do is to have a [Level_Units] variable with the array size of [the amount of levels in the map] and a variable named [Current_Level]" this variable will be changed each round so your computer keeps track of what level it is. Then every time your create the new wave of units you just add them to [Level_Unit[Current_Level]].

If this does not make sense to you, tell me and I'll elaborate.
 

Dave312

Censored for your safe viewing
Reaction score
269
Have you got a wait action in the "Pick Units In Group" Loop? It should be removing all units at the same time.

Triggering player is the player who owns the unit that did the event (either died or entered the Finish region) so that should work. I'm not sure why it won't work.
 

MissKerrigan

Active Member
Reaction score
23
I made it quitte simple:

event 'playing unit level 1' (variable-type-unit) dies
condition
action pick each unit in unit group 'level 1'
action wait 1.0 game seconds
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'
action remove 1 unit from unit group 'level 1'

(20 times)

Only 1 unit is removed from the unit group and since I CANNOT find any action which removes ALL units from the unit group I tried to make 20 actions but it's not working sigh...
 

Dave312

Censored for your safe viewing
Reaction score
269
Why do you have a wait? That was why it was only removing 1 unit every second. Delete that and go back to what you had before and it will work fine.

Also the Remove Unit From Unit Group action does not remove a unit from the game. You need to use the Remove Unit action.
 

X-maul

AKA: Demtrod
Reaction score
201
When you use the "Pick Units In Group" loop, it does an action for every unit in the unit group, so if the unit group have 20 units in it, it will run the actions 20 times. When you are working with the "Pick Units In Group" you can use the "Picked Unit" to refer to the unit currently being handled in the loop, so if you want to remove all units in the unit group you set up a "Pick Units In Group" and the action inside it will be "Unit - Remove (Picked unit) from the game" (just as Dave said it)
 

MissKerrigan

Active Member
Reaction score
23
The reason why I create a wait of 1 sec (Dave) is because I am sure then the unit group will be picket FIRST and after that the units disappear

I remember I tried already the trigger without the wait, but only 1 unit was removed, hmm I will try it again
 

Phubar

Ultra Cool Member
Reaction score
30
Do you have found the solution?

If not i will try to explain how "pick every unit" works... The action is a loop (it means that for every unit it does all the actions in the list ie: for the first unit it does action , action2, action3 then fore the second unit it does action again action1, action2, action3 then for the third unit it does action again action1, action2, action3 and so on) and it doesnt select all the units at the same time and then it does actions (thet can be also actions that dont involve the unit or thet involve deleting the unit)
The "pick unit" is not a separated action and its purpose is to specify wich uints will be picked in the loop (but only one unit at time).

Try to think having 20 minatures on yuor table, 15 red and 5 blue.You recive the task to "pick" every unit in the group "units that are blue" and do 3 actions : say "hello!", throw the miniature on the ground and turn around. So you will say "hello!" then grab a blue miniature and throw it to the ground then tourn around. Then there will be 4 blue units on the able and you will say "hello!"then grab a blue miniature and throw it to the ground then tourn around. and so on until you have done these 3 action for evey blue miniature.

So your trigger will be

action pick each unit in unit group 'level 1' and do actions
-- remove picked unit from the game

I hope my post will be usefull :)

PS: remove from group does not remove the unit from the game like Dave said but it only cancels the unit from the list of units that are in a specific group. Like in your phone book or the contact list of your IM. You can organize your contact in severals lists (Units groups) and removing a name from the list doesnt remove the contact from your sim (the whole game map) but only from the specific list.

PPS: correct me if i was wrong.
 

Phubar

Ultra Cool Member
Reaction score
30
Miniatures are the small "statues" used in boerd or table games.
But for my example you can use any object you want :D
 
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
    +2
  • 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