Unit - Unhide (Random unit from (Units of type Mole))
Wait 10.00 seconds
Set Unhidden = No unit
Unit - Hide No unit
Basically, what I'm trying to do is set the unit variable Unhidden to the last unhidden unit. I'm making a map called Whack-A-Mole, and what I'm aiming for is a different spawn rate for each level. So basically what I'm doing is keeping 1 mole in every hole all the time, only the ones that aren't being used are hidden with the 'Unit - Hide' action. Every so often, a random Mole is Unhidden and waits to be whacked. But I need to make it so that if you don't attack the mole within, say for example, 5 seconds, then they become hidden again. Only problem is, there's no 'Last Unhidden Unit' option. Also just so you know, to keep from running out of moles, every time a mole is killed, another is spawned in the spot of the dying one and instantly hidden. Is there any way I can get a trigger to do what I need?
Use the Unit - Set Custom Value action to set the custom value of each mole to something different from the others. Like 1(mole1), 2(mole2), 3 etc. Then you open your Unhidden variable and check the array box. And in the Set Variable action you set the "[Index]" (that shows up after the variable name) to custom value of (Random unit from (units of type Mole))
Now create the action Unit - Unhide Unhidden[random number between 1 and (whatever number of moles you have)]
Set Unhidden[(Custom value of (Random unit from (Units of type Mole)))] = No unit
Sorry but I think you forgot to specify what I put where it says 'No unit'. Also, this only unhides them. I can do that easily. What I'm looking for is a trigger that re-hides the exact one(s) that were just unhidden after a certain amount of time and not some random other one(s).
Set Unhidden[(Custom value of (Random unit from (Units of type Mole)))] = No unit
Sorry but I think you forgot to specify what I put where it says 'No unit'. Also, this only unhides them. I can do that easily. What I'm looking for is a trigger that re-hides the exact one(s) that were just unhidden after a certain amount of time and not some random other one(s).
You need a trigger that unhides a random Mole unit.
You need a trigger that hides a random Mole unit.
And a trigger that keeps track of which Mole is hidden/unhidden.
How does the map work? What do you want the trigger to do? How do the moles spawn? Do they spawn in hidden? Etc. Seriously.
I already specified what I'm trying to do; keep the moles hidden with the Unit - Hide action when they are not in use. I already have a trigger that unhides them, I only need to add on to that trigger in a way that it hides the same unit(s) if it is not attacked within an amount of time.
How does the map work?
- Depending on the difficulty of the level, a random mole will spawn in one of the 48 holes (24 for each team). When the mole spawns, you attack it to whack it. What do I want the trigger to do?
- Keep track of which mole(s) has just been unhidden so it can rehide it within a certain amount of time if it remains alive. How do the moles spawn?
- When a mole is killed, a trigger creates one in the same spot that it died and instantly hides it. Another trigger randomly unhides one every so often.
I hope that's enough information. If any more is needed, just ask. I've also posted the map so if you like, you can take a look at the triggers and stuff yourself.
🔨 Hive's 3D Viewer has been updated! 🔨 It now supports MDX1100 which should fix a lot of issues when viewing HD models in our 3D Viewer. We encourage you to check it out for yourself and report any issues you find in the Site Discussion board.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.