Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to Add Blitz Skills

khmp

Sponsor

Ok let's start with a default project for the sake of this example. Let's make it so if we quickly press "Up, Down, then C" we allow skill 17 to reach it's maximum potency. That skill being "Greater Water" in a default XP project. The code to add this functionality is really simple. Locate within the Blitz script this line:
Code:
  T_SKILL = {

This is the beginning of the Hash that holds the information we want to add to. Every element within a hash is separated by a comma. A key in this case a skill id points to another piece of data. In this case that data is an Array that may hold three things. First an Array then a Fixnum then an optional Fixnum. So here's an empty sample of what we will be dealing with:
Code:
Skill_ID => [[], (, optional)],

So we know the skill id and it's 17. We know the key presses to make it work at full capacity. "Up, Down, then C"
Code:
17 => [[Up, Down, C], ],

The last thing we need that isn't optional is what percentage to nerf the skill if the key presses aren't activated properly. Let's make it so the skill only works at 75% the maximum if they fail with the keypresses.
Code:
17 => [[Up, Down, C], 75],

Now according to the documentation at the top of the script if the skill "fails" meaning the keypresses weren't executed in time you can show an animation. To do that just place an additional element within the array linked to the id of the animation you would like to show. I want to show "Special Move" if the skill fails and that animation's id is 1. So that means that our "Greater Water" skill code is looking like this:
Code:
17 => [[Up, Down, C], 75, 1],

We can now add our skill into the Hash object T_SKILL. To do this we just need to append it onto the bottom but really it can go anywhere. If there is already an entry at the same key(skill id) the later one is the one that will take effect. Lastly stick a comma on the end of the line we have above. And make sure you place a comma after every entry even if it's the last one. It'll save you some headaches when you go to run it.

The final thing:
Code:
  # Skill setting
  T_SKILL = {
    #Skill ID => [[Key 1, Key 2,...],Power if failed(ï¼…)(, Anim.ID if failed)]
        7 => [[UP,DOWN], 50],
        8 => [[X,C,Z], 50],
        9 => [[DOWN,X,A,B], 50],
        10 => [[LEFT,UP], 50],
        11 => [[L,X,R], 50],
        12 => [[X,C,RIGHT,R], 50],
        13 => [[UP,RIGHT], 50],
        14 => [[L,Z,A], 50],
        15 => [[R,X,X,DOWN], 50],
        16 => [[DOWN, RIGHT], 50],
        17 => [[A,B,C], 50],
        18 => [[Y,X,DOWN,B], 50],
        19 => [[LEFT,DOWN], 50],
        20 => [[Z,Y,A], 50],
        21 => [[B,C,X,L], 50],
        22 => [[RIGHT,DOWN], 50],
        23 => [[A,B,R], 50],
        24 => [[X,Y,LEFT,R], 50],
        25 => [[LEFT,RIGHT], 50],
        26 => [[X,L,B], 50],
        27 => [[LEFT,X,C,Z], 50],
        28 => [[LEFT,DOWN], 50],
        29 => [[C,X,A], 50],
        30 => [[X,Z,C,UP], 50],
        31 => [[UP,DOWN,X], 0],
        32 => [[LEFT,RIGHT,L,R], 50],
        57 => [[A, C], 50],
        58 => [[C, X, UP], 50],
        59 => [[A, UP, RIGHT, A], 50],
        60 => [[Z, C, A, B], 50],
        61 => [[X, C], 50],
        62 => [[UP, X, DOWN], 50],
        63 => [[LEFT, C, Y, A], 50],
        64 => [[X, C, Y, A], 50],
        65 => [[Y, A], 50],
        66 => [[RIGHT, B, A], 50],
        67 => [[LEFT, UP, Z, A], 50],
        68 => [[Y, B, Y, A], 50],
        69 => [[LEFT, A], 50],
        70 => [[A, C, A], 50],
        71 => [[B, B, A, A], 50],
        72 => [[A, B, X, Y], 50],
        73 => [[X, A], 50],
        74 => [[Y, A, B], 50],
        75 => [[LEFT, RIGHT, Y, A], 50],
        76 => [[A, C, L, A], 50],
        77 => [[R, X], 50],
        78 => [[L, C, R], 50],
        79 => [[LEFT, L, RIGHT, R], 50],
        80 => [[C, C, Z, RIGHT], 50],
        17 => [[Up, Down, C], 75, 1],
  }

I hope that helps. If you have any other questions let us know.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top