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

Questions on Constructing a Tower Defense

Status
Not open for further replies.
Level 2
Joined
Jul 8, 2009
Messages
3
Hey all, this is my first post and it's about my first TD I've been working on. For an example I guess you could say it is kind of like Element TD. I have a few questions and if anyone could help it would be much appreciated.

Most of the problems I'm having are with creating triggers. I can create my own custom units and buildings and upgrades just fine.

1) I can make it so creeps spawn after a certain period of time (2 sec) continually, but how do I make it so that they do not start periodically spawning until players have had enough time to create towers (say like, 20 seconds)?

2) The creeps that spawn are SUPPOSED to move in a maze-like fashion to get from region 1 (startpoint) to region 2 (endpoint). However, they like to randomly turn around and run backwards and they never reach the endpoint. (I am sure nothing is blocking their path and yes, I turned off their ability to flee). Do I need to place regions at each corner or is there something else wrong?

3) I have placed player starting locations (players 1-8) on the map and successfully made it so Player 1's builder spawns correctly. How do I make it so the other players' builders will spawn ONLY if their slot is filled?

Sorry for the noob questions, only started working with the WE a few days ago and seem to have gotten myself stuck already ><
 
Level 8
Joined
Aug 1, 2008
Messages
420
He means for each time inbetween waves. I think the way TD's do is check if there are any units on the map owned by "the player who sends the waves, etc Player 12 (computer)" And then start a timer for 20 seconds, then Event - Timer Elapsed (from mind, dunno if this is right) start the trigger.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
you need to learn events,conditions,actions,how to remove leaks and how to use array and no array variables
whatever you do first learn how to remove leaks > so you don´t have to fix your triggers later,like me :(
there is almoust all things that can leak

-effects
-destroy last created effect

-positions > variable type Point
Custom Script:call RemoveLocatin(udg_NameOfYourVariable)

-unit groups > variable type Unit Group
Custom Script:call DestroyGroup(udg_NameOfYourVariable)

-player groups > variable type Player Group (no leak in all players)
Custom Script:call DestroyForce(udg_NameOfYourVariable)

you need to use Custom Scripts every time you change your variable

set your group/point variable
use it
destroy it

its also very good to learn actions
-IF/THAN/ELSE
-pick every player and do actions
-pick every unit and do actions
-pick every destructible



there is a condition that you want
-player slot equal to is playing


you can turn off trigger at map initialization (and always have only one map initialization trigger)
turn on trigger when you want (for spawning creeps later)

or just add event when you want
trigger-add to (your trigger) the event (every 2 sec of game)

BTW ,lol i can´t believe i typed this all :D
 
1)
Variables: Array size: Type:
Type_1: Number of unit types Unit
Type_2: 0, not array Unit
Count: Number of levels Integer
Round: 0, not array Integer
  • Trigger 1
  • Events
    • Time - Elapsed game time is 40 Seconds
  • Conditions
  • Actions -
    • Trigger - Enable Trigger 2
    • Trigger - Enable trigger 3
Trigger 2, (Initally enabled FALSE)
  • Events
    • Time - Periodic event - Every 30 seconds of game time
  • Conditions
  • Actions
    • Unit Create Count unit of type Type_1 for Neutral Hostile
Set variables 1 (Initally enabled, NO)
  • Events
    • Time - Every 29.59 seconds of game time
  • Conditions
  • Actions
    • Set Round = Round + 1
    • Set Count = Count[Round]
    • Set Type_1 = Type_2[Round]
Initalization
  • Events
    • Map initalization
  • Conditions
  • Actions
    • Set Type_1[1] = Ur 1 wave here
    • Set type_1[2] = Ur 2 wave here
    • Set type_1[3] = Ur 3 Wave here
  • Etc, Etc.
Get is player here
  • Events
    • Map initalization
  • Conditions
  • Actions
    • For each integer from 1 to <the amount of players>
      • Loop actions
        • If Player (integer a) Matches (Player(Integer a) Equal to User And Player (Integer a) Equal to Is playing Then Create 1 Builder for Player(Integer a)
Lol, i cant belive i typed all that too! XD
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
i forgot to say how to make WE much more faster

open your map>Window>Brush List

without the brush list you can normally change names of unit and some other things

i needed 10 sec to change unit name and without brush list i need 1 sec xD

and use this at the and of your trigger if it will run only once (good for map initialization triggers)
Custom script: call DestroyTrigger( GetTriggeringTrigger() )

never do 2 triggers with same events and conditions (its better to make it in one)
awesome avatar btw :D
 
Level 18
Joined
Feb 28, 2009
Messages
1,970
i forgot to say how to make WE much more faster

open your map>Window>Brush List

without the brush list you can normally change names of unit and some other things

i needed 10 sec to change unit name and without brush list i need 1 sec xD
I depends also on how`s big the map is (in every meaning (number of units/doodas on map, imports, etc.)). On empty map I can make new unit/change its name in 0.5 sec. ;P
 
Status
Not open for further replies.
Top