Assistance Please: Scripting a Battle System

Started by GAX, December 26, 2010, 04:39:27 am

Previous topic - Next topic

GAX

December 26, 2010, 04:39:27 am Last Edit: March 12, 2011, 05:28:37 am by Blizzard
Alright, a few people know I've been working on a battle system for a game.  So I'm figuring I'd do this in steps and hopefully have the community help me out.

Here are the basics of the battle system:
*Customizable Materia-like Command Menus
*Secondary MP Meter that applies to all actions (including the basic Attack, Defend, and Item commands) (Action Cost)
*RTAB-like game play

Here's the road map I've got drawn up to script this that I wanna focus each part into.  Starting with applying these methods to the default battle system, the steps shall be:

1. Implimenting the new Action Cost stat for player characters ONLY (enemies are not limited by this stat and therefore do not need it).
-1a. Setting up an algorithm to determine how this stat is calculated.
-1b. Making the stat visible with HP/MP
-1c. Setting up the basic ability cost structure (From individual spells to the standard Attack/Defend/Item commands)
-1d. Adding the Standby Option to the standard DBS command selection (pretty much a character passes at a CT cost)
2. Setting up the Materia-like System that allows one to equip skills instead of items.
-2a. Adding Equipment Menu for said "Materia"
-2b. Making these "Materia" appear within the character's Technique Menu in battle.
-2c. A method of limiting the number of skills that can be equipped at a time.
-2d. A method of expanding upon the above stated limit.
-2e. Making sure this all works with Part 1
3. Tweaking the Action Cost stat and implementing RTAB-like game play.
-3a. Deciding on how to determine rate at which the Action Cost meter replenishes.
-3b. Setting up so that a player can only act when the Action Cost meter is full.
4. Combo Attack setup
-4a.  Setup a part of the Battle Phase in which the player selects a series of skills that are executed in sequence in place of single abilities.
-4b.  Make sure this system can check all costs of said combo attacks so that no impossible combos occur.
5. Player Influence on the system
-5a. Implement a way for states and equipped items to increase or decrease the maximum value of a character's Action Cost meter.
-5b. Implement a way for states and equipped items to slow down or speed up the regeneration of a character's Action Cost meter.
6. Finalizing
-6a. Adjust for compatibility with BlizzAddons
-6b. Adjust for compatibility with the Advanced Chaos Rage Limit System.
-6c. Make sure this all works with Minkoff's Animated Battlers or a comparable system.

Whoever would like to help guide me towards what to do to make all this possible, that would be great.  Anyone looking to assist can post whatever part of the script they are undertaking and how to implement it here.  I want to have this shit ready already.

I don't expect someone to just make all this for me (if someone would like to that'd be great), just looking for those interested in helping me out.

Also...this is for a major project of mine so please don't hijack this system and call it your idea.  Atleast have the manhood to credit me on the concept.

If you would like to provide further assistance or work with me in real time on this, contact me at either of the following.  Please be advised that anyone who decides to spam me through any of these addresses with anything that annoys me will be warned, followed by possibly discipline here on the forums.

AIM - GuardianAngelX72 (always on)
MSN - GuardianAngel72@hotmail.com (may not be online)

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

gerrtunk

2-Check gameguys equipable skills. You just have to modifiy that script.

-5a. Implement a way for states and equipped items to increase or decrease the maximum value of a character's Action Cost meter.

This all goes in the action_cost method that calculates it. You may want to use rpgmaker default style where states % modifications are the last thing applied. I suggest looking on how atributes are calcualted, is not hard.

The Niche

You may have already thought of this, but it would be cool if the player could make their own combos.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

SBR*

Quote from: The Niche on December 26, 2010, 07:20:22 pm
You may have already thought of this, but it would be cool if the player could make their own combos.


Do you mean that when you chain two attacks together, you have to wait twice as long? That sounds pretty cool :D! Maybe certain combo's do result in an awesome hidden attack, like: High Jump + Sword Slash = Tornado Jump (twice as strong)? You could combine different characters' attacks to make new attack, like: Player A (Fire elemental guy) uses Fireball + Player B (Wind elemental guy) uses Tornado = Flame Tornado. I think I remember that from Sonic: the Dark Brotherhood (I stopped playing that, because I dislike Turn Based Battle Systems, but I might start playing it again...).

If you're going to implement that, this might be the first RTAB I'd ever use :D!

Cya :urgh:!

GAX

December 30, 2010, 06:43:44 am #4 Last Edit: December 30, 2010, 06:45:51 am by The One and Only GAX72
Okay, looks like some people didn't get what I meant...

