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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. 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.

Dynamic Economy

Discussion in 'World Editor Help Zone' started by catlover47, Feb 7, 2020.

  1. catlover47

    catlover47

    Joined:
    Apr 21, 2018
    Messages:
    18
    Resources:
    0
    Resources:
    0
    I want to make the value of an item change throughout the game based off how many of that item type have been sold recently.

    Example: A player sells 100 loaves of bread. The base price for bread is 10g, every loaf of bread sold reduces the value by 1%, so 1g every 10 loaves. We could have a max stack size of 10 so the player can only sell in increments of 10. Therefore, the first stack would net the player 100g, the second stack 90g... and then by the player's last stack the npc says "No, f you, I don't want any more of your damn bread!" and gives the player 0 gold. Then over time the price will go back up to a base price.

    What are some ways we could accomplish this?
    The first way that comes to my mind is to remove the gold gained from selling the item and then add a modified value based on a variable, but then how do I remove the special effect from selling the item as to not confuse the player? They will see it sell for 10g but then only get 9...

    Thanks!
     
  2. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,944
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Try modifying the misc file which is responsible for gold floating text. One could then trigger all such floating text if the modifications worked.

    Otherwise make all items sell for 0 and put the price in the tooltip text. That way one can entirely trigger the gold income, floating text and all.
     
  3. catlover47

    catlover47

    Joined:
    Apr 21, 2018
    Messages:
    18
    Resources:
    0
    Resources:
    0
    Do you know where that would be? I checked Gameplay Interface and couldn't find it.
     
  4. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    1,471
    Resources:
    0
    Resources:
    0
    It's a file you have to download, I uploaded it below.

    It's a basic text document that you can open in Notepad. When you edit it you'll see this at the very top:

    // gold text data
    GoldTextColor=255,255,220,255
    GoldTextVelocity=0,0.03,100
    GoldTextLifetime=2
    GoldTextFadeStart=0

    This is the information related to the Gold floating text. Note that I already edited the file and set the alpha to 255 making the gold floating text invisible. (the Alpha is the 4th number in GoldTextColor)
    If that doesn't work then try setting the GoldTextLifetime to 0 or something like 0.01 - 0.05.

    Once you're done editing the file you need to import it into your map. The filepath SHOULD be "ui\MiscData" but i'm having trouble getting it to work...
     

    Attached Files:

    Last edited: Feb 8, 2020
  5. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,944
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    That only works locally. I would recommend trying to import the file to that path as an asset inside the map. Hopefully it will effect everyone.
     
  6. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    1,471
    Resources:
    0
    Resources:
    0
    Ah, I was wondering about that. Do you know if you have to rename the file after importing it? I know with CommandFunc.txt you have to set it's name to Units\CommandFunc
     
  7. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,944
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    It has to be placed at the same path/name as it is internally inside the CASC file system.
     
  8. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    1,471
    Resources:
    0
    Resources:
    0
    Makes sense. I'll go look for it.

    Alright, found it. It looks like it's called miscdata. So the path would be "miscdata". Gonna test to see if it works.

    Edit: It's path is: war3.w3mod\ui\miscdata
    But I can't seem to get it to work... Tried all sorts of combinations.

    I tried MiscData, miscdata, ui\miscdata, ui\MiscData, and war3.w3mod\ui\miscdata
    (I don't think it's case sensitive but I tried anyway)
     
    Last edited: Feb 8, 2020
  9. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,944
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    It probably needs to be imported to...
    ui\miscdata.txt
    Since that is where it is located within the internal CASC file system.
     
  10. catlover47

    catlover47

    Joined:
    Apr 21, 2018
    Messages:
    18
    Resources:
    0
    Resources:
    0
    Thanks for the attempts. Since it sounds like that method may cause problems, I opted just to keep the effect. What I did instead was create 3 integer variables: "Value", "Supply", and "Demand".

    I set the Demand for bread to 50 loaves per player. Every time someone sells bread it increases Supply by 1. When Supply = Demand, Value -= 1. When someone sells Bread it creates a SECOND effect, which I made match the color and scroll of the original effect, just below it that displays the "Value" which will range between -Xg and +Xg. That amount of gold is then added or subtracted from the player's gold.

    Every 10 seconds the Supply will drop by 1 until it reaches 0 again. Every 10 seconds that Supply = 0 there is 10% chance Value += 1.

    Make sense? How could it be improved?
     
  11. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,944
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Check how it works with gameplay. Even if it would make economists roll their eyes (which I am not one, so maybe they would not) it does not matter as long as it enhances gameplay.