• 🏆 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!

Remove items for each player

Status
Not open for further replies.
Level 2
Joined
May 11, 2010
Messages
11
Hello folk,

so: How can i remove items from a merchant for each player...
i mean: Player 1 buys an item -> remove for player 1 || Player 2 still got the item in the shop until he buys it too.

is there any chance of doing it?...
i looked around but i dont find something like that, just the "Remove item from marketplace", but this removes it for all players. :eekani:

Sorry for the bad language :thumbs_down:

Thanks for help! :grin:
 
Level 11
Joined
May 31, 2008
Messages
698
So you have the merchant that is shared between all players, anybody can select it/use it whenever they want.
Make the same building outside of the map boundary, just make your map slightly larger and set the camera view back via triggers.
In the area where players can not see, place one building for each player.
Then make a trigger that selects the players own building whenever they select the shared one they can actually see. It will make it seem like they are selecting the one they can see, but they are actually selecting the hidden one.
This way you can just remove the item from the players own shop and not change the shared one
 
Level 2
Joined
May 11, 2010
Messages
11
Okay nice, this works.. thanks for this..

But there is no other chance to get this triggered?.. It takes a lot of map space..
 
Level 11
Joined
May 31, 2008
Messages
698
To make it take up less map space, you can make 2 different kind of shops that look the same and everything, but the ones that the players can not see could have a smaller collision size, maybe of a small doodad. That way you could place a bunch of them on top of each other so they would only take up the space of maybe 1 or 2 shops.
The only reason to make them look the same is so it will look the same in the portrait when the player is selecting it.

And there is no other way to do this with only one building as far as i know, but i could be wrong
 
Level 2
Joined
May 11, 2010
Messages
11
Damnit, ive got a prob.
My hero needs to stand besides the "shop-dummy" ...
i cant buy the item.. :S
Sorry for this again
 
Level 11
Joined
May 31, 2008
Messages
698
Okay, just make the shop ability have unlimited range. I forget what its called, but make the hidden shop have unlimited range (or at least the largest range possible) for acquiring the hero. But make sure you take away the effect of it or else it will make the arrows above all of your heroes heads indicating that they are near a shop when they really arent.
 
Level 2
Joined
May 11, 2010
Messages
11
Well, finaly its done.. works fine.
Just one final question:

i want to remove the item: (its in german, sorry for that, i hope u can read it)
Player 1
Ereignisse
Einheit - A unit owned by Spieler 1 (Rot) Erwirbt einen Gegenstand
Bedingungen
(Item-type of (Sold Item)) Gleich item1
Aktionen
Neutrales Gebäude - Remove (Item-type of (Sold Item)) from Market <gen>

mhmm.. still there.
What shall i do with this trigger to remove those item...
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Instead of creating multiple shops,just do
  • Trigger
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Triggering unit) Equal to Your shop
      • (Item-type of (Sold Item)) Equal to Your item
    • Actions
      • Custom script: if GetLocalPlayer == GetOwningPlayer(GetBuyingUnit()) then
      • Neutral Building - Remove (Item-type of (Sold Item)) from (Triggering unit)
      • Custom script: endif
This will remove the item bought from the shop only for the owner of buying unit.

I'm not sure if this might desync though.
 
Last edited:
Level 2
Joined
May 11, 2010
Messages
11
Sorry Garfield,
i dont get your idea work... can u explain it please?
i dont understand ur action aswell
 
Level 2
Joined
May 11, 2010
Messages
11
First of all, whats desync? :S Im not that good in eng.
I get a error message with the custom script... i dont know how to fix it. :p
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
  • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetBuyingUnit()) then
My mistake,try using this ^

Concering desyncs and local players,you can read much about it here: http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=89207

Desyncs are errors that cause players in multiplayer game to disconnected from the game due to desynchronization. They mostly occur when GetLocalPlayer() function is used improperly.
I'm not sure if the way i showed will desync or not!
 
Level 2
Joined
May 11, 2010
Messages
11
Well okay, no error anymore.

  • Quest1
    • Ereignisse
      • Einheit - A unit Verkauft einen Gegenstand (aus dem Laden)
    • Bedingungen
      • (Unit-type of (Triggering unit)) Gleich Market
      • (Item-type of (Sold Item)) Gleich Item1
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetBuyingUnit()) then
      • Neutrales Gebäude - Remove (Item-type of (Sold Item)) from (Triggering unit)
      • Custom script: endif
But it still dont remove from my shop...
it has the sell item ability and is a neutral building.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
After some testing i realized that function
  • Neutral Building - Remove Item-Type from Marketplace
only works for items added by function
  • Neutral Building - Add Item-Type to Marketplace with 0 in stock and a max stock of 1
So you will have to add the item you want removed with that function to the shop.
Also make sure your shop has "Sell Items" ability.
 
Level 2
Joined
May 11, 2010
Messages
11
Tested it a few times, works perfect.. sorry for the late answer.
But i found a new problem..
1 of my items can be bought @ lvl 2. But the user can buy it aswell on lvl 1, but he wont get it.. item removed, but no item (because of lvl 1)
I hope u understand the prob.

Thanks for everything
 
Level 2
Joined
May 11, 2010
Messages
11
No i dont want the item added @ lvl 2. i want that the player can buy it only at lvl 2 .. He can see it, but only can buy it as he reaches the lvl :p
Is there any way of doing this?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • Blades of Belthazar
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Blades of Balthazar
          • (Level of (Triggering unit)) Less than 2
    • Actions
      • Item - Remove (Item being manipulated)
 
Status
Not open for further replies.
Top