The main purpose for this thread is going to be two fold:
1 - I get a system I desperately need for my game out of the way and
2 - Allows the community to put together a script in steps that could easily be adapted later into something like a tutorial and assist others in learning how scripting works in real time rather than reading the standard posts.

Seriously, every "learn to script" post I've read is nothing but a dictionary and that's not how a lot of people (myself included) learn.  We like to learn through doing!

Quote from: SBR* on December 28, 2010, 04:49:15 am
Quote from: The Niche on December 26, 2010, 07:20:22 pm
You may have already thought of this, but it would be cool if the player could make their own combos.


Do you mean that when you chain two attacks together, you have to wait twice as long? That sounds pretty cool :D! Maybe certain combo's do result in an awesome hidden attack, like: High Jump + Sword Slash = Tornado Jump (twice as strong)? You could combine different characters' attacks to make new attack, like: Player A (Fire elemental guy) uses Fireball + Player B (Wind elemental guy) uses Tornado = Flame Tornado. I think I remember that from Sonic: the Dark Brotherhood (I stopped playing that, because I dislike Turn Based Battle Systems, but I might start playing it again...).

If you're going to implement that, this might be the first RTAB I'd ever use :D!

Cya :urgh:!


This may come into play at a later time but the combo system is pretty much doing a chain of commands.  I might at some point add in finishing attacks that'll be used at the ends of certain combos for extra damage, but I wanna take care of the above first.

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

SBR*

Quote from: The One and Only GAX72 on December 30, 2010, 06:43:44 am
Spoiler: ShowHide

Okay, looks like some people didn't get what I meant...

The main purpose for this thread is going to be two fold:
1 - I get a system I desperately need for my game out of the way and
2 - Allows the community to put together a script in steps that could easily be adapted later into something like a tutorial and assist others in learning how scripting works in real time rather than reading the standard posts.

Seriously, every "learn to script" post I've read is nothing but a dictionary and that's not how a lot of people (myself included) learn.  We like to learn through doing!

Quote from: SBR* on December 28, 2010, 04:49:15 am
Quote from: The Niche on December 26, 2010, 07:20:22 pm
You may have already thought of this, but it would be cool if the player could make their own combos.


Do you mean that when you chain two attacks together, you have to wait twice as long? That sounds pretty cool :D! Maybe certain combo's do result in an awesome hidden attack, like: High Jump + Sword Slash = Tornado Jump (twice as strong)? You could combine different characters' attacks to make new attack, like: Player A (Fire elemental guy) uses Fireball + Player B (Wind elemental guy) uses Tornado = Flame Tornado. I think I remember that from Sonic: the Dark Brotherhood (I stopped playing that, because I dislike Turn Based Battle Systems, but I might start playing it again...).

If you're going to implement that, this might be the first RTAB I'd ever use :D!

Cya :urgh:!


This may come into play at a later time but the combo system is pretty much doing a chain of commands.  I might at some point add in finishing attacks that'll be used at the ends of certain combos for extra damage, but I wanna take care of the above first.



I didn't actually fully read your first post, but now I've re-read it (I skipped the parts I had already read, though) :D. I don't really join group scripting projects and I have to work on REMEXOS too. Also, I think I'm not ready for this yet, as I haven't scripted a single Battle System. So I can't help you out...

Cya :urgh:!

G_G

Quote from: SBR* on December 30, 2010, 08:29:03 am
Quote from: The One and Only GAX72 on December 30, 2010, 06:43:44 am
Spoiler: ShowHide

Okay, looks like some people didn't get what I meant...

The main purpose for this thread is going to be two fold:
1 - I get a system I desperately need for my game out of the way and
2 - Allows the community to put together a script in steps that could easily be adapted later into something like a tutorial and assist others in learning how scripting works in real time rather than reading the standard posts.

Seriously, every "learn to script" post I've read is nothing but a dictionary and that's not how a lot of people (myself included) learn.  We like to learn through doing!

Quote from: SBR* on December 28, 2010, 04:49:15 am
Quote from: The Niche on December 26, 2010, 07:20:22 pm
You may have already thought of this, but it would be cool if the player could make their own combos.


Do you mean that when you chain two attacks together, you have to wait twice as long? That sounds pretty cool :D! Maybe certain combo's do result in an awesome hidden attack, like: High Jump + Sword Slash = Tornado Jump (twice as strong)? You could combine different characters' attacks to make new attack, like: Player A (Fire elemental guy) uses Fireball + Player B (Wind elemental guy) uses Tornado = Flame Tornado. I think I remember that from Sonic: the Dark Brotherhood (I stopped playing that, because I dislike Turn Based Battle Systems, but I might start playing it again...).

