The Daily Click ::. Forums ::. Klik Coding Help ::. how do you make speed affect turns in an RPG battle system?
 

Post Reply  Post Oekaki 
 

Posted By Message

NMasutaa



Registered
  26/12/2004
Points
  301
29th May, 2007 at 16:10:49 -

Though progressing quite a bit on the RPG I'm making, I'm kinda lost as to how to actually implement turns into a turn-based battle system. How do you make it so that the fastest character attacks first, and then is followed by the slowest?

That's my main concern, but I'm also wondering if there's a good way to make it so that faster characters can attack more times than slower ones.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
29th May, 2007 at 17:50:02 -

In everytime I've done something like this, I've set the characters speed to it's max, then have everyone's speed count down. First one to reach 0 goes, then after they make their move, their speed is reset to the max and the process begins again.

 
Craps, I'm an old man!

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
29th May, 2007 at 17:53:21 -

surely setting it to the max and counting down would result in the slower ones going first?
Unless you meant (max speed - character speed) as a value to count down from.

[Rest of post omitted because of the above being more useful]

Image Edited by the Author.

 
My signature is never too big!!!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
29th May, 2007 at 18:02:26 -

I usually do it in reverse with my things, someone with 63 speed would go quicker than 80. I usually call it delay, but yeah, it's easy enough to reverse.

 
Craps, I'm an old man!

NMasutaa



Registered
  26/12/2004
Points
  301
29th May, 2007 at 18:25:48 -

Yeah, looks like it'd probably work. Thanks! But just to make sure, what if two characters reach 0 at the same time?

 
n/a

Neuro

Ludologist

Registered
  29/10/2006
Points
  437

Game of the Week WinnerVIP MemberI'm on a BoatPokemon Ball!
29th May, 2007 at 18:45:51 -

If two speed values are the same, add/subtract random(2) to the speed value? Perhaps 'pick one of', but I'm not sure how that would work with the system you have.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
29th May, 2007 at 18:57:06 -

Just have both characters do their things, then restart the loop right after.

 
Craps, I'm an old man!

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
30th May, 2007 at 13:20:42 -

You also might not want to have the order "hard coded" by speed all the time. It may get boring if all the characters and enemies always attack in exactly the same order (barring a speed stat increase or whatever). You may want to have everyone's speed randomized at the start of the battle with their speed stat the maximum possible. (use dummy variables so you won't screw up their actual stats) If you do it this way, the players with the higher speed will MORE THAN LIKELY BUT NOT ALWAYS attack before the slower guys. This method also gives your slow warrior the chance to land a hit on the enemy before Mr. Elfish Swiftypants with the fruity bow n' airrahs!

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
30th May, 2007 at 14:25:43 -

Actually, there's even better ways to do it. Each action could have a set amount of speed that it adds/subracts (depending on how you're doing it). Getting stunned could reset the value to max. Etc. Etc.

 
Craps, I'm an old man!
   

Post Reply



 



Advertisement

Worth A Click