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

[Trigger] fix my respawn trigger

Status
Not open for further replies.
Level 8
Joined
Nov 21, 2008
Messages
316
well after a grunt dies, they spawn and should attack, problem is when they respawn they dont attack. spot my problem please.

  • Respawn Wave
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Grunt
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to Player 11 (Dark Green)) or ((Owner of (Matching unit)) Equal to Player 12 (Brown))))
      • Set TempGroup2 = (Units in (Playable map area) matching (((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True))
      • For each (Integer A) from 1 to 1, do (Actions)
        • Loop - Actions
          • Set Spawn_Point2[1] = (Random point in SpawnRegions2[(Random integer number between 1 and 2)])
          • Unit - Create 1 Grunt for Player 12 (Brown) at Spawn_Point2[1] facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack (Random unit from TempGroup2)
          • Unit - Create 1 Grunt for Player 11 (Dark Green) at Spawn_Point2[1] facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack (Random unit from TempGroup2)
          • Custom script: call RemoveLocation (udg_Spawn_Point2[1])
          • Custom script: call RemoveLocation (udg_Spawn_Point2[bj_forLoopAIndex])
          • Wait 0.00 seconds
if u need more details tell me
 
Level 9
Joined
May 30, 2008
Messages
430
Custom script: call RemoveLocation (udg_Spawn_Point2[1])
Custom script: call RemoveLocation (udg_Spawn_Point2[bj_forLoopAIndex])


Here u are destroying the same Location 2 times, u better set the locations in the begining of the trigger or dunno make your trigger a unit of type grund enter in region or whatever
 
Level 2
Joined
Jul 19, 2009
Messages
14
uhm,, i think you should create a variable for those respawning units,
for example

Set Respawned_Unit = (Last Created Unit)
Unit - Order Respawned_Unit to Attack (Random unit from TempGroup2)

then just clear the leaks. Im not sure about that, but it worth to try.
xD
 
Level 2
Joined
Jul 19, 2009
Messages
14
theres something... open object editor edit the GRUNT's "STAT - CAN FLEE" set it to false, again, im not sure, but try it, and then, make a trigger that will order that unit to kill again after killing a unit,

Event
A unit dies

Condition
Killing unit belongs to an ally of Player 11(Dark Green) or Killing Unit belongs to an ally of Player 12(Brown)

Action
Unit - Order (Killing Unit) to Attack (Random unit from TempGroup2)


and if that doesnt work, try using varibles again xD
 
Status
Not open for further replies.
Top