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

Help in spawning creeps

Status
Not open for further replies.
Level 2
Joined
Apr 11, 2013
Messages
9
i made a region for creeps to spawn from it and next to the region i made a small building , this building u must protect it from the creeps if its destroyed the creeps wont spawn again now [How i do that? any1 knows?]
 
Level 20
Joined
Jun 27, 2011
Messages
1,864
Here's an example trigger,
  • Spawn
    • Events
      • Time - Every 4.50 seconds of game time
    • Conditions
      • (Barracks 0004 <gen> is alive) Equal to True
    • Actions
      • Set Temp_Point = (Center of Region 000 <gen>)
      • Set Temp_Point2 = (Center of Region 001 <gen>)
      • Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing degrees
      • Unit - Order (Last created unit) to Attack-Move To Temp_Point2
      • Custom script: call RemoveLocation( udg_Temp_Point )
      • Custom script: call RemoveLocation( udg_Temp_Point2 )
  • [/stable]
Test map if you're confused.
 

Attachments

  • Spawn.w3x
    17.2 KB · Views: 31
Level 11
Joined
Jun 20, 2009
Messages
880
  • Spawn Creeps
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set TempLoc = (Center of Region 000 <gen>)
      • Unit - Create 1 Ghoul for Player 2 (Blue) at TempLoc facing 90.00 degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
  • Destroy Rax
    • Events
      • Unit - |cffffcc00Barracks|r 0000 <gen> Dies
    • Conditions
    • Actions
      • Trigger - Turn off Spawn Creeps <gen>
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Just an extension to Xian's trigger: Here's a map with the triggers on how to make creeps spawn and also stop it when it dies. Showing you a Barracks spawning every 10 seconds. Try expermient with it on what will happen when Barracks dies, type -destroy and building will be destroy.
 

Attachments

  • Triggers -All about Creep Spawn.w3x
    16.9 KB · Views: 33
Xian

The one you gave is slow. Use Triggering Unit is Dead Equal to false,because Alive is just reversed from dead.

JASS:
function IsUnitDeadBJ takes unit whichUnit returns boolean

    return GetUnitState(whichUnit, UNIT_STATE_LIFE) <= 0

endfunction



//===========================================================================

function IsUnitAliveBJ takes unit whichUnit returns boolean

    return not IsUnitDeadBJ(whichUnit)

endfunction
 
Status
Not open for further replies.
Top