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

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 17
Joined
Mar 21, 2011
Messages
1,611
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.
 
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