how too make items player bound?

mad_man1983

New Member
Reaction score
3
i need help with making trigger too make a item player bound as soon as u equip it, have been trying too figure it out, but havent got a clue about how too do it yet =/
 

UndeadDragon

Super Moderator
Reaction score
447
What do you mean by making an item player-bound?
 

Exide

I am amazingly focused right now!
Reaction score
448
If I got it right, then (maybe) something like this, is what you want:

Code:
Untitled Trigger 001
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        For each (Integer A) from 1 to Counter, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Item being manipulated) Equal to ItemOwnerRed[(Integer A)]) and ((Owner of (Triggering unit)) Not equal to Player 1 (Red))
                    Then - Actions
                        Game - Display to (Player group((Owner of (Triggering unit)))) the text: (This item is owned by  + (Name of Player 1 (Red)))
                        Hero - Drop (Item being manipulated) from (Triggering unit)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Item being manipulated) Equal to ItemOwnerBlue[(Integer A)]) and ((Owner of (Triggering unit)) Not equal to Player 2 (Blue))
                    Then - Actions
                        Game - Display to (Player group((Owner of (Triggering unit)))) the text: (This item is owned by  + (Name of Player 2 (Blue)))
                        Hero - Drop (Item being manipulated) from (Triggering unit)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Item being manipulated) Equal to ItemOwnerTeal[(Integer A)]) and ((Owner of (Triggering unit)) Not equal to Player 3 (Teal))
                    Then - Actions
                        Game - Display to (Player group((Owner of (Triggering unit)))) the text: (This item is owned by  + (Name of Player 3 (Teal)))
                        Hero - Drop (Item being manipulated) from (Triggering unit)
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Triggering unit)) slot status) Equal to Is playing
            Then - Actions
                If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Set ItemOwnerRed[Counter] = (Item being manipulated)) else do (Do nothing)
                If ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) then do (Set ItemOwnerBlue[Counter] = (Item being manipulated)) else do (Do nothing)
                If ((Owner of (Triggering unit)) Equal to Player 3 (Teal)) then do (Set ItemOwnerTeal[Counter] = (Item being manipulated)) else do (Do nothing)
                Set Counter = (Counter + 1)
            Else - Actions

It uses 4 variables:
ItemOwnerRed, ItemOwnerBlue and ItemOwnerTeal - Item array variables. (You will need one of these for each player in your map.)
Counter - Integer Variable.

What is supposed to happen with the trigger:
The trigger checks if the item is already owned by a player, if yes - it checks if the owner of the unit that picks up the item is the owner of the item.
If no - the item is dropped.
If yes - the item is assigned to a the owner of the unit.

-I didn't test this trigger, might be buggy. :p
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
Event:
- A unit aquires an item
Conditions:
Actions:
If
- Custom value of (Item being manipulated) not equal to 0
- Custom value of (Item being manipulated) not equal to (Player number of (Owner of (Triggering unit)))
Then
- Hero - Drop (Item being manipulated) from (Triggering unit)
Else
- Item - Set custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
 

Exide

I am amazingly focused right now!
Reaction score
448
Oh.
I didn't know you could set custom value for items. :p
 

mad_man1983

New Member
Reaction score
3
exactly what i meant

What is supposed to happen with the trigger:
The trigger checks if the item is already owned by a player, if yes - it checks if the owner of the unit that picks up the item is the owner of the item.
If no - the item is dropped.
If yes - the item is assigned to a the owner of the unit.

-I didn't test this trigger, might be buggy. :p

i will check if it works ^^, that's what i meant, so no one can steal items that you own if you store them on ground or something like that
 

Exide

I am amazingly focused right now!
Reaction score
448
Then use AceHart's trigger. -Much more effecient and reliable.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top