• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Making Unit Patrol Continuously

Status
Not open for further replies.
Level 3
Joined
Feb 9, 2008
Messages
63
as the title said...
How can i make "Last Created Units" owned by computer enemies continuously patrol around a point...

Here's my trigger... i copied it directly from warchaser for an event in my map
it's from the monster initialization trigger...

  • Spawn One Monster
    • Events
    • Conditions
    • Actions
      • If (EnableSpawners[(Integer A)] Equal to False) then do (Skip remaining actions) else do (Do nothing)
      • Set Frequencies[(Integer A)] = (Frequencies[(Integer A)] - 1)
      • If (Frequencies[(Integer A)] Not equal to 0) then do (Skip remaining actions) else do (Do nothing)
      • Set Frequencies[(Integer A)] = InitialFrequencies[(Integer A)]
      • Unit - Create 1 SpawnTypes[(Integer A)] for Player 12 (Brown) at (Position of MonsterSpawners[(Integer A)]) facing (Random real number between 0.00 and 360.00) degrees
      • Unit Group - Add all units of (Last created unit group) to MonsterGroups[(Integer A)]
      • Set MonsterOrder = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of (Last created unit) using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
      • Trigger - Run Monsters Order <gen> (ignoring conditions)
And..

  • Monsters Order
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit - Order MonsterOrder to Patrol To ((Position of MonsterSpawners[(Integer A)]) offset by (700.00, 500.00))
it does work BTW but after they patrolled once they just stop moving and they go stand-by for some reason...

what do you guys think i should do...im a begginer BTW so dont flame me if my idea sucks or something.

Future Thanks..
 
Level 10
Joined
May 8, 2009
Messages
253
You don't need 2 triggers,
simply order your unit to patrol to the desired point once (after its creation)
should look like something like this:

  • Unit - Create 1 SpawnTypes[(Integer A)] for Player 12 (Brown) at (Position of MonsterSpawners[(Integer A)]) facing (Random real number between 0.00 and 360.00) degrees
  • Set Point = (Position of MonsterSpawners[(Integer A)]) offset by (700.00, 500.00)
  • Unit - Order MonsterOrder to Patrol To (Point)
  • Custom Script - call RemoveLocation (udg_Point)
 
You need to store the offset and the spawn point in a variable.

  • Spawn..
    • Events
    • Conditions
    • Actions
      • Set Point = (Center of (MonsterSpawners[(Integer A)]))
      • Unit - Create 1 SpawnTypes[(Integer A)] for Player 12 (brown) at Point facing (Random real number between 0.00 and 360.00) degrees
      • Set PointOffset = (Point offset by (700.00, 500.00))
      • Unit - Order (Last created unit) to Patrol a PointOffset
      • Custom script: call RemoveLocation(udg_Point)
      • Custom script: call RemoveLocation(udg_PointOffset)
 
Level 3
Joined
Feb 9, 2008
Messages
63
Thanks for replying..

heres what ive done

  • Spawn One Monster
    • Events
    • Conditions
    • Actions
      • If (EnableSpawners[(Integer A)] Equal to False) then do (Skip remaining actions) else do (Do nothing)
      • Set Frequencies[(Integer A)] = (Frequencies[(Integer A)] - 1)
      • If (Frequencies[(Integer A)] Not equal to 0) then do (Skip remaining actions) else do (Do nothing)
      • Set Frequencies[(Integer A)] = InitialFrequencies[(Integer A)]
      • Set PatrolPoint = MonsterSpawners[(Integer A)]
      • Unit - Create 1 SpawnTypes[(Integer A)] for Player 12 (Brown) at (Position of MonsterSpawners[(Integer A)]) facing (Random real number between 0.00 and 360.00) degrees
      • Set MonsterOrder = (Last created unit)
      • Set PatrolPoinOffset = ((Position of PatrolPoint) offset by (500.00, 700.00))
      • Unit - Order MonsterOrder to Patrol To PatrolPoinOffset
      • Unit Group - Add all units of (Last created unit group) to MonsterGroups[(Integer A)]
      • Special Effect - Create a special effect attached to the origin of (Last created unit) using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
      • Custom script: call RemoveLocation (udg_PatrolPoinOffset)
Well some of them stop patrolling after some point while some of them continue to patrol.
and the "monsterspawner" is a unit

and for additional info (if it helps)
heres the event im going to need it...

the player(s) goes through a field filled with enemy units.
the player(s) needs to avoid being seen by any of the units.
enemies spawns from a unit/building and patrols around their spawning unit.
 
Last edited:
Do this:

  • Spawn
    • Events
    • Conditions
    • Actions
      • If (EnableSpawners[(Integer A)] Equal to False) then do (Skip remaining actions) else do (Do nothing)
      • Set Frequencies[(Integer A)] = (Frequencies[(Integer A)] - 1)
      • If (Frequencies[(Integer A)] Not equal to 0) then do (Skip remaining actions) else do (Do nothing)
      • Set Frequencies[(Integer A)] = InitialFrequencies[(Integer A)]
      • Set PointSpawn = (Position of MonsterSpawners[(Integer A)] <gen>)
      • Unit - Create 1 SpawnTypes[(Integer A)] for Player 12 (brown) at PointSpawn facing (Random angle) degrees
      • Unit Group - Add (Last created unit) to MonsterGroups[(Integer A)]
      • Set PointOffset = (PointOffset offset by 750.00 towards (Random angle) degrees)
      • Unit - Order (Last created unit) to Patrol to PointOffset
      • Special Effect - Create a special effect at PointSpawn using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_PointSpawn)
      • Custom script: call RemoveLocation(udg_PointOffset)
Put the other trigger, the activator of this.
I don't understand the last two thing that you need.
 
Last edited:
Status
Not open for further replies.
Top