• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

1 tower max each player.

Status
Not open for further replies.
Level 3
Joined
Apr 27, 2005
Messages
45
some1 pls help me :)
heres the problem.

- unit enters region.
- if "unit" is owned by player1 & Tower P1 <gen> contains Tower) Not equal to True
- then Creat tower @ tower p1 <gen> & kill entering unit.

heres the problem i want to make it that every player can only have 1 tower max. if some1 allrdy has a tower it wont let him get second tower. PLS HELP
been tring to get help last 45min. :( :( :(
 
Level 3
Joined
Apr 27, 2005
Messages
45
1#
Code:
creating a tower
    Events
        Unit - A unit enters entering unit <gen>
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (tower unit <gen> contains tower) Equal to False
                (Owner of (Entering unit)) Equal to Player 1 (Red)
            Then - Actions
                Unit - Kill (Entering unit)
                Unit - Create 1 Cannon Tower for Player 1 (Red) at (Center of tower unit <gen>) facing (Position of (Triggering unit))
                Set tower = (Last created unit)
            Else - Actions
                Game - Display to (All players) the text: OMG IT WORKS

2#
Code:
creating units at tower
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (tower unit <gen> contains tower) Equal to True
            Then - Actions
                Unit - Create 1 Footman for Player 1 (Red) at (Center of tower unit <gen>) facing Default building facing degrees
            Else - Actions
                Do nothing



this is the trigger what i want :d but it doesnt work right. in the 2#CODE it still creats units after tower unit is dead and in 1#CODE after tower is dead i cant make a new tower. :S make some1 can help me with it? 8)
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
tower
Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Region 000 <gen> contains tower) Equal to False
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Then - Actions
Unit - Kill (Triggering unit) <- maybe removing would be better
Unit - Create 1 Cannon Tower for Player 1 (Red) at (Center of Region 000 <gen>) facing Default building facing degrees
Set tower = (Last created unit)
Trigger - Turn on createunits <gen>
Else - Actions
Do nothing
==============================
createunits
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Region 000 <gen> contains tower) Equal to True
Then - Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of Region 000 <gen>) facing Default building facing degrees

Else - Actions
Do nothing
======================================
towedie
Events
Unit - A unit Dies
Conditions
(Triggering unit) Equal to tower
Actions
Trigger - Turn off createunits <gen>
==============================================

In your triggers the units keep spawning as long as the remains of the tower are there. In my triggers the spawning stop once the tower dies, and you can create another tower there when the remains of the tower disappear.
 
Level 3
Joined
Apr 27, 2005
Messages
45
OMG I WANT TO KISS YOU :D

and its a easy trigger lol.. :S i feel stupid... :D aa btw u i need testers soon... any1 wana be a tester? :d
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Darklord- said:
OMG I WANT TO KISS YOU :D
Please don't :D

and its a easy trigger lol.. :S i feel stupid... :D aa btw u i need testers soon... any1 wana be a tester? :d

I can test your map.

Also for the tower thing, I optimized the triggers:

tower
Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(tower is dead) Equal to True
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Then - Actions
Unit - Kill (Triggering unit)
Unit - Create 1 Cannon Tower for Player 1 (Red) at (Center of Region 000 <gen>) facing Default building facing degrees
Set tower = (Last created unit)
Trigger - Turn on createunits <gen>
Else - Actions
Do nothing

====================================================

createunits
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(tower is alive) Equal to True
Then - Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of Region 000 <gen>) facing Default building facing degrees
Unit - Order (Last created unit) to Move To (Center of Region 001 <gen>)
Else - Actions
Trigger - Turn off (This trigger)

==================================================
The second trigger should be set as initially off. Now you can create a new tower as soon as the previous dies, and not wait untill the remains disappear. Only two triggers now.
 
Level 3
Joined
Apr 27, 2005
Messages
45
i made 2 triggers for all players... :d it should work for all ppl :wink:

