• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Map with a timer?

Status
Not open for further replies.
Level 5
Joined
Dec 15, 2010
Messages
115
Hello all, I have (Almost) created my first map from scratch (I have mostly only edited Blizzard maps before), and it's a defense type map (Still needs a ton of balancing), I was thinking the goal should be Player 1 (Defender) needs to last X amount of time against the other players (Number of which is uncertain yet), any way to do this? Also is there any way to make the victory condition for the attackers to be destroying the main town hall (Instead of every building)?

I got the whole map done really (Just need to make the trees look less "block" like), and I also have finished all the custom units/buildings, mostly just trigger stuff left, which I suck it. Any advice/help on this would be greatly appreciated.
 
Level 10
Joined
Mar 16, 2009
Messages
354
To remove the old loss condition just delete the corresponding action from the melee initialization trigger


Open Trigger Editor
th_Unt32itled.png


Add New Trigger
th_U22ntitled.png


Right Click and Hit New Event
Unt33itled.png


Category Unit Event
Un66titled.png


Click on the red under-lined word "Unit" this screen should come up:
Untitl44ed.png

Hit select unit and left click the unit that if destroyed causes the player to lose, after selecting it hit okay.

Now to set up the action, right click then new action
U33ntitled.png


Select the Action Category "Game"
Untitl657ed.png


Now select the trigger type Defeat
Untitl6767ed.png


Example Result:
Untit2led.png




Enter Trigger Editor
th_Unt32itled.png


Enter Variable Editor
Unti3tled.png


Setup Variable of Type Timer
Unti4tled.png


Setup Trigger
Untitled-10.png

Make sure event for timer trigger is not "map initialization" cause it wont work then.

200th post ;D
 
Last edited:
Level 5
Joined
Dec 15, 2010
Messages
115
Sorry for the late response, been having RL issues atm, I'll check in to that when I get back today.
 
Level 5
Joined
Dec 15, 2010
Messages
115
Alright, I am a little confused, when I try to select the unit for defeat, I can only select pre-deployed units, is there any way to have it be the default town hall since the game will place the starting town hall in some other area if it's covered up with a pre-deployed one.

EDIT: More specifically for just player ones town hall, since whatever I tried either took it from all players or didn't do anything.

Here is exactly what I am attempting to do (We will go with 20 minutes for the example), I am making a map where the defender wins if they survive 20 minutes and get the victory message and the attackers gain the defeat message, the attackers win if they destroy the enemy main town hall within the 20 minutes giving them the victory message and the defender the defeat message.
 
Level 10
Joined
Mar 16, 2009
Messages
354
use the defeat trigger but instead of selecting the unit setup a variable, like the one for the timer, but make this one a unit variable.

When you use a trigger to create the Town Hall type structure put a line like
Action:
General - Set Variable - Set (UnitVariable) = Last Created Unit

Then in the defeat trigger event do:
Event - Unit - Specific Unit Event - (UnitVariable) dies
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Then in the defeat trigger event do:
Event - Unit - Specific Unit Event - (UnitVariable) dies

There are no events which take variables as a parameter. In the case you have given it will use the content of the variable when creating the even which would be null cause the event gets created on map initialization. You will need to add the event to the defeat trigger after you create the town hall type unit (the trigger add event action in GUI or just call the event generation native on the trigger).
 
Status
Not open for further replies.
Top