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

manually checking for available expansion spots for AI

Status
Not open for further replies.
Level 17
Joined
Aug 19, 2007
Messages
1,380
- fixed, see below

Hi all,

I want to let the AI (from AI editor) check for an available expansion spot in an island map (transports are needed to reach the expansion spots). Since the AI does not use transports automatically (it needs to be triggered) and since I have got the transporting part for the AI working (through triggers), I thought that maybe if I let the AI drop a worker unit at the nearest expansion spot they would build an 'Expansion Town' (as called on the build priorities in the AI editor).
 
Last edited:
Level 17
Joined
Aug 19, 2007
Messages
1,380
This trigger gets the job done (not perfect but decent enough). You need to have Unit Events from Bribe in your map.

  • Worker loaded
    • Events
      • Game - CargoEvent becomes Equal to 1.00
    • Conditions
      • ((Owner of CargoTransportUnit[UDex]) controller) Equal to Computer
      • (UDexUnits[UDex] is A peon-type unit) Equal to True
    • Actions
      • Set TEMP_Townhall = (Random unit from (Units owned by (Owner of CargoTransportUnit[UDex]) matching (((Matching unit) is A town-hall-type unit) Equal to True)))
      • Set TEMP_PointTransportWorker = (Position of TEMP_Townhall)
      • Set TEMP_PointTransportWorker2 = (Position of (Random unit from (Units within 7500.00 of TEMP_PointTransportWorker matching (((Distance between TEMP_PointTransportWorker and (Position of (Matching unit))) Greater than or equal to 2000.00) and ((Unit-type of (Matching unit)) Equal to Vespene
      • Unit - Order CargoTransportUnit[UDex] to Unload All At TEMP_PointTransportWorker2
      • Custom script: call RemoveLocation(udg_TEMP_PointTransportWorker)
      • Custom script: call RemoveLocation(udg_TEMP_PointTransportWorker2)
 
Status
Not open for further replies.
Top