• 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.

[General] Make randomly spawned AI Rescuable by another AI.

Status
Not open for further replies.
Level 2
Joined
Mar 26, 2016
Messages
5
I am working on a design where when buildings die units will spawn for a rescuable player (Player 19).
I have several BASIC AI 's that will destroy the triggering structures to spawn units for Player 19. I want them to be resused by the Player or the AI that destroy the building.
Any ideas welcome!

Thanks,
-MrGsqrd
 
Why make them rescuable instead of giving them to the player or AI that destroyed the building?

What I'm thinking is something along the lines of:
  • GiveUnitsToDestroyingPlayer
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Set temp_point = (Position of (Dying unit))
      • Unit - Create 1 Footman for (Owner of (Killing unit)) at temp_point facing (Random angle) degrees
      • Custom script: call RemoveLocation(udg_temp_point)
Otherwise you could add the rescuable units to a group and every 0.2 seconds or so check if a unit that should be able to rescue it, is in range and give the unit to the owner of that unit.

Depending on how many rescuable units you expect to be available, this might need some optimizations (there are a few fairly easy ones that should help a lot)
 
Status
Not open for further replies.
Top