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

[Solved] Unhide units within x of point

Status
Not open for further replies.
Level 4
Joined
Aug 17, 2008
Messages
81
I can't seem to make my trigger unhide hidden units within 300 range of a cast point, it's like the function is broken.

Help me fix this please. The rest of the trigger works flawlessly except for the unhide function FYI.

  • Geologist Flag Summon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Geologist Flag
    • Actions
      • Set Point = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at Point of type Walkability is off) Equal to False
        • Then - Actions
          • Unit - Create 1 Geologist Flag for (Owner of (Casting unit)) at Point facing Default building facing degrees
          • Unit Group - Pick every unit in (Units within 300.00 of Point) and do (Actions)
            • Loop - Actions
              • Unit - Unhide (Picked unit)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Point)
 
Level 4
Joined
Aug 17, 2008
Messages
81
  • Geologist Flag Summon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Geologist Flag
    • Actions
      • Set Point = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at Point of type Walkability is off) Equal to False
        • Then - Actions
          • Unit - Create 1 Geologist Flag for (Owner of (Casting unit)) at Point facing Default building facing degrees
          • Unit Group - Pick every unit in (Units within 300.00 of Point matching (((Matching unit) is in Resources) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Unhide (Picked unit)
              • Unit Group - Remove (Picked unit) from Resources
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Point)
Doesn't work either :/
 
Level 4
Joined
Aug 17, 2008
Messages
81
What's the trigger where you hide them?

  • Spawn Resources
    • Events
      • Time - Elapsed game time is (Random real number between 0.00 and 10.00) seconds
    • Conditions
    • Actions
      • Trigger - Run SWC1 <gen> (ignoring conditions)
  • SWC1
    • Events
    • Conditions
    • Actions
      • Set Relevant_Region = SWC island <gen>
      • Set X_Clay = 0
      • Set X_Coal = 0
      • Set X_Copper = 0
      • Set X_Emerald = 0
      • Set X_Gold = (Random integer number between 2 and 4)
      • Set X_Iron = (Random integer number between 18 and 36)
      • Set X_Rock = (Random integer number between 52 and 104)
      • Set X_Ruby = 0
      • Set X_Sapphire = (Random integer number between 6 and 12)
      • Set X_Silver = (Random integer number between 24 and 48)
      • Set X_Tin = 0
      • Set X_Sulfer = (Random integer number between 3 and 6)
      • Trigger - Run Resources Spawn Call <gen> (ignoring conditions)
  • Resources Spawn Call
    • Events
    • Conditions
    • Actions
      • Set Resource_Integer = X_Sulfer
      • Set Relevant_Unit = Sulfer
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Coal
      • Set Relevant_Unit = Coal
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Iron
      • Set Relevant_Unit = Iron
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Rock
      • Set Relevant_Unit = Rock
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Tin
      • Set Relevant_Unit = Tin
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Clay
      • Set Relevant_Unit = Clay
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Sapphire
      • Set Relevant_Unit = Sapphire
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Ruby
      • Set Relevant_Unit = Ruby
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Emerald
      • Set Relevant_Unit = Emerald
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Silver
      • Set Relevant_Unit = Silver
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Gold
      • Set Relevant_Unit = Gold
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
      • Set Resource_Integer = X_Copper
      • Set Relevant_Unit = Copper
      • Trigger - Run Resources Spawn <gen> (ignoring conditions)
  • Resources Spawn
    • Events
    • Conditions
    • Actions
      • Custom script: loop
      • Custom script: exitwhen 0 == udg_Resource_Integer
      • Set RandomPoint = (Random point in Relevant_Region)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at RandomPoint of type Walkability is off) Equal to False
        • Then - Actions
          • Unit - Create 1 Relevant_Unit for Player 9 (Gray) at RandomPoint facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Resources
          • Unit - Hide (Last created unit)
          • Set Resource_Integer = (Resource_Integer - 1)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_RandomPoint)
      • Custom script: endloop
Functioning (tested with/without hide.) Also lol you asked for it :)
 
Status
Not open for further replies.
Top