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

Checking multiple regions for items

Status
Not open for further replies.
Level 6
Joined
Apr 1, 2009
Messages
201
I've created a system that stores items in 2 separate regions for each player. I have abilities where you can move items around the 2 regions or to your hero and keeper (Like a storage unit). I have the conditions so far that checks if the item isn't owned or is owned by you, then I check if the item is in one of your inventory regions. How would I make a condition that allows me to check every other players region, checking if its not equal to the owner of the unit casting the ability? There are 16 different regions, 2 for each player. The reason I ask if because I want the Keeper to be able to pick up items anywhere on the map unless they are in another players inventory regions or owned by another player. The problem is I can't pick up any item that isn't in any players inventory (Like in the playable map area).

  • Move To Keeper
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Move To Keeper [E]
    • Actions
      • Set DisplayForce = (Player group((Owner of (Triggering unit))))
      • Set MoveToKeeperCaster = (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MoveToKeeperCaster Equal to PlayerToPlayerInventoryGroup[(Player number of MoveToKeeperCaster)]
          • MoveToKeeperCaster Equal to PlayerToPlayerSafeGroup[(Player number of MoveToKeeperCaster)]
          • Or - Any (Conditions) are true
            • Conditions
              • ((Target item of ability being cast) is in PlayerInventory[(Player number of MoveToKeeperCaster)]) Equal to True
              • ((Target item of ability being cast) is in PlayerSafeInventory[(Player number of MoveToKeeperCaster)]) Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • CustomValueItemOwnerShip Equal to PlayerNumberItemOwnership
              • CustomValueItemOwnerShip Equal to 0
        • Then - Actions
          • Hero - Give (Target item of ability being cast) to (Triggering unit)
        • Else - Actions
          • Game - Display to DisplayForce the text: Invalid Item
          • Custom script: call DestroyForce(udg_DisplayForce)
  • Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Player and Player's Inventory --------
      • Set PlayerToPlayerInventoryGroup[1] = Player 1 (Red)
      • Set PlayerInventory[1] = Player 1 Inventory <gen>
      • Set PlayerToPlayerInventoryGroup[2] = Player 2 (Blue)
      • Set PlayerInventory[2] = Player 2 Inventory <gen>
      • Set PlayerToPlayerInventoryGroup[3] = Player 3 (Teal)
      • Set PlayerInventory[3] = Player 3 Inventory <gen>
      • Set PlayerToPlayerInventoryGroup[4] = Player 4 (Purple)
      • Set PlayerInventory[4] = Player 4 Inventory <gen>
      • Set PlayerToPlayerInventoryGroup[5] = Player 5 (Yellow)
      • Set PlayerInventory[5] = Player 5 Inventory <gen>
      • Set PlayerToPlayerInventoryGroup[6] = Player 6 (Orange)
      • Set PlayerInventory[6] = Player 6 Inventory <gen>
      • Set PlayerToPlayerInventoryGroup[7] = Player 7 (Green)
      • Set PlayerInventory[7] = Player 7 Inventory <gen>
      • Set PlayerToPlayerInventoryGroup[8] = Player 8 (Pink)
      • Set PlayerInventory[8] = Player 8 Inventory <gen>
      • -------- Player and Player's Safe Inventory --------
      • Set PlayerToPlayerSafeGroup[1] = Player 1 (Red)
      • Set PlayerSafeInventory[1] = Player 1 Safe Inventory <gen>
      • Set PlayerToPlayerSafeGroup[2] = Player 2 (Blue)
      • Set PlayerSafeInventory[2] = Player 2 Safe Inventory <gen>
      • Set PlayerToPlayerSafeGroup[3] = Player 3 (Teal)
      • Set PlayerSafeInventory[3] = Player 3 Safe Inventory <gen>
      • Set PlayerToPlayerSafeGroup[4] = Player 4 (Purple)
      • Set PlayerSafeInventory[4] = Player 4 Safe Inventory <gen>
      • Set PlayerToPlayerSafeGroup[5] = Player 5 (Yellow)
      • Set PlayerSafeInventory[5] = Player 5 Safe Eventory <gen>
      • Set PlayerToPlayerSafeGroup[6] = Player 6 (Orange)
      • Set PlayerSafeInventory[6] = Player 6 Safe Inventory <gen>
      • Set PlayerToPlayerSafeGroup[7] = Player 7 (Green)
      • Set PlayerSafeInventory[7] = Player 7 Safe Inventory <gen>
      • Set PlayerToPlayerSafeGroup[8] = Player 8 (Pink)
      • Set PlayerSafeInventory[8] = Player 8 Safe Inventory <gen>
  • Item Ownership
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set ItemVariableItemOwnership = (Item being manipulated)
      • Set CustomValueItemOwnerShip = (Custom value of ItemVariableItemOwnership)
      • Set PlayerNumberItemOwnership = (Player number of (Owner of (Hero manipulating item)))
      • Set DisplayForce = (Player group((Owner of (Hero manipulating item))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CustomValueItemOwnerShip Equal to 0
        • Then - Actions
          • Item - Set the custom value of ItemVariableItemOwnership to PlayerNumberItemOwnership
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CustomValueItemOwnerShip Not equal to PlayerNumberItemOwnership
            • Then - Actions
              • Hero - Drop ItemVariableItemOwnership from (Hero manipulating item)
              • Game - Display to DisplayForce the text: This item does not ...
              • Custom script: call DestroyForce(udg_DisplayForce)
            • Else - Actions
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
but donbt use custom value for identify the player owner (like item custom value=player numver, when u pick then check the custom value and drop if custom value != player number of triggering player) ? because if u use custom value then u can ceck the playable map instead regions
 
Status
Not open for further replies.
Top