Where to start to make an in-game economy

Where I’ll buy a place/object and it will earn money over time. New developer, so I’m willing to learn. Thank you.

Not too much to go on here with so little detail. How about this:

Once you start the MoneyMaker {T}, this actor will be making 2 money per second indefinitely unless you call MoneyMaker {F} event.

Sorry for not being clear enough. I mean something like a tycoon game where if you buy something its earns income over time. Sorry if that’s not any clearer but this does help thank you.

if you buy something its earns income
over time

That’s precisely what the example above demonstrates. As soon as you spawn the actor with the above script and start the aforementioned event, the Money integer will accumulate value over time.

To expand on this a little, lets say this is your tycoon building represented by an actor:

It makes a random 1-5 Money every 1s. It will then execute a [dispatcher][2] call to notify everyone that it has produced something. And we will print the value so we can see how much was made.

And you will have some kind of manager actor that is responsible for adding new building and counting what they produce:

  • here, we spawn 25 buildings
  • register their dispatcher calls
  • and count the money they generate (upper left corner)

Image from Gyazo

That’s the gist. The entire setup would be more convoluted, of course.

Thank you very much this is exactly what I needed. I just needed the basics so I can teach myself from there I appreciate it.