Trigger Question

Verrak

New Member
Reaction score
4
Basically i am trying to make a trigger that creates units at a location and then orders then to an area. Now i know how to do it, but once thier created, and orderd to attack-move thier. They double back to the creation point. I want them to move thier and enage anything on the way thier and once thier stay put and wait for an enemy to come.

Code:
Castle Defense Movement
    Events
        Unit - A unit enters Castle Defense Spawn <gen>
    Conditions
        (Owner of (Triggering unit)) Equal to Player 9 (Gray)
    Actions
        Unit - Order (Triggering unit) to Attack-Move To (Center of Attack Center <gen>)

Code:
Castle Defenders Wave 1
    Events
        Map initialization
    Conditions
        Victory Equal to False
    Actions
        If (Victory Equal to True) then do (Skip remaining actions) else do (Do nothing)
        Unit - Create 3 Footman for Player 9 (Gray) at (Random point in Castle Defense Spawn <gen>) facing Default building facing degrees
        Unit - Create 2 Priest for Player 9 (Gray) at (Random point in Castle Defense Spawn <gen>) facing Default building facing degrees
 

LightChaosma

New Member
Reaction score
60
add this trigger

e
unit enteres yourregiion
c
(Owner of (Triggering unit)) Equal to Player 9 (Gray)
a
set point = randompoint in attack center
order trigering unit to attack move to point
wait random real number between x and y
order triggering unit to stop
custom script: call removelocation(udg_point)
 

Verrak

New Member
Reaction score
4
I couldnt find the wait a random time between x and y, but i just put a generic wait 2 second and worked fine, thanks
 

LightChaosma

New Member
Reaction score
60
its in the functions. scroll down to math, then the first one.
using a fixed value there will eventually cause your units to form a circle, this causes them to shatter around a bit, use random between 1 and 3, or between 2 and 4, should work best in your case for as far as i can tell
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Code:
Castle Defenders Wave 1
    Events
        Map initialization
    Conditions
        Victory Equal to False
    Actions
        If (Victory Equal to True) then do (Skip remaining actions) else do (Do nothing)
        Unit - Create 3 Footman for Player 9 (Gray) at (Random point in Castle Defense Spawn <gen>) facing Default building facing degrees
        Unit - Create 2 Priest for Player 9 (Gray) at (Random point in Castle Defense Spawn <gen>) facing Default building facing degrees

... Why does that code repeat itself on its conditions?

Code:
Victory Equal to False

Is the same as:

Code:
If (Victory Equal to True) then do (Skip remaining actions) else do (Do nothing)

Isn't it?
 

Verrak

New Member
Reaction score
4
How can i make that trigger order units to attack but ignore a specfic unit (a peasent) if he steps on the region
 

Shadow

TH.net Regular
Reaction score
23
Why not just make peasants classified as a ward or something and then make it so the units you spawn can't target wards.
 

Verrak

New Member
Reaction score
4
well thier on the same team. Units are created..then sent to a spot where they fight, at the same time peasents are travling past them (also steping on the region that orders them to attack).

I know thiers a way to do it with conditions, i just cant figure out how for it to ingnore 2 specfic units (the peasent and the peon)
 

LightChaosma

New Member
Reaction score
60
e
unit aquieres a target
c
unit clasification of aquiered target is worker is equal to true
a
order triggering unit to stop(?)
 

Verrak

New Member
Reaction score
4
Hmm Lemme try n explain. Defenders(gray) spawn at the back of the map then orderned to a spot in the middle of the castle(which is a choke point). Peasents (also gray) come from sides past the guards created(over the region that orders gray units to stay and attack). I want the attackers to be able to kill the peasents. But the peasents be unaffected by the trigger that orders gray to attack in that region

So somthing like

E
Unit enters Attack Center

C
Owner of triggering unit = to player 9(gray)
Somthing basically if unit = worker, ignore action

A
Unit order triggering unit to attack-move
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top