Always running event

Sykes

Villager
Member
Joined
Sep 20, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
I'm using Yanfly More currencies plugin and I am trying to set up a system with 3 different currencies to go above the 999,999 cost limit of the engine.


My problem is I don't know how to set up an event that constantly checks your cash. what I want is that when the character gets to 999 of a certain currency for the game to take that amount away and turn it into the other.


For example: if player has 999 gold and earns one more gold coin it turns it into 1 emerald coin than when you have 999 emerald coins and get 1 more it turns it into 1 ruby coin, and repeats.
 
Last edited by a moderator:

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
574
Reaction score
196
First Language
English
Primarily Uses
RMMV
The easiest way to go about this is to make a common event, which can be set up in the database. Make sure to set the common event to parallel process so it will always be running  in the background (don't choose autorun, as that will freeze all other events while it runs). A common event needs a switch to start running, but you can just have that switch activate in the starting cutscene.


From there, just set up a conditional branch to check if you have 1000 gold or more, and if so, make the player loose 1000 gold, and gain 1 ruby. 


One thing to note, parallel processes can cause lag if you have it constantly checking for things. An easy way to help relieve this is to set a wait command after each failed check. 30 or 60 frames should be fine (which means the event would activate at most half a second, to one second after you reach 1000+ gold.
 

Sykes

Villager
Member
Joined
Sep 20, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Thank you, this worked. I tried it with autorun but it would just freeze my game, now its working perfectly. Again thanks for your time :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Autorun is meant to freeze your game.  It stops the player from doing anything while a cutscene plays out.  You NEVER want to create a never-ending autorun event.


tbh I'd just get a plugin that does the adjustment every time gold is changed - either via the Change Gold event command or via the Shop window.  That way you don't need to have an event running constantly checking for something that's going to happen fairly infrequently.  
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top