If you're going to implement that, this might be the first RTAB I'd ever use :D!

Cya :urgh:!


This may come into play at a later time but the combo system is pretty much doing a chain of commands.  I might at some point add in finishing attacks that'll be used at the ends of certain combos for extra damage, but I wanna take care of the above first.



I didn't actually fully read your first post, but now I've re-read it (I skipped the parts I had already read, though) :D. I don't really join group scripting projects and I have to work on REMEXOS too. Also, I think I'm not ready for this yet, as I haven't scripted a single Battle System. So I can't help you out...

Cya :urgh:!


Great time to start learning how to make a battle system.

SBR*

Quote from: game_guy on December 30, 2010, 10:33:17 am
Quote from: SBR* on December 30, 2010, 08:29:03 am
Quote from: The One and Only GAX72 on December 30, 2010, 06:43:44 am
Spoiler: ShowHide

Okay, looks like some people didn't get what I meant...

The main purpose for this thread is going to be two fold:
1 - I get a system I desperately need for my game out of the way and
2 - Allows the community to put together a script in steps that could easily be adapted later into something like a tutorial and assist others in learning how scripting works in real time rather than reading the standard posts.

Seriously, every "learn to script" post I've read is nothing but a dictionary and that's not how a lot of people (myself included) learn.  We like to learn through doing!

Quote from: SBR* on December 28, 2010, 04:49:15 am
Quote from: The Niche on December 26, 2010, 07:20:22 pm
You may have already thought of this, but it would be cool if the player could make their own combos.


Do you mean that when you chain two attacks together, you have to wait twice as long? That sounds pretty cool :D! Maybe certain combo's do result in an awesome hidden attack, like: High Jump + Sword Slash = Tornado Jump (twice as strong)? You could combine different characters' attacks to make new attack, like: Player A (Fire elemental guy) uses Fireball + Player B (Wind elemental guy) uses Tornado = Flame Tornado. I think I remember that from Sonic: the Dark Brotherhood (I stopped playing that, because I dislike Turn Based Battle Systems, but I might start playing it again...).

If you're going to implement that, this might be the first RTAB I'd ever use :D!

Cya :urgh:!


This may come into play at a later time but the combo system is pretty much doing a chain of commands.  I might at some point add in finishing attacks that'll be used at the ends of certain combos for extra damage, but I wanna take care of the above first.



I didn't actually fully read your first post, but now I've re-read it (I skipped the parts I had already read, though) :D. I don't really join group scripting projects and I have to work on REMEXOS too. Also, I think I'm not ready for this yet, as I haven't scripted a single Battle System. So I can't help you out...

Cya :urgh:!


Great time to start learning how to make a battle system.


Although I've never scripted one yet, I HAVE looked at the SBS and I think I kinda get how it works. I haven't looked at it for a long time though, just a small glance :D.

I think I might script one someday, but REMEXOS and... Sigh...

Cya :urgh:!

GAX

G_g, homie, you wanna help with this?

Anyways, here's what I figure should be the first part of the project since it's actually the important piece:

So on to step 1!
The current algorithym for the base maximum Action Cost is going to be ((AGI+INT)-(Level/2)).  This may get adjusted later but for starters this should work.

So yeah, I need the following information:
1 - Should I put this directly into the default scripts or should I start on an entirely separate script?
2 - If making an entirely separate script, should I copy-pasta from a default script and if so where?
3 - How should I write the basic algorithym into play so the stat exists on each character but not on enemies?
4 - How would I make the stat appear in the default battle system?

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

ForeverZer0


1
  • It is common practice, and practical to never actually modify the default scripts. There are a few exceptions, like you are preparing release your game, then it is more efficient to consolidate all the methods. If you plan on ever releasing the script, it would be a good idea to keep everything seperated. Remember that if a method is defined twice, the one farthest down in the Script Editor will overwrite all the previous ones, and only it will be used.

2
  • The usual place to create new scripts is below all the default scripts, except for a few instances where above all scripts. I don't quite understand what mean by "copy-pasting".

3
  • You can do the algo a number of ways. However you decide to alter it, you can differientiate between actors and enemies by using the "is_a?" function. Here's an example:

