Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Request: ATB And Percentage bar assistance for Custom Battle System
« previous next »
  • Print
Pages: [1] 2

Author Topic: Request: ATB And Percentage bar assistance for Custom Battle System  (Read 4289 times)

Offline Dragoon de Sol

  • Common sense isn't very common
  • Agent
  • *
  • Posts: 800
Request: ATB And Percentage bar assistance for Custom Battle System
« on: November 01, 2007, 05:31:58 AM »
Okay, I can't get to the RPG Maker Programming area, so this'll have to do.

I need help with two things.

1. I need help on how to code an ATB bar that determines when a character/enemy can act.

2. I need help on how to code bars that measure percentages of amounts, such as HP/MP.
Logged

Offline Ben

  • Some dude
  • Staff
  • Royal
  • *
  • Posts: 4,844
  • butts
    • my portfolio
(No subject)
« Reply #1 on: November 01, 2007, 05:38:25 AM »
2k3 or xp?
Logged

Offline Dragoon de Sol

  • Common sense isn't very common
  • Agent
  • *
  • Posts: 800
(No subject)
« Reply #2 on: November 01, 2007, 03:07:22 PM »
Heh..oops.

2K3.
Logged

Offline Ben

  • Some dude
  • Staff
  • Royal
  • *
  • Posts: 4,844
  • butts
    • my portfolio
(No subject)
« Reply #3 on: November 01, 2007, 04:10:20 PM »
i am of no help to you then... Gemini is XP compatible onry.
Logged

Offline Dragoon de Sol

  • Common sense isn't very common
  • Agent
  • *
  • Posts: 800
(No subject)
« Reply #4 on: November 01, 2007, 04:17:13 PM »
Dammit.
Logged

Offline Dominicy

  • All men play on ten!
  • Leader
  • *
  • Posts: 2,852
(No subject)
« Reply #5 on: November 01, 2007, 06:36:37 PM »
It all depends on how specific you want the ATB bar.  such as add one to a variable called "Character 1 ATB" and have a conditional branch that asks if the variable is atleast one.  if it is, display picture "Character 1 ATB bar 1" or something, and keep doing that up until you reach how ever much you want, such as up to 10 or 20.  That's the best I can do for now..
Logged

Offline Moosetroop11

  • Sage
  • *
  • Posts: 7,398
(No subject)
« Reply #6 on: November 01, 2007, 08:10:17 PM »
MOVED.

You got the main page problem too huh? Sucks. I hear firefox can load it fine.
Logged
Maaaaaaaaaaaaaaaaaaaaaaaaaaan I missed this place.

Quote from: drenrin2120
Maaaaaaaaaaaaaaaaaaan I missed you.

Quote from: fruckert
Maaaaaaaaaaaaaaan I missed that welcome.

Offline RPG noob

  • Member
  • Initiate
  • *
  • Posts: 36
(No subject)
« Reply #7 on: November 01, 2007, 09:04:20 PM »
This should help for the percentages

 
Quote
If you thought of cross multiplying, you were right. For those of you who don't know, cross multiplying is the term for the metheod we'll use to solve this. Lets say the hero has 2 life left our of 10. And we're trying to find the percentage of that. Heres what the coding would look like.  [percentage] = hero current life (2)  [percentage] times 100 (percentage)  [percentage] / hero complete life (10)    we have 2, times 100 = 200, divided by 10 = 20.  Thus, we'll get 20% as the amount of life left.    Whenever you want to find a value that you can't get by using the variable options command (percentage for example) you need an algorithm to find the value. You need to think of what it needs to accomplish, and what you have to work with.


Then you would have a conditional branch that checks what the percent is and show the picture accordingly.

On a side note I can't get on the main page either using opera
Logged

Offline Dragoon de Sol

  • Common sense isn't very common
  • Agent
  • *
  • Posts: 800
