• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Dynamic Economy

Status
Not open for further replies.
Level 3
Joined
Apr 21, 2018
Messages
18
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!
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,178
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...
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.
 
Level 3
Joined
Apr 21, 2018
Messages
18
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.

Do you know where that would be? I checked Gameplay Interface and couldn't find it.
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
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...
 

Attachments

  • MiscData.txt
    9.6 KB · Views: 38
Last edited:

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
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
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
It has to be placed at the same path/name as it is internally inside the CASC file system.
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:
Level 3
Joined
Apr 21, 2018
Messages
18
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?
 
Status
Not open for further replies.
Top