Can I Reset the Cooldown on an Item to Be Sold?

Squeekems

TH.net Regular
Reaction score
11
I am trying to make it so players can only buy one item from this shop. I have it so that once a player buys something from the shop, every time they select the shop, it immediately deselects it. That is not enough. They still have a half-second to select the shop and use a hot-key to make a purchase.

So, I decided I would make it so that when they acquire an item from the shop, after they have already bought one, I would remove the item and refresh the item in the shop. The problem is I don't know how to refresh the item in the shop. Can I do that somehow?
 
I believe there is an action:
Trigger:
  • Neutral Building - Remove (Last Purchased Item) from (Triggering unit)
 
man, you don't know how to add cooldown?
its in options tab

Using triggers.

I believe there is an action:
Trigger:
  • Neutral Building - Remove (Last Purchased Item) from (Triggering unit)
Will that replenish the item in the shop? I'm gonna go check right now. Lol. I'm just saying if all it does is remove the item from the unit, I already go that covered.
 
wait im confused as to what you are trying to accomplish now, i thought you wanted to make it so that only 1 of an item could be purchased...
 
No no, I want a player to only be able to purchase 1 item from a shop.
Let me be more specific:
I'm setting up a system for players to pick abilities from shops. I am grouping the abilities by their hot-key/position. The hot-keys are Z, X, C, and V. I only want them to purchase only one of each kind. I think you can see what I am trying to do from this.
 
towers equal to number of heroes played....
each player can only manipulate his tower.
Don't make a neutral and try to hide item, because the other guy who has not bought the item can't buy it.
Or you can add a boolean array variable which tells you if the hero has bought the item, and upon purchase remove it and give gold back
 
towers equal to number of heroes played....
each player can only manipulate his tower.
Don't make a neutral and try to hide item, because the other guy who has not bought the item can't buy it.
Or you can add a boolean array variable which tells you if the hero has bought the item, and upon purchase remove it and give gold back

Because I think you are a little behind on what I thought I explained I have done already I am going to post what I have.

Trigger:
  • Prevent Z Selection
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 6 (Orange) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
      • Player - Player 9 (Gray) Selects a unit
      • Player - Player 10 (Light Blue) Selects a unit
      • Player - Player 11 (Dark Green) Selects a unit
      • Player - Player 12 (Brown) Selects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Z Abilities (1)
          • (Unit-type of (Triggering unit)) Equal to Z Abilities (2)
      • BoughtZ[((Player number of (Triggering player)) - 1)] Equal to True
    • Actions
      • Selection - Select Hero[((Player number of (Triggering player)) - 1)] for (Triggering player)


I'm trying to figure out how to tell the game to replenish the bought item in the shop in the final [ljass]Else[/ljass].
Trigger:
  • Learn Blizzard
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Blizzard
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BoughtZ[((Player number of (Owner of (Triggering unit))) - 1)] Equal to False
        • Then - Actions
          • Set BoughtZ[((Player number of (Owner of (Triggering unit))) - 1)] = True
          • Set Ability[(((Player number of (Owner of (Triggering unit))) x 4) + 1)] = Blizzard
          • Unit - Add Blizzard to (Triggering unit)
          • Selection - Select (Triggering unit) for (Owner of (Triggering unit))
        • Else - Actions
          • //Replenish Blizzard in the Shop
 
The items in the store will only be at 1. Their replenish rate is set at 3600. I don't want players having any of the same abilities. But, if someone sneaks a buy, then that ability becomes unavailable to all the other players. Using triggers, I want to replenish the item in the shop.
 
why dont you use unit at another location with the hero classification and no model, then give it all the abilities you want to enable in the form of a charge lumber/gold ability, so it seems like you are just buying it? then remove the ability from that unit
 
I do not think I am getting what you are trying to say, but I realized I could just use a marketplace. At least I think I can.
 
try playing H.O.S.K and double click the yellow + sign in the top left and i think you will see what i was meaning
 
ahahahahaha man, the enemy treat was opposite, we made neutral passive think us as enemies......
we solved it
 
Here is the solution that I am using:

In Initialization, I added the abilities to the shops using this line:
Trigger:
  • Neutral Building - Add Blizzard to Z Abilities 0013 <gen> with 1 in stock and a max stock of 1


This is the trigger I used when a hero purchases an item:

Trigger:
  • Learn Blizzard
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Blizzard
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BoughtZ[((Player number of (Owner of (Triggering unit))) - 1)] Equal to False
        • Then - Actions
          • Set BoughtZ[((Player number of (Owner of (Triggering unit))) - 1)] = True
          • Set Ability[(((Player number of (Owner of (Triggering unit))) x 4) + 1)] = Blizzard
          • Unit - Add Blizzard to (Triggering unit)
          • Selection - Select (Triggering unit) for (Owner of (Triggering unit))
        • Else - Actions
          • Neutral Building - Add (Item-type of (Item being manipulated)) to Z Abilities 0013 <gen> with 1 in stock and a max stock of 1
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top