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 »
  • Atb
« previous next »
  • Print
Pages: [1] 2

Author Topic: Atb  (Read 5571 times)

Offline DarkGoten

  • Gfx master
  • Initiate
  • *
  • Posts: 15
Atb
« on: September 25, 2006, 12:29:08 AM »
Ok this is something that I never have done before I can do everything els, cbs,cms,8-driectional movement you name it.

But lately i'v wanted a atb in my combat system well iv had no luck getting the atb to work yes I know 1 way by using variables but not the way I wish to use them.

What I want is a atb that works with your hero's speed and your enemy's speed if your stronger your atb moves faster and if your weaker your atb moves slower.

If dragonblaze could help that'd be nice^^

Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #1 on: September 25, 2006, 12:41:16 AM »
Lol, its actualy easier than you may think ;)

Ok, first make a variable (lets call it speed), set it equal to the heros speed/agility.
Set a variable (lets call it max speed)...

Meh, just make a code that looks like this.

speed = hero1 speed
max speed = 0
label 1
max speed + hero1 speed
wait .5 seconds
if max speed > 2000
 action
else
 jump to label 1
end

Then since you say you can code a cbs and such, I'm guessing you'll know how to display a bar with that information. :)

Well thats the basic code. If heros speed is 100, it'll take 10 seconds to fill up. If you want it to fill faster, you can either reduce the wait time or reduce the 2000 number to something smaller.

If you need any more help with this, just let me know.
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 DarkGoten

  • Gfx master
  • Initiate
  • *
  • Posts: 15
(No subject)
« Reply #2 on: September 25, 2006, 12:53:17 AM »
Is that really how you did it?

And also wouldn't the hero's speed have to deal with the enemy's speed so it moves accordinaly[god I suck at spelling><]
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #3 on: September 25, 2006, 12:59:36 AM »
Nah, I did it some long complicated wierd messed up way...

If you want, i can cook up a tutorial that figures in the enemies speed and the heros speed together and if one character has a really high speed, the other characters and enemies will move slower because of it, the same would be true if an enemy had a really high speed.

It'll require a fair amount of algebra, and I'm guessing it'll be pretty long, but I can get it up tomarrow.
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 DarkGoten

  • Gfx master
  • Initiate
  • *
  • Posts: 15
(No subject)
« Reply #4 on: September 25, 2006, 01:01:23 AM »
That would be great and thanks^^
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #5 on: September 25, 2006, 10:55:16 PM »
Sorry this is kind of late, I was held up at school and football practice all day. Anyway, I planned and wrote this out during math class today (todays lesson was really boring). I didn't test this out at all yet, I think it'll work. At least it works in my head :p If it doesn't work, it's probably some syntax mistake, but I'm hoping that even if it doesn't work right, that you'll get the right idea on how it should go. This doesn't involve as much algebra as I originally thought it would. I WAS going to calculate all the speeds, make a wisker plot graph with the results, calculate the results into the wiscer plot, then give the actors speed bonuses or deductions based on where their speed was within the graph, luckily, I found an easier way to do it (though its really not much easier or differant).

Anyway, I'll post the code first, then I'll explain some things.

First, you need to find a speed average. I dont know how you have your speed stored or whatnot, so this first part is only my suggestion, there may be a better way to do it depending on how your system is set up.

Note: items in [ ] are variables or switches