(No subject)
« Reply #8 on: November 01, 2007, 09:27:49 PM »
Thanks RN. Now all I need is the ATB. I know how to work the bar, just not how to determine how it fills. Do I measure seconds or what?
Logged

Offline RPG noob

  • Member
  • Initiate
  • *
  • Posts: 36
(No subject)
« Reply #9 on: November 01, 2007, 11:00:56 PM »
You want an event that loops with a condition switch           (switch 1 on) which counts a seconds variable up to how ever many seconds you want until the players turn e.g 10.  When it reaches 10 seconds make the event stop (switch 1 off) and show the commands.  When the character has used a command flick the switch on and set the timer variable back to 0 and hopefully the process will start again.

Sorry if thats a bit hard to understand
Logged

Offline Dragoon de Sol

  • Common sense isn't very common
  • Agent
  • *
  • Posts: 800
(No subject)
« Reply #10 on: November 01, 2007, 11:52:09 PM »
Hmm...I see what you mean now.

We need to get your name changed from Noob to something else ^_^
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #11 on: November 02, 2007, 01:39:38 AM »
Quote
Originally posted by RPG noob
You want an event that loops with a condition switch           (switch 1 on) which counts a seconds variable up to how ever many seconds you want until the players turn e.g 10.  When it reaches 10 seconds make the event stop (switch 1 off) and show the commands.  When the character has used a command flick the switch on and set the timer variable back to 0 and hopefully the process will start again.

Sorry if thats a bit hard to understand


I would advise against this method because usually you want the atb gauge to fill up according to the characters speed/agility. So if you want to have it fill up according to their agility, do something like this.

Find out the maximum agility a character can have, by defualt its 999; however, your game may only go up to 100 or 500. Once you find this number, set a variable [hero1ATB] equal to it, then make it a little bigger. So if your highest is 999, set [hero1ATB] equal to 1010 (or something like that). After you have it set to the correct value, subtract the heros agility from [hero1ATB]. If the agility of the hero was maxed out at 999, the number will be very small (11), but if the agility was low such as 10, the number will be really high at 1000.

After you get this new number for [hero1ATB] make a parallel process event for the ATB. Every .1 seconds, add a number to a new variable called [hero1ATBadd]. Lets say this number is 10. Every time you add 10 to [hero1ATBadd], check with a conditional branch for if [hero1ATBadd] is greater than or equal to [hero1ATB]. If it is, then turn a switch [hero1turn] ON (or do whatver you want to do in order for the hero to take its turn. So if [hero1ATB] is 11, it'll be the heros turn every .2 seconds. if [hero1ATB] is 1000, it'll take 10 seconds for the hero to take its turn. By balancing the number you add (10) and the max agility (1010), you can control how fast you want the heros bar to fill on the various levels.

You can do this for multiple characters, just make sure that the max number is the same for all of them.

In the end, the code will look something like this.

[hero1ATB] = 1010
subract hero1 agility from [hero1ATB]
Label 1
wait .1 seconds
[hero1ATBadd] + 10
if [hero1ATBadd] is greater than or equal to [hero1ATB]
--(take a turn)
else
--jump to label 1

you'll want to turn that code off while its the heros turn, i learned that the hard way...
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN

Offline Dragoon de Sol

  • Common sense isn't very common
  • Agent
  • *
  • Posts: 800
(No subject)
« Reply #12 on: November 02, 2007, 01:49:53 AM »
Thanks for the tip, man.
Logged

Offline RPG noob

  • Member
  • Initiate
  • *
  • Posts: 36
(No subject)
« Reply #13 on: November 02, 2007, 03:06:53 PM »
nice one db I didn't think about agility lvl lol... serves me right for trying to figure it out really late  :D
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #14 on: November 03, 2007, 03:23:29 AM »
Lol, on my first cbs agility didn't play a role in it either. Then when I first started adding agility, it was a mess...
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN

  • Print
Pages: [1] 2
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Request: ATB And Percentage bar assistance for Custom Battle System
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum