Help please

Ratata

Member
Reaction score
0
This might be a noob question but i'm having a problem,how do i make a builder(for example a peasent) disappear after building a structure?
 

O.A

Quantum physics rules
Reaction score
29
This is probably the easiest way, since i don't think there is an Event Response for the constructing unit;

Trigger:
  • Remove Peasant example
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Town Hall
        • Then - Actions
          • Unit - Remove (Random unit from (Units within 300.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Peasant))) from the game
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Barracks
            • Then - Actions
              • Unit - Remove (Random unit from (Units within 240.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Peasant))) from the game
            • Else - Actions
              • Unit - Remove (Random unit from (Units within 140.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Peasant))) from the game


This is not optimal, as there is a degree of randomness in it, but it shouldn't cause too much trouble, after all, it only removes the type of worker you choose. If many peasants are building the structure, one of them will be removed (and usually it's the one building, because of how the workers are set up near the building). The different ranges are just because some buildings are bigger, and you don't want to have too big of a range when not needed. That could result in a Peasant running by being removed. You can play around with ranges some more, and add buildings to that list, if you need to.
 

Ratata

Member
Reaction score
0
Thanks ,for instance im making my own map and i meant like wisps to morph into buildings
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
It should be noted that the triggers above leak heavily. Each of those calls leak a point and a unit group.
 

Ratata

Member
Reaction score
0
Hmm well myb its not what i wanted,i want for like them to melt with the building kinda like wisps do
 

O.A

Quantum physics rules
Reaction score
29
Right, i thought you just wanted the workers to disappear for some reason. Maybe for what you want a better solution would be;

Trigger:
  • Remove Peasant example
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Unit - Remove (Random unit from (Units within 150.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Peasant undead))) from the game


Just make whatever worker you use to be Undead (in Object manager, race), so the building will finish itself after the worker is removed. Then you can add perhaps your own special effects to make it look better.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
Have you tried giving the building the Ancient classification?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Worker has to be of the nightelven race and the building needs to be an ancient.
 

O.A

Quantum physics rules
Reaction score
29
If you set the Wisp's race to Undead, the classification of the building does not matter, however it might cause some unwanted complications, like healing related (holy light etc.). If the Wisp's race is default, Night Elf, then the building classification has to be ancient, or the Wisp will remain behind, and will not be removed.
 
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