ACCUMULATING MONEY OVER TIME

Posts

Pages: 1
I am trying to create an event where someone can read signs out front of many houses that allows them to purchase the house to use, and purchase the house to put up for rent (like Fable). I'm wondering if there's a way when they choose to put the house up for rent, they can accumulate a small amount of money every 5 minutes or so.

Any tips are much appreciated,


Zzyxk
whoa, I clicked this expecting to see a bot or spam post. (on the subject at hand, I don't know. I haven't used XP)
author=kentona
whoa, I clicked this expecting to see a bot or spam post. (on the subject at hand, I don't know. I haven't used XP)


Hahah XD, my mistake.
shuld be simple enuf. easy as going to the common events and make a new event that is turned on by the same switch u used to check if the house was bought, then put a wait: 5000 (5 mins) and then increase ,money: 1000 or whatever. or u can wait for a random amount of time between 5 mins n 7 mins, just 2 add some flavor...
author=jamesr2
shuld be simple enuf. easy as going to the common events and make a new event that is turned on by the same switch u used to check if the house was bought, then put a wait: 5000 (5 mins) and then increase ,money: 1000 or whatever. or u can wait for a random amount of time between 5 mins n 7 mins, just 2 add some flavor...


Will that be able to continue accumulating while on other maps? Or would I need an event for each map that would count all the houses owned, calculate the amount per 5 mins and start the wait timer?
Versalia
must be all that rtp in your diet
1405
author=Zzyxk
author=jamesr2
shuld be simple enuf. easy as going to the common events and make a new event that is turned on by the same switch u used to check if the house was bought, then put a wait: 5000 (5 mins) and then increase ,money: 1000 or whatever. or u can wait for a random amount of time between 5 mins n 7 mins, just 2 add some flavor...
Will that be able to continue accumulating while on other maps? Or would I need an event for each map that would count all the houses owned, calculate the amount per 5 mins and start the wait timer?


No, you only need one event, hence a common event. Those are events that are common to all maps and can be called by other processes like battles.
author=Versalia
author=Zzyxk
author=jamesr2
shuld be simple enuf. easy as going to the common events and make a new event that is turned on by the same switch u used to check if the house was bought, then put a wait: 5000 (5 mins) and then increase ,money: 1000 or whatever. or u can wait for a random amount of time between 5 mins n 7 mins, just 2 add some flavor...
Will that be able to continue accumulating while on other maps? Or would I need an event for each map that would count all the houses owned, calculate the amount per 5 mins and start the wait timer?
No, you only need one event, hence a common event. Those are events that are common to all maps and can be called by other processes like battles.


Will there be any issues with it resetting the timer?
wat issue? it waits 5 mins and then adds 1000gil to ur money then goes back to wait for 5 mins, what issue can there be exactly i dont understnd u
author=jamesr2
wat issue? it waits 5 mins and then adds 1000gil to ur money then goes back to wait for 5 mins, what issue can there be exactly i dont understnd u

I mean when changing zones, and entering combat. I have to recall the common event and the timer would reset right?
no, make the common event a parallel process event, NOT a call event. it will turn on automatically when the "house bought" switch is turn on and then u forget about it, let it do its own thing.
author=jamesr2
no, make the common event a parallel process event, NOT a call event. it will turn on automatically when the "house bought" switch is turn on and then u forget about it, let it do its own thing.


I have done that now, it works in any zone, but i tested out going back and forth between zones with my timer set to a few seconds, and the timer still appears to reset, because the money didnt increase. Otherwise it works great.
When you go to the menu to check your gold, the common event doesn't run.
Also, when you transfer maps the common event restarts.

If you use a variable to keep track of time instead of a 'wait' command, you will not get a lag between maps. You will still get lag when you are in the menu.

Setup your Common event like:

Trigger: Parallel
Condition Switch: 0001: Rent House
Commands:
@>Control Variables: [0001:Rent Timer] += 1

@>Conditional Branch: Variable[0001:Rent Timer] >= 140
@>Control Variables: [0001:Rent Timer] = 0
@>Change Gold: +10
: Branch End
@>Wait: 1 frame(s)


for some reason, 140 seemed to work out to about 10 seconds for me. Although by calculation, it should have been 200. (5 minutes = 6000 frames)
Without the Wait command, it will run much faster.
Pages: 1