• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Item Locked to you when you pick up

Status
Not open for further replies.
Level 5
Joined
Jun 18, 2008
Messages
146
Hey, siDeKicK here,

For my ORPG, i want to make a item system so when a player picks up an item, it saves to them, like say now they pick an item up and drop it, and another player comes and tries to pick and it and it says "This item is not owned by you!". Can anyone show me/upload a map with a system like this??Do i make sense?

Thanx,

siDeKicK
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
This can be rather simple:
A unit pick up an item
if Item custom data of manipulated item equal to 0
set item custom data to player number of owner of triggering unit
else
drop manipulated item
display some message to the player.
But this will use the custom data of items.
 
Level 5
Joined
Jun 18, 2008
Messages
146
This can be rather simple:
A unit pick up an item
if Item custom data of manipulated item equal to 0
set item custom data to player number of owner of triggering unit
else
drop manipulated item
display some message to the player.
But this will use the custom data of items.

Can you show me a ACTUALL trigger please?
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
  • Untitled Trigger 002
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Item being manipulated)) Equal to (==) 0
        • Then - Actions
          • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
        • Else - Actions
          • Set temp_point = (Position of (Triggering unit))
          • Unit - Order (Triggering unit) to drop (Item being manipulated) at temp_point
          • Custom script: call RemoveLocation(udg_temp_point)
This is something.
I also noted that you can set owner of items.
 
Im pretty sure u can do it like this.
Events:
Item(hero?) - "Your hero" picks up an item
Conditions:
Item is owned Equal to true
Actions:
If then else (multiple functions).
If: hero manipulating item equal to owner of item being manipulated
Then: Do nothing
Else:
Item(hero) - Make hero manipulating item(or triggering unit) drop Item being manipulated
Game - Display "that item isnt yours" (or whatever) for 5 seconds

Or you could use floating text.

ALSO: think of this.. What if the hero wants to give the item to someone else? Is it really that important to have this system?
You could just make like a "Safe area" where only the player can enter?
 
Level 5
Joined
Jun 18, 2008
Messages
146
  • Untitled Trigger 002
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Item being manipulated)) Equal to (==) 0
        • Then - Actions
          • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
        • Else - Actions
          • Set temp_point = (Position of (Triggering unit))
          • Unit - Order (Triggering unit) to drop (Item being manipulated) at temp_point
          • Custom script: call RemoveLocation(udg_temp_point)
This is something.
I also noted that you can set owner of items.

where can i find the "Custom Value" of an item?!
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
(Custom value of (Item being manipulated)) Equal to (==) 0
This condition is under integer comparison
But you should go with what Archangel_Tidusx did.
 
Level 5
Joined
Jun 18, 2008
Messages
146
Im pretty sure u can do it like this.
Events:
Item(hero?) - "Your hero" picks up an item
Conditions:
Item is owned Equal to true
Actions:
If then else (multiple functions).
If: hero manipulating item equal to owner of item being manipulated
Then: Do nothing
Else:
Item(hero) - Make hero manipulating item(or triggering unit) drop Item being manipulated
Game - Display "that item isnt yours" (or whatever) for 5 seconds

Or you could use floating text.

ALSO: think of this.. What if the hero wants to give the item to someone else? Is it really that important to have this system?
You could just make like a "Safe area" where only the player can enter?

ill use it but... can you code it for me/make a trigger and post it here? coz i am not very good @ reading triggers which arnt in trigger form :D.. but ill first try figure it out....
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Using owner of item will not work(when you pick an item it becomes yours).
Here is the trigger that uses Item's Custom data.
Hmm, it is not good this way wait a sec ;)
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
Worked, but had a bug, so I removed it.
Here it is - working, bug free :p
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
Yes it is bug free.
I will not explain why you could not open it(yes it is my fault).
This you can open:
 

Attachments

  • itemlock.w3x
    17.5 KB · Views: 42
Status
Not open for further replies.
Top