Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [RM2k3] Milliseconds "Wait" - By Variables, For advanced coding that needs that little pause...
Jirbytaylor
post May 14 2008, 03:10 PM
Post #1


Level 5
Group Icon

Group: Member
Posts: 60
Type: Artist
RM Skill: Advanced




[This was copied from another post of mine on another forum, so bear with me on any wording. :x]

Now most of us know about the "Wait" function right? Most of the time this is fine, if you want to reduce lag with a special custom system using Pictures or something similar, but what if you want to update something very quickly? You can't have lower than "0.1" with the "Wait" function, which isn't quick enough for certain things.

In my case it was a variable. I wanted to increase a variable up to create a CTB/ATB system for my "Project SOAH"'s custom battle system. CTB/ATBs are basically like the default battle system of RM2k3, or of certain Final Fantasy games.

Anywho, I wanted to increase the variable that controlled the timer bars quickly, but without a pause it either caused lag or or too quick.

So I devised a little trick to create a sort of "Wait 0.02 sec".



Instructions:
  1. Make your event that you want to use this in, note that this is best used with Parallel Processes. Add the following after your event functions. (You could add this in between some functions, but unless you know what you're doing I'd recommend not.)
  2. Create a Loop
  3. Add a "Variable Operation" that increases your specified "Wait" variable by a fair amount. I recommend "50" as here, as something about 5 causes the RPG_RT to curl over and die horribly. Make sure it is Add!
  4. Add a conditional branch that checks that your above specified variable to be Greater than or Equal to 2x the variable's addition specified. Make sure the "If Else" check is off. It is not needed.
  5. You could make the "checker" different, as I have set it to another variable so I can change the update rate - which could also be a good option for those with slower computers.
  6. In the conditional branch, add another "Variable Operation", Set (make sure it's Set!) the previously used variable to 0.
  7. Then insert a "Break Loop".


There you have it.

Any opinions or questions, ask here.


__________________________
no sig for you
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 26th May 2013 - 12:20 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker