• 🏆 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!

Trigger Help

Status
Not open for further replies.
Level 3
Joined
Apr 6, 2007
Messages
45
OK I have custom TownHall...and i tried everything with classification and gameplay constants...but it wont recognize my custom townhall as real townhall.

So I need trigger that would look something like this, but i need help in making it.

Event: Unit Dies
Conditions: Unit-type equal to TempleOfTides
Actions: Set number of player owned townhalls +1
 
Level 3
Joined
Apr 6, 2007
Messages
45
I want this:

Events:
Unit - A unit begins construction
Conditions:
(Unit-Type of (Triggering Unit)) Equal to (Temple of Tides)
Actions:
Set Variable = (NumberOfTownHalls +1)

AND

Events:
Unit - A unit dies
Conditions:
(Unit-Type of (Triggering Unit)) Equal to (Temple of Tides)
Actions:
Set Variable = (NumberOfTownHalls -1)

But I dunno how to make that Variable myself.
 
Level 8
Joined
Dec 29, 2006
Messages
359
To create a variable, open the trigger editor (yellow a on the bar). From there click the 'x' that is on the bar of the editor itself. Click on create new variable, for this particular purpose use the integer for the variable's type and name the variable NumberOfTownHalls.

Now just use the trigger the way you posted it except for one detail. Don't use

Events:
Unit - A unit begins construction
Conditions:
(Unit-Type of (Triggering Unit)) Equal to (Temple of Tides)
Actions:
Set Variable = (NumberOfTownHalls +1)

if you do this, the constucting town hall may be destroyed before its finished, and your game will read it as the town hall still being alive. Instead use,

Events:
Unit - A unit finishes construction
Conditions:
(Unit-Type of (Triggering Unit)) Equal to (Temple of Tides)
Actions:
Set Variable = (NumberOfTownHalls +1)
 
Level 3
Joined
Apr 6, 2007
Messages
45
Erm.....how can't u understand that if i do just this......Variable (NumberOfTownHalls +1) won't have any idea that I want to count TownHalls +1.....cotžz it will be only words without any specific action.

I need to link Unit-Type TownHall with Integer +1.........But I dunno how.
 
Status
Not open for further replies.
Top