Code:
Creat Marin Tower
    Events
        Unit - A unit enters Marin Tower <gen>
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Triggering unit)) Equal to Player 1 (Red)
                (TowerP1 is dead) Equal to True
            Then - Actions
                Unit - Kill (Entering unit)
                Unit - Create 1 Marin Tower for Player 1 (Red) at (Center of Marin Tower P1 <gen>) facing Default building facing degrees
                Set TowerP1 = (Last created unit)
            Else - Actions
                Game - Display to Player Group - Player 1 (Red) the text: You all ready have ...
                Unit - Move (Triggering unit) instantly to (Center of Master Golems <gen>)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP2 is dead) Equal to True
                (Owner of (Triggering unit)) Equal to Player 2 (Blue)
            Then - Actions
                Unit - Kill (Entering unit)
                Unit - Create 1 Marin Tower for Player 2 (Blue) at (Center of Marin Tower P2 <gen>) facing Default building facing degrees
                Set TowerP2 = (Last created unit)
            Else - Actions
                Game - Display to Player Group - Player 2 (Blue) the text: You all ready have ...
                Unit - Move (Triggering unit) instantly to (Center of Master Golems <gen>)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP3 is dead) Equal to True
                (Owner of (Triggering unit)) Equal to Player 3 (Teal)
            Then - Actions
                Unit - Kill (Entering unit)
                Unit - Create 1 Marin Tower for Player 3 (Teal) at (Center of Marin Tower P3 <gen>) facing Default building facing degrees
                Set TowerP3 = (Last created unit)
            Else - Actions
                Game - Display to Player Group - Player 3 (Teal) the text: You all ready have ...
                Unit - Move (Triggering unit) instantly to (Center of Master Golems <gen>)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP4 is dead) Equal to True
                (Owner of (Triggering unit)) Equal to Player 4 (Purple)
            Then - Actions
                Unit - Kill (Entering unit)
                Unit - Create 1 Marin Tower for Player 4 (Purple) at (Center of Marin Tower P4 <gen>) facing Default building facing degrees
                Set TowerP4 = (Last created unit)
            Else - Actions
                Game - Display to Player Group - Player 4 (Purple) the text: You all ready have ...
                Unit - Move (Triggering unit) instantly to (Center of Master Golems <gen>)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP5 is dead) Equal to True
                (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
            Then - Actions
                Unit - Kill (Entering unit)
                Unit - Create 1 Marin Tower for Player 5 (Yellow) at (Center of Marin Tower P5 <gen>) facing Default building facing degrees
                Set TowerP5 = (Last created unit)
            Else - Actions
                Game - Display to Player Group - Player 5 (Yellow) the text: You all ready have ...
                Unit - Move (Triggering unit) instantly to (Center of Master Golems <gen>)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP6 is dead) Equal to True
                (Owner of (Triggering unit)) Equal to Player 6 (Orange)
            Then - Actions
                Unit - Kill (Entering unit)
                Unit - Create 1 Marin Tower for Player 6 (Orange) at (Center of Marin Tower P6 <gen>) facing Default building facing degrees
                Set TowerP6 = (Last created unit)
            Else - Actions
                Game - Display to Player Group - Player 6 (Orange) the text: You all ready have ...
                Unit - Move (Triggering unit) instantly to (Center of Master Golems <gen>)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP7 is dead) Equal to True
                (Owner of (Triggering unit)) Equal to Player 7 (Green)
            Then - Actions
                Unit - Kill (Entering unit)
                Unit - Create 1 Marin Tower for Player 7 (Green) at (Center of Marin Tower P7 <gen>) facing Default building facing degrees
                Set TowerP7 = (Last created unit)
            Else - Actions
                Game - Display to Player Group - Player 7 (Green) the text: You all ready have ...
                Unit - Move (Triggering unit) instantly to (Center of Master Golems <gen>)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP8 is dead) Equal to True
                (Owner of (Triggering unit)) Equal to Player 8 (Pink)
            Then - Actions
                Unit - Kill (Entering unit)
                Unit - Create 1 Marin Tower for Player 8 (Pink) at (Center of Marin Tower P8 <gen>) facing Default building facing degrees
                Set TowerP8 = (Last created unit)
            Else - Actions
                Game - Display to Player Group - Player 8 (Pink) the text: You all ready have ...
                Unit - Move (Triggering unit) instantly to (Center of Master Golems <gen>)

Code:
Creat Marin Units
    Events
        Time - Every 4.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP1 is alive) Equal to True
            Then - Actions
                Unit - Create 1 Marine Golem for Player 1 (Red) at (Center of Marin Tower P1 <gen>) facing Default building facing degrees
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP2 is alive) Equal to True
            Then - Actions
                Unit - Create 1 Marine Golem for Player 2 (Blue) at (Center of Marin Tower P2 <gen>) facing Default building facing degrees
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP3 is alive) Equal to True
            Then - Actions
                Unit - Create 1 Marine Golem for Player 3 (Teal) at (Center of Marin Tower P3 <gen>) facing Default building facing degrees
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP4 is alive) Equal to True
            Then - Actions
                Unit - Create 1 Marine Golem for Player 4 (Purple) at (Center of Marin Tower P4 <gen>) facing Default building facing degrees
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP5 is alive) Equal to True
            Then - Actions
                Unit - Create 1 Marine Golem for Player 5 (Yellow) at (Center of Marin Tower P5 <gen>) facing Default building facing degrees
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP6 is alive) Equal to True
            Then - Actions
                Unit - Create 1 Marine Golem for Player 6 (Orange) at (Center of Marin Tower P6 <gen>) facing Default building facing degrees
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP7 is alive) Equal to True
            Then - Actions
                Unit - Create 1 Marine Golem for Player 7 (Green) at (Center of Marin Tower P7 <gen>) facing Default building facing degrees
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TowerP8 is alive) Equal to True
            Then - Actions
                Unit - Create 1 Marine Golem for Player 8 (Pink) at (Center of Marin Tower P8 <gen>) facing Default building facing degrees
            Else - Actions
                Do nothing


will this work for all players?:O
i think it will :d
 
Status
Not open for further replies.
Top