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

[General] Limit Items of certain type for player

Status
Not open for further replies.
Level 2
Joined
Mar 17, 2020
Messages
4
Hi everyone,

in worldeditor there is a trigger which allows me to set limit of unit-type for players.

My question is: Is there any trigger to set limit of item-type for players? I can't find similar trigger :/

Idea is that player can build certain building containing items and I want to set limit for that items (as in the case of units), for instance 3 books of experience and no more.

I know I can set very long time for replenishment of stocks (or how it is in english), but player can build another building and there are 3 books of experiences again.
Or I can set limit for that building to 1, but player can destroy the building and then build a new one.
Or I can set that player can build that building only one time, but that building can be destroyed by enemy, so player should have opportunity to build it again.

How to solve this problem with limit of item-type?

Thanks,

Radim
 
Level 14
Joined
Feb 7, 2020
Messages
387
You would have to follow post #3 here in setting up the shops Add/remove items in a specific shop and control this via triggers.

It wouldn't be too difficult, I think. You can have an integer variable that you set to the total number of tomes that can be purchased (3). Decrease it by 1 with a trigger listening for sold items.

In another trigger: whenever a unit that should sell the tome finishes construction, add the item with your integer variable controlling the number of stock for the tome (if the variable is 0, don't add any). This is in the action section of Neutral Buildings.

If this made sense, you can try it and post the triggers here if you need further help. Experimentation is the fastest way to learn things.
 
Status
Not open for further replies.
Top