• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Unit Vanish after constructing bulding/Unit

Status
Not open for further replies.
Level 14
Joined
Jan 8, 2015
Messages
424
So i looked around found only 2 threads regarding it but the way they show trigger work is weird and i cannot make such trigger as they shown. Take a look a this one i need help and i'm stuck halfway in actions:
"EASY WAY

Event
Unit - A unit Finishes construction

Condition (if you only want to apply to some buildings, do that here)

Action
Set constructor = (Random unit from (Units within 120.00 of (Position of (Constructed structure)) matching ((Unit-type of (Matching unit)) Equal to Peasant)))
Unit - Remove constructor from the game
Unit - Kill constructor

Replace "Peasant" with whatever builds the building. You may need to change the "120" to a larger number depending on pathing. This trigger works by picking a random peasant near any finished building and killing it. It's imprecise and you may end up killing the wrong peasant unfortunately. That won't be a big deal unless the other peasant is constructing something. It will also only remove one peasant if you have multiple peasants building"

As i understand "Set" is for variable so i made it so, and i made Variable for unit group. However after i have no way of removing it. Unit - remove doesnt have option to remove that variable. ANd when i swap Variable to Unit instead of unit group, i cannot make this variable at all. Also this will work on unit constructing unit if we will get this to work?
 
Level 8
Joined
Jan 28, 2016
Messages
486
What your trying to do is quite difficult as you've probably discovered already. I've seen similar threads from not-too-long ago but I can't recall if they found a solution to their problem. I've got a solution that doesn't actually solve your problem but it's an alternative to make what you're after and doesn't require any triggering.

Alternative Solution
For each building that's meant to kill the worker, select it in the Object Editor, scroll down to Stat - Unit Classification and tick the Ancient checkbox. Now create your worker based on the Night Elf Wisp and add the building the structures built. For reasons I cannot explain, as long as the worker has its Stat - Race set to Night Elf it will be killed after building an Ancient-type structure. So don't touch that!
It might not be what you're looking for (I don't know how your map works) but it's something to think about while we wait for someone else to provide a better triggered solution. :p

You should also check this out: How to easily post triggers.
 
Level 14
Joined
Nov 30, 2013
Messages
926
Are you sure about setting the unit variable in a random unit?
It'll ends up picking the wrong constructor. There's no way in GUI or Jass I think to get the constructor unit.

I suggest you doing it so in Unit Group. Even it picked all the peasant besides to the structure, it still worked.
 
Last edited:
Level 14
Joined
Jan 8, 2015
Messages
424
I went with ancient thing silmutainuesly with posting that, cuz solution i posted here is from other thread and is impossible to set this way it presented. Tough Classification one is easiest, but i think trigger has more use if its regarding anything built by that unit. Also it's quoted from other thread. from 2009, and as i said i dont know how it is possible, it was just text, and i couldnt recreate it. For my purposes i just will stick with ancient classification, but as i said some peole may find it usefull to get that trigger working when they need that builder die no matter what he builds(no matter which race building/unit is)
 
Level 8
Joined
Jan 28, 2016
Messages
486
I went with ancient thing silmutainuesly with posting that, cuz solution i posted here is from other thread and is impossible to set this way it presented. Tough Classification one is easiest, but i think trigger has more use if its regarding anything built by that unit. Also it's quoted from other thread. from 2009, and as i said i dont know how it is possible, it was just text, and i couldnt recreate it. For my purposes i just will stick with ancient classification, but as i said some peole may find it usefull to get that trigger working when they need that builder die no matter what he builds(no matter which race building/unit is)

Ahh right I got it now. I found that other thread where you got that from! The solution isn't exactly a good way to go about it because of the randomness and a few other associated issues. As for the variable problem you had, when you set the unit variable and choose a unit from the list, there is an option under Matching Unit that reads Random unit from Unit Group which is what they used for the "Constructor" variable. As to whether this will work on the actually constructing unit... maybe but there would need to be conditions to make sure the trigger doesn't pick the wrong unit. Even then, it can still bug out.
 
Level 12
Joined
Nov 3, 2013
Messages
989
So you want to remove the builder after he begin building or is it when he complete the building?

Is it supposed to be orc, human, or undead type of building?

Depending on your answers I might have a couple of variations of a solution I've used in the past for something similar.
 
Level 14
Joined
Jan 8, 2015
Messages
424
So you want to remove the builder after he begin building or is it when he complete the building?

Is it supposed to be orc, human, or undead type of building?

Depending on your answers I might have a couple of variations of a solution I've used in the past for something similar.

Kinda when he completes. Tough ancient classfication done well enough. Meanwhile i think it may be useful if builder has wide array of stuff to build and isnt nessesarily made out of wisp
 
Status
Not open for further replies.
Top