Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: G_G on April 10, 2010, 10:10:33 pm

Title: [XP] First Strike Skills
Post by: G_G on April 10, 2010, 10:10:33 pm
First Strike Skills
Authors: game_guy
Version: 1.0
Type: Battle Add-On
Key Term: Battle Add-On

Introduction

Remember how in pokemon games, there were certain moves like Quick Attack you would attack first no matter what? This does exactly that!
NOTE: I made a script called First Strike States. This allows skills to strike first instead of having to have a first strike state to attack first.
NOTE: If more then one actor/enemy uses a first strike skill, the fastest will attack first.
NOTE: Depending if you place this below or above First Strike States things may change. (If you use First Strike States.) If Above: Battlers with a First Strike State will attack first then first strike skills. If Below: Battlers that use a First Strike Skill will use the skill first then battlers will attack with first strike states.

Features


Screenshots

N/A

Demo

N/A

Script

Spoiler: ShowHide
#===============================================================================
# First Strike Skills
# Author game_guy
# Version 1.0
#-------------------------------------------------------------------------------
# Intro:
# Remember how in pokemon games, there were certain moves like Quick Attack you
# would attack first no matter what? This does exactly that!
# NOTE: I made a script called First Strike States. This allows skills to strike
# first instead of having to have a first strike state to attack first.
# NOTE: If more then one actor/enemy uses a first strike skill, the fastest
# will attack first.
#
# Features:
# Setup as many skills
# Skills attack first at every turn
#
# Instructions:
# Go down to Config and set everything up.
#
# First_Strike_Skills = array of skill id's
#   Every skill you want to be a First Strike Skill, place the id in the array.
#
# Compatability:
# Not tested with SDK.
# Made for the Default Battle System
# Will probably not work with RTAB (Not Tested)
#
# Credits:
# game_guy ~ For making it
# Shining Riku ~ For the idea based from First Strike States
#===============================================================================
module GameGuy
  #==========================================
  # Config
  #==========================================
  First_Strike_Skills = [57]
  #==========================================
  # End Config
  #==========================================
end
class Scene_Battle
  alias gg_attack_first_skills_lat make_action_orders
  def make_action_orders
    gg_attack_first_skills_lat
    @tempa = @action_battlers
    @tempa2 = []
    @tempa3 = []
    for i in @tempa
      if i.current_action.kind == 1 &&
          GameGuy::First_Strike_Skills.include?(i.current_action.skill_id)
        @tempa2.push(i)
      else
        @tempa3.push(i)
      end
    end
    @action_battlers = []
    @tempa2.each {|i| @action_battlers.push(i)}
    @tempa3.each {|i| @action_battlers.push(i)}
  end
end


Instructions

I recommend placing below my First Strike States (if using)
Rest is in the script.

Compatibility

Not tested with SDK.
Made for Default Battle System.
Probably won't work with RTAB (Not Tested)

Credits and Thanks


Author's Notes

Enjoy!
Title: Re: [XP] First Strike Skills
Post by: Shining Riku on April 10, 2010, 11:47:49 pm
YAY! Thanks man! 8D

This is awesome! *powers up*

If I get any more ideas and whatnot, i'll post 'em where I posted my first one
Title: Re: [XP] First Strike Skills
Post by: Blizzard on April 12, 2010, 02:51:06 am
Damn, you're fast. O_o; You remind me of my old days when I was the same. Somebody posts a script request and half an hour later I post a new script topic. xD
Title: Re: [XP] First Strike Skills
Post by: G_G on April 12, 2010, 08:55:25 am
It wasn't really hard. I used my First Strike States as a base. I just had to modify a few lines is all. xD

The instructions took the longest. (5 minutes because I was lazy)
Title: Re: [XP] First Strike Skills
Post by: Aqua on April 12, 2010, 02:49:14 pm
Quote from: Blizzard on April 12, 2010, 02:51:06 am
Damn, you're fast. O_o; You remind me of my old days when I was the same. Somebody posts a script request and half an hour later I post a new script topic. xD


I remember when you made that tutorial on more armor slots just because I asked on IRC
<3

*sigh*
Those were the days...

Then you went and quit
*grumbles*
Title: Re: [XP] First Strike Skills
Post by: Fantasist on April 13, 2010, 06:16:27 am
I wanted to post yesterday, but why don't you merge the two scripts? It makes more sense (to me anyway).

QuoteThe instructions took the longest. (5 minutes because I was lazy)

The reason why I didn't release about a handful of scripts yet -_-
Title: Re: [XP] First Strike Skills
Post by: Hatsamu on February 04, 2011, 10:17:12 am
I'm not a fan of necroposting so I apoligize for it, but I can't get this to work as I get this error message when I use a skill defined as First Strike:

" not defined method 'attack_always' "


I'm using Blizz Tons. Its a compatibility issue or is it something that could be easily fixed?



Thanks in advance, it would be really nice to got this kind  of skills at my game.
Title: Re: [XP] First Strike Skills
Post by: Boba Fett Link on April 08, 2011, 08:00:07 pm
I got a similar error as Hatsamu, but it says:


Script 'First Strike' line 46: NoMethodError occurred.

undefined Method 'attack_always' for #<Game_System:0x19d4148>



Anyone know what is wrong?
Title: Re: [XP] First Strike Skills
Post by: G_G on April 08, 2011, 08:11:33 pm
remove these lines
    if $game_system.attack_always == false
      if $game_party.attacked
        return
      end
    end


No idea what I was thinking there. O_o
Title: Re: [XP] First Strike Skills
Post by: Boba Fett Link on April 09, 2011, 02:02:39 pm
Thanks! It works now!