• 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] Item Ability Location Check

Status
Not open for further replies.
Level 7
Joined
Oct 6, 2006
Messages
293
Alright im trying to make a trigger set. It contains 2 triggers.

1. The first trigger checks if an item is used, in this case a bottle. Its has to be used in an area (shallow pond) for it to work.
2. Checks if an item of filled bottle is used and removes it and replaces with empty bottle.

Problem* I dont know how create a temploc variable or anything i could use to check the location or make a location so that it only can be done from that character inside the area. I currently have it set up below but u can stick any unit in the area and fill your bottle anywhere on land.

Any help appreciated :), im just starting to understand variables.

Triggers below
(Problem trigger)
Fill Bottle
Events
Unit - A unit Uses an Item
Conditions
(item-type of (item being manipulated))Equal to reusable bottle
(number of units in (units in enchanted water <gen>))Greater than or equal to 1
Actions
Item - Remove (item being manipulated)
Hero - Create Bottle and give it to (Triggering unit)

(Trigger workin, but can be revised with top)
Use Bottle
Events
Unit - A unit Uses an item
Conditions
(Item-type of (item being manipulated)) Equal to Enchanter Spring Water
Actions
Item - Remove (item being manipulated)
Hero - Create Reusable Bottle and give it to (Triggering unit)
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
You could use the "unit is on ground type" condition

  • Set Point_Variable = (Position of (Triggering unit))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Terrain type at Point_Variable) Equal to Sunken Ruins - Dirt
    • Then - Actions
      • Actions
    • Else - Actions
  • Custom Script: call RemoveLocation(udg_Point_Variable)
Point_Variable = any point variable.
The custom script removes leaks (check the "Things that Leak" sticky thread).
And the terrain type could be any type you want of course.


Another solution would be to check if the unit is in a specific region.

  • Set Point_Variable = (Position of (Triggering unit))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Your_Region contains (Triggering unit)) Equal to True
    • Then - Actions
      • Actions
    • Else - Actions
  • Custom Script: call RemoveLocation(udg_Point_Variable)

Or a set of regions

  • Set Point_Variable = (Position of (Triggering unit))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Your_Region1 contains (Triggering unit)) Equal to True
          • (Your_Region2 contains (Triggering unit)) Equal to True
          • Etc. for all water regions
    • Then - Actions
      • Actions
    • Else - Actions
  • Custom Script: call RemoveLocation(udg_Point_Variable)
 
Level 7
Joined
Oct 6, 2006
Messages
293
Thanx ill give that a try. I didnt post the trigger completely correct but you got it :)

how do i set up: Your_Region contains (Triggering unit)) Equal to True
the only thing i know that has a region check is in events, its what has stumped for a loong time.
 
Status
Not open for further replies.
Top