I want to create a set of triggers that will emulate a random stock market. The stock market consists of 5 different items that will go up and down in price each time a new day starts, the idea is to make as much money as possible. You sell when your item when it is worth alot (on the stock market), or buy when something is cheap. Any ideas?
Use randomized switches to make the prices fluctuate, and that's basically it. You should be able to figure out everything else by yourself.
I'm not sure what you're doing with this idea, but think of how a stock market really works. Certain events might raise/lower stocks (such as a factory explosion or something
). But if you want random, switches are the way to go.
Another possibility besides randomizing switches would be to use a running death counter. If it doesn't change too often, you could simply have a death counter always raising from 1 to 100 and resetting to 1 once it hits 101. Using this, you can create great fluctuation. If you really want to go all out for random, you can keep randomizing a switch; if it is set, add 2 to deaths, if it is clear, only add 1.
Kind of along the lines of what fritfrat said, just like if you were trying to make the life go from 1% to 100% and in between, have the price of something go from whatever to whatever with wait times in between.
Always
Cost of whatever is 5
Wait 10000 milliseconds
Cost of whatever is 10
Wait 10000 milliseconds
Cost of whatever is 15
Wait " "
Something along the lines of this!
Lol, but if you're a newb to mapmaking, you could have a critter appear somewhere, and wherever he randomely goes decides what the prices are, make sure to keep people from selling alot before the critter is done choosing!
But, if you want to do the switches, which I would recommend, here ya go:
Okay, for 4 diffrent outcomes, you need 3 switches, for 8 diffrent outcomes you need 4 switches, and 5 switches makes.... 32 outcomes...(to find out how many outcomes, subract 1 from number of switches, then do 2 to the power of the number of switches you have left)
Your map should use 4 switches, now, you use one switch to start the randomizing, so,
P1 brings 1 men to "Yo-Momma" then set switch 1
Switch 1 is set, then randomize switches 2 3 and 4 and clear switch 1
Now it's time for the diffrent combos that can turn out, 0=cleared #=set
000-Momma slaps P1(for this you have to make sure it doesn't happen all the time
###-Momma punches P1
0#0-Momma farts
#0#-Momma gets high...for some reason...
0##-Momma does a dance
#00-Momma gets fat??
00#-Momma eats beans
##0-Momma dies
So, there you go, now if you have a multi player map make sure you have a condition that makes it so only the player doing the stock gets the action, and make sure that at the end you clear all the switches, and remove whatever is making the condition other than the switches.
Hope your map goes well!
(P.S. NO ONE ADD NETHING ELSE unless it is helpful, dont try the good old, "ya, I'd use switches!" Unless you are giving him a helpful hint dont reply ne more
But the thing is, he'll need a ton of switches. If he's trying to emulate the stock market, then the price of a stoc could go from 1 cent to one thousand dollars. A measly 32 outcomes wont help at all, and frankly it would get too repetitive after awhile.
Therefore I think deathcounters are your best bet. Its still a lot of triggers (like if you did 1 to 100, it would take 102 triggers), but you'd get the most outcomes without having to think too hard.
EDIT:
And, as previously suggested, you need things that would change the stock market. The actual stock market isn't a set of random numbers. Prices get higher when a lot of people buy the stock, and they lower when a lot of people sell that stock. At the same time, lets say you invest heavily in Coka-Cola and one day a report comes out statng that Coke gives you cancer. The stock prive would obviously go down,because no one would want Coke.
In SC, you could have something like -
The Supply Depots of a major Stim Pack manufacturer spontaneously combust, leaving the area in ashes. The stocks for Stim Packs would go down because the producers would supply less than what is demanded.
On the other hand, that company's rival Stim Pack manufacturer now has more customers, which increases business and raises the stock price.
using random triggers is kinda of complex. check the tutorials section. thats how i learned how to do it and its pretty clear on how to do it once you follow the instructions! good luck