1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[General] Making an item not for sale until 5 minutes after building built

Discussion in 'World Editor Help Zone' started by darwin, Mar 23, 2018.

  1. darwin

    darwin

    Joined:
    Aug 30, 2004
    Messages:
    893
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I have a merchant building that earns a profit for the player. I made an item called "recover profits" which - when purchased, gives the player 50 gold.

    Here's what I want: the merchant building should accrue this item every 5 minutes up to a maximum of 5. In other words, if you build the merchant building and then wait 25 minutes, it should have 5 in stock. You should then be able to "buy" them and recover 250 gold.

    When I put the item in the merchant building's "Techtree - Items made" line, the item appears fine, but starts with all 5 charges. I tried putting the "Stats - Stock Start Delay" to 400, but it still starts with 5 in stock at the start of the map.

    Then I tried removing the "recover profits" item from the merchant building and then adding it manually this way:

    • Sindaran Pav Built
      • Events
        • Unit - A unit owned by Player 7 (Green) Finishes construction
      • Conditions
        • (Unit-type of (Constructed structure)) Equal to Sindaran Pavilion
      • Actions
        • Animation - Change (Constructed structure)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 40.00% transparency
        • Neutral Building - Add Recover Profits to (Constructed structure) with 1 in stock and a max stock of 5


    This trigger fires fine, and the merchant building becomes semi-transparent. But the "recover profits" ability does not appear at all.

    I really would have thought this is easy, but nothing seems to be working. Does anyone understand this?

    ------------------EDIT and UPDATE--------------

    I fixed part of the problem by setting the "Stats - Can Be Sold By Merchants" to "true." This made the trigger above add "recover profits" to the merchant building. The problem remains though: even though I specified in the trigger that there should be "1" in stock, for some reason it instantly has 5.
     
    Last edited: Mar 23, 2018
  2. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,609
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    Wild guess.
    Put a wait 0.00 seconds before adding the item.

    edit: nvm read the last sentence..
     
    Last edited: Mar 23, 2018
  3. Chaosium

    Chaosium

    Joined:
    Aug 29, 2012
    Messages:
    402
    Resources:
    2
    Models:
    2
    Resources:
    2
    Check how much there is in "Stats - Stock Replenish Interval". If there is 0, my guess is that the charges instantly build up to the maximum.
     
  4. darwin

    darwin

    Joined:
    Aug 30, 2004
    Messages:
    893
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Sorry, Chaosium, I should have been more clear. The replenish interval was set at 5 minutes. It works - in that when I buy all the items it will replenish at that rate.