• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] My mindnumbingly frustrating unit respawn trigger. (After quest)

Status
Not open for further replies.
Level 2
Joined
Oct 16, 2004
Messages
16
I'm working on a trigger that respawns the creeps in a region when a specific quest is recieved. This questing area is open for creeping before the player even recieves the quest, but assuming they kill everything in the region... I don't want it to be barren when they return to complete the quest.

To further fool-proof the trigger I've made it so it destroys every creep in the region before respawning them (Just in case the player hasn't been to that region and creeped there yet)

Where it stands right now, it "Kills" the units, rather than "Removes" them. (Though I'd prefer remove) and they do successfully respawn if it's the trigger that kills them and not the player. But if the player kills the units... A few minutes pass by... The respawn trigger won't work.

I basically know the problem, but because the trigger is activated by recieving a quest (Rather than standard respawn triggers that activate from the units death) I can't make my trigger refer to the units I need to. "Triggering Unit" doesn't work, and "Picked Unit" doesn't work after the dead units have thoroughly decayed.

There are two relevant triggers to the respawn and I've based it around Fireeye's respawn system (Post #9 from this thread: http://www.hiveworkshop.com/forums/f269/respawn-creeps-their-starting-position-34577/)

Here're my triggers:

  • Events
  • Map initialization
  • Conditions
  • Actions
  • Set CampGrizznatchUnitGroup = (Units in Camp Grizznatch <gen> owned by Neutral Hostile)Unit Group - Pick every unit in CampGrizznatchUnitGroup and do (Actions)
    • Loop - Actions
      • Set CampGrizznatchRespawnPoint[CampGrizznatchRespawnInteger] = (Position of (Picked unit))
      • Set CampGrizznatchRespawnUnitType[CampGrizznatchRespawnInteger] = (Unit-type of (Picked unit))
      • Unit - Set the custom value of (Picked unit) to CampGrizznatchRespawnInteger
      • Set CampGrizznatchRespawnInteger = (CampGrizznatchRespawnInteger + 1)
And:

  • Events
  • Unit - A unit comes within 200.00 of Magistrate Alistair 0083 <gen>
  • Conditions
  • (Owner of (Triggering unit)) Equal to Player 1 (Red)
  • Actions
  • Unit Group - Pick every unit in CampGrizznatchUnitGroup and do (Unit - Kill (Picked unit))
  • Wait 0.01 seconds
  • Unit - Create 1 CampGrizznatchRespawnUnitType[(Custom value of (??? unit))] for Neutral Hostile at CampGrizznatchRespawnPoint[(Custom value of (??? unit))] facing (Random angle) degrees
 
Level 5
Joined
Oct 3, 2008
Messages
104
y dont u just recreate the units the conventional way? i dont understand y u must refer back to units, or why u must recreate them in the first place, your question was pretty hard to understand...
and i dont understand why u must kill and respawn the units again. just try this, make a trigger so that whenever a unit in that region is killed, the unit type of the killed unit is stored in a variable array. give this trigger an execution counter, so you can refer to how long this array will be at any point in time, and so correctly add new values to this array. when you want to recreate units here that have previously been killed, use a lopp integer A, and loop until the execution count that i mentioned beforehand. recreate the units according to the unit types stored in this array, should be fine..
 
Level 2
Joined
Oct 16, 2004
Messages
16
Terradont, that didn't work. :(

PoZoR, I killed all the units before recreating them so that way so that way if some were still alive, the respawn trigger wouldn't create a clone next to them... It may have been a totally unneccesary step, but at the time it seemed like a really good idea.

I can store the unit type of the killed unit in a variable array. But I don't know how to do the rest of what you suggestion. Could you please show me in trigger form?
 
Status
Not open for further replies.
Top