class Game_Battler
  def agi
    if self.is_a?(Game_Actor)
      n = WHATEVER YOUR CUSTOM ALGO IS
    elsif # Enemy
      n = [[base_dex + @dex_plus, 1].max, 999].min # Normal way
    end
    for i in @states
      n *= $data_states[i].dex_rate / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end  end
end

    [/li]

4
  • The code above would modify the default battle system. Most CBSs still use the core parameters for actors, etc.

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

GAX

What I mean by Copy-paste is making a copy of a default script that will be modified in order to create the new script.

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

G_G

@GAX: I might help. When I head back to Rapid, I'll have quite a bit of time on my hands without the internet consuming my time and keeping me distracted.

GAX


Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

ForeverZer0

No, you don't need to copy-paste the original. You can modify existing scripts by defining new methods, or over-writing old ones in any other script, as long as it comes after the original.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

GAX

Could you give me an example please?  Sorry but the last time I attempted this I turned my game into a minefield (just ask Aqua).

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

ForeverZer0

Quote from: The One and Only GAX72 on January 10, 2011, 09:46:29 pm
Could you give me an example please?  Sorry but the last time I attempted this I turned my game into a minefield (just ask Aqua).


Just pick practically any demo out of the database and see how it is configured.


I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

The Niche

Thought of something about the combo system. It'd be easy enough to event.

Skill: Combo 1
No effect.
Call common event: Combo 1

Common event: Combo 1

Control variables[Variable] = Actor [insert here]'s sp
cnd branch: [Variable] < [Total sp cost for all skills in the combo]
Show text: You don't have enough SP.
Else
Force action: Actor [insert here] use skill [skill]
#Haven't done anything with the DBS so I don't know if forced actions removes sp or not. If it doesn't, then subtract the sp cost of the skill from [Variable]
#Also, does forced actions take a turn? If so, then just repeat the last line until you reach the end of the combo. Otherwise, I don't know how to make it wait. Mebbes a regular wait command does that?
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

GAX

Quote from: The Niche on January 20, 2011, 08:01:24 am
Spoiler: ShowHide
Thought of something about the combo system. It'd be easy enough to event.

Skill: Combo 1
No effect.
Call common event: Combo 1

Common event: Combo 1

Control variables[Variable] = Actor [insert here]'s sp
cnd branch: [Variable] < [Total sp cost for all skills in the combo]
Show text: You don't have enough SP.
Else
Force action: Actor [insert here] use skill [skill]
#Haven't done anything with the DBS so I don't know if forced actions removes sp or not. If it doesn't, then subtract the sp cost of the skill from [Variable]
#Also, does forced actions take a turn? If so, then just repeat the last line until you reach the end of the combo. Otherwise, I don't know how to make it wait. Mebbes a regular wait command does that?




Not really looking for recommendations on how to adjust this system quite yet.  The purpose of the combo system is giving Chaotic Fury a new feel.  Rather than just entering one attack you set a chain of attacks that are executed in sequence.  Each character has a limited number of attacks they can equip at a time and a secondary sp-like stat that not only determines how many attacks they can executed, but the time between their turns (as your next turn comes up when your CT meter reaches full.  Enemies will probably need a CT meter but it's just going to be a standard 100% meter that fills based on their agility and they can only use one attack per turn).

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

GAX

Quote from: ForeverZer0 on January 10, 2011, 09:50:35 pm
Quote from: The One and Only GAX72 on January 10, 2011, 09:46:29 pm
Could you give me an example please?  Sorry but the last time I attempted this I turned my game into a minefield (just ask Aqua).


Just pick practically any demo out of the database and see how it is configured.





(Can't believe I took this long to reply)
While I tried this method all it did was confuse the fuck out of me and I ended up causing all kinds of hell within my project.

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

Ryex

from what I gather your at the point where you know most all the ruby syntax you can,and your trying to make the mental leap to knowing syntax to knowing how to actual make something from the ground up (or even from a base).

I can only offer one bit of advise. get out some pencil and paper and conceptually break down the system you want into logical parts. the smaller you can make those parts and the more specialized you can make their tasks, the easier it will be to make.

stare with the big object. the battle scene, then break it up into things like the display and the data. break the data down into, enemies and actors. break each of those down into their stats and actions. have some sore of processor that you feed that data into the modify it (battle results). break the processor down into it's parts. 

in the beginning this is the best way to start understanding how to actually make something out of the simple operations you learn when the language tutorials teach you syntax. 

an added benefit of doing this is it become much easier to help you. it's a lot easier to explain how to make two small parts of a system that the entire thing.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />