• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Item save problem

Status
Not open for further replies.
Level 8
Joined
Dec 9, 2009
Messages
397
You'll have to make 2 triggers,

They type -save

pick hero of player that typed -save
integer a 1-6
Loop
pick item in slot A, and set ownership to owner of hero




2nd trigger
unit aquires an item
if
owner of unit =/= owner of item
set temp point loc of object being manipulated
move item being manipulated to temp loc
else
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Action speaks louder than words, Ultimatony.

Try to create the trigger at least in useful form [ TRIGGER ] Trigger [/ TRIGGER ].

I mean, how to do this ?
pick item in slot A, and set ownership to owner of hero


Is there any default action that allows you to set item's ownership to which Player/Unit ?

If you're referring to the action Item - Change Owner, try it.
It doesn't work.

Other player can still attain the item eventhough it has been changed to specific player.

No flame intended
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Do you want to:
1. Load a hero with item(s) on it
2. Drop the item(s) to the ground
3. Type -repick (or whatsoever command that allows you to repick your heroes)
4. After repick, you picks up that item back, and your new unit can't pick it up ?

Is it ?
 
Level 17
Joined
Mar 21, 2011
Messages
1,603
ok i explain it.
i made a rpg with save/load system, everything works, u can load ur complete char.
but the problem is. if u got a nice item, u can type -save and give that item another player, so that he can also type -save. no both have this item.
same as with load:
u just load ur char, giv the item another player, and dont save.
i want that saved and loaded items can only be used by the saved/loaded char.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
set the item's user data (if you aren't using it) to the handle id or unit index of the first unit to pick it up (on pick up, set the user data, and only if the unit can pick it up in the first place). From there, when a unit picks it up, check if the unit can use it and make sure that the data stored in the item is either 0, the handle id, or the unit index of the unit.

Done, very easy =)
 
Level 8
Joined
Dec 9, 2009
Messages
397
To fix the system i gave you, it wasn't working cause the item he picked up had no owner, so
add a condition that item owner =/= no player

You will also have to make sure they are owners of the item after a load, so they can't drop it next game.
 
Level 8
Joined
Dec 9, 2009
Messages
397
Yes, thats why you add the condition

If
owner of item =/= no owner
Owner of item =/= owner of unit picking up item

so if an item has no owner, it won't use that trigger.
 
Status
Not open for further replies.
Top