If hero1 is in party
-[total] + hero1 speed
-[actors] + 1
end
If hero2 iss in party
-[total] + hero2 speed
-[actors] + 1
end
(repeat the same process for all the heros.
If monster 1 is in the battle
- [total] + monster1 speed
- [actors] + 1
end
(repeat for the number of monsters that can be on the field at a time)

[Total] / [actors] (gets the average speed of all the actors in the battle)

[bonus] = h1 speed
[bonus] * 10
[bonus] / [total]
If [bonus] > 10
- [bonus] - 1
end
If [bonus] < 10
- [bonus] + 1
end
[H1 speed var] = h1 speed
[H1 speed var] * 10
[H1 speed var] / [bonus]

[bonus] = h2 speed
[bonus] * 10
[bonus] / [total]
If [bonus] > 10
- [bonus] - 1
end
If [bonus] < 10
- [bonus] + 1
end
[H2 speed var] = h2 speed
[H2 speed var] * 10
[H2 speed var] / [bonus]

(repeat for all the heros on the field)

[bonus] = enemy1 speed
[bonus] * 10
[bonus] / total
If [bonus] > 10
- [bonus] - 1
end
If [bonus] < 10
- [bonus] + 1
end
[E1 speed var] = enemy1 speed
[E1 speed var] * 10
[E1 speed var] / [bonus]

(repeat for all monsters on the field)

Label 1

If [H1 turn] Is OFF
- [h1 total] + [h1 speed var]
end
If [H2 turn] is OFF
- [h2 total] + [h2 speed var]
end
(repeat for all heros on the field)
If [e1 turn] is OFF
- [e1 total] + [e1 speed var]
end
(repeat for all enemies on the field)
If [h1 total] = 2000
-[h1 turn] set to ON
-[h1 total] = 0
end
If [h2 total] = 2000
-[H2 turn] set to ON
-[h2 total] = 0
end
(repeat for all heros on the field at a time)
If [e1 total] = 2000
- [e1 turn] set to ON
- [e1 total] = 0
end
(repeat for all enemies on the field at a time)
wait .1 or .2 seconds
Jump to label 1

end

Anyway.. so what this will do. It takes the average speed of all the actors (party members and enemies) on the field and finds the average for that. Any actor with a speed 10% higher or lower than the average will have their atb fill up at a normal rate. If the actor has a speed from 10% to 20% higher or lower, they're atb bar will fill up 10% slower or faster. For every 10% differance there is, there is a 10% increase or decrease in the amount of time it'll take in order for the time bar to fill up. Unless the speed is negitive, the slowest a time bar can fill up is 10% of normal (which is pretty slow).

If you want the the effects to start if the actor has a speed 20% higher or lower than the average, change the part where it adds or subtracts 1 from [bonus], and change the 1 to 2.

Lets say you're fighting a boss that has a really high speed, and you have 3 heros. Since there is only 1 actor with a high speed, the average will be closer to the hero's speed (assuming there are 3 to 4 heros). The heros won't recive that much of a negitive effect, but the boss will recive a big bonus effect.

Lets say you're fighting a group of monsters with relitively the same speed as you, no one will revice a bonus.

Lets say one of your heros is really slow, but all the other actors are fast, the one hero will slow down a lot, but the other actors won't really recive much of a speed bonus.



I think this is what you wanted, if you need any more help, let me know.
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 I Have a Sandwich

  • I'm Not ZKX. Quit it, I'm tired of it
  • Exemplar
  • *
  • Posts: 1,498
(No subject)
« Reply #6 on: September 25, 2006, 11:04:16 PM »
Wow DB. That was boring :P
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #7 on: September 25, 2006, 11:36:12 PM »
Indeed... Though, writing and planning that was much more enjoyable than any math homework...

Hmm, why is it that everyone is stealing everyone elses avatars and sigs now? MIC stole aces, now you stole White Dwarfs... whos next?
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 I Have a Sandwich

  • I'm Not ZKX. Quit it, I'm tired of it
  • Exemplar
  • *
  • Posts: 1,498
(No subject)
« Reply #8 on: September 25, 2006, 11:47:39 PM »
Why, whatever do you mean?
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #9 on: September 25, 2006, 11:54:24 PM »
Quote
Originally posted by I Have a Sandwich
Why, whatever do you mean?


Haha, I tricked you into advertising my site and game for me, mwahahaha!
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 Meiscool-2

  • Sage
  • *
  • Posts: 7,030
  • If you support n00bs, you support communism.
(No subject)
« Reply #10 on: September 25, 2006, 11:57:56 PM »
Man, everyone be copying me. First I steal Ace's, then CK steal's Tomi's, then Tomi steals IHAS's, then IHAS steals WhiteDwarf's. Soon, no one will look like the person they stole from, and my plan will be complete.
Logged
Most Recent:

________________________
Old Stuff:

Offline I Have a Sandwich

  • I'm Not ZKX. Quit it, I'm tired of it
  • Exemplar
  • *
  • Posts: 1,498
(No subject)
« Reply #11 on: September 26, 2006, 12:02:45 AM »
Quote
Originally posted by DragonBlaze
quote:
Originally posted by I Have a Sandwich
Why, whatever do you mean?


Haha, I tricked you into advertising my site and game for me, mwahahaha!


Or did I trick you into changing your sig? The mouse becomes the cat my friend, muaha!

n mic u not make up u cpy kij so u r lamzorz
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #12 on: September 26, 2006, 12:14:04 AM »
Quote
Originally posted by I Have a Sandwich
quote:
Originally posted by DragonBlaze
quote:
Originally posted by I Have a Sandwich
Why, whatever do you mean?


Haha, I tricked you into advertising my site and game for me, mwahahaha!


Or did I trick you into changing your sig? The mouse becomes the cat my friend, muaha!

n mic u not make up u cpy kij so u r lamzorz


Actually, I just wanted to add my dragon code to my sig, and it said it took up to many lines, so I took my cbs progress out. It wasn't really doing any good there anywayz.
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 I Have a Sandwich

  • I'm Not ZKX. Quit it, I'm tired of it
  • Exemplar
  • *
  • Posts: 1,498
(No subject)
« Reply #13 on: September 26, 2006, 12:18:56 AM »
Quote
Originally posted by DragonBlaze
quote:
Originally posted by I Have a Sandwich
quote:
Originally posted by DragonBlaze
quote:
Originally posted by I Have a Sandwich
Why, whatever do you mean?


Haha, I tricked you into advertising my site and game for me, mwahahaha!


Or did I trick you into changing your sig? The mouse becomes the cat my friend, muaha!

n mic u not make up u cpy kij so u r lamzorz


Actually, I just wanted to add my dragon code to my sig, and it said it took up to many lines, so I took my cbs progress out. It wasn't really doing any good there anywayz.


All I heard was "Sammich pwnd me so bad" XD
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #14 on: September 26, 2006, 12:28:28 AM »
Quote
Originally posted by I Have a Sandwich
quote:
Originally posted by DragonBlaze
quote:
Originally posted by I Have a Sandwich
quote:
Originally posted by DragonBlaze
quote:
Originally posted by I Have a Sandwich
Why, whatever do you mean?


Haha, I tricked you into advertising my site and game for me, mwahahaha!


Or did I trick you into changing your sig? The mouse becomes the cat my friend, muaha!

n mic u not make up u cpy kij so u r lamzorz


Actually, I just wanted to add my dragon code to my sig, and it said it took up to many lines, so I took my cbs progress out. It wasn't really doing any good there anywayz.


All I heard was "Sammich pwnd me so bad" XD


 :(  *cries*

I think its funny how we're just spamming this topic :p
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 »
  • Atb
 

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