Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Simple Script Fix, Need the help of a scripter for a unique script
Mustaklaki
post Aug 15 2012, 07:04 PM
Post #1


Level 3
Group Icon

Group: Member
Posts: 35
Type: Developer
RM Skill: Skilled




(Pretty sure this is in the right spot)
I was having a custom script being done for my game, but the person scripting it hasn't improved upon this script and hasn't even started and it's been around a month.

The script was made to allow the damage of a skill happen DURING the skill's animation. This allows battles to go a lot faster, and gives the game a more realistic perspective.

The problems with this script are two things:
1. Using "Attack" makes the Attack hit twice, or 4 times for "Dual attack" attacks.
2. Same thing using items that heal/damage ETC.

I normally wouldn't post it, I'm not sure if he wants others using it, but it doesn't work in it's current state due to these 2 problems.

Hungrysnake's Show Damage
CODE
# ============================================================================ #
# Quick snippet by HungrySnake                                                 #
#                                                                              #
# This snippet simply shows the dealt damage directly after using a skill.     #
# It's plug and play                                                           #
# ============================================================================ #

class Scene_Battle < Scene_Base  
  
  def execute_action_skill
    @skill_lol = @active_battler.action.skill
    skill = @skill_lol
    text = @active_battler.name + skill.message1
    @message_window.add_instant_text(text)
    unless skill.message2.empty?
      wait(10)
      @message_window.add_instant_text(skill.message2)
    end
    targets = @active_battler.action.make_targets
    display_animation(targets, skill.animation_id)
    @active_battler.mp -= @active_battler.calc_mp_cost(skill)
    $game_temp.common_event_id = skill.common_event_id
  end
  
  def display_normal_animation(targets, animation_id, mirror = false)
    animation = $data_animations[animation_id]
    if animation != nil
      to_screen = (animation.position == 3)       # Is the positon "screen"?
      for target in targets.uniq
        target.animation_id = animation_id
        target.animation_mirror = mirror
        for target1 in targets
          target1.skill_effect(@active_battler, @skill_lol)
          display_action_effects(target1, @skill_lol)
        end
        wait(20, true) unless to_screen           # If for one, wait
      end
      wait(20, true) if to_screen                 # If for all, wait
    end
  end
end


__________________________

My epic game. Put this in your siggy if you support it! Demo was just updated, check it out!
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=56261"][img]http://i197.photobucket.com/albums/aa100/moepippy/ISupport.png[/img][/url]

Siggy Image
Go to the top of the page
 
+Quote Post
   
Legacy
post Aug 17 2012, 01:03 PM
Post #2


B★RS Coding Ninja
Group Icon

Group: Global Mod
Posts: 1,414
Type: Scripter
RM Skill: Advanced
Rev Points: 15




What engine is this for? I tried to do something in VX Ace. It doesn't draw at the same time, but it pretty much instant.

CODE
#==============================================================================
# :: Show Damage Instantly ::
#------------------------------------------------------------------------------
# Author : Legacy
# Date   : 17.08.2012
#------------------------------------------------------------------------------
# Instructions:
#  To instal the script, open you script editor and paste this script on
#  a new section bellow the Materials section.
#
#------------------------------------------------------------------------------
# Description:
#   This is a snippet to allow for the damage to be drawn instantly after the
# animation is executed.

#------------------------------------------------------------------------------
# Compatibility:
#
# * Overwrite methods
#     class Scene_Battle
#       def wait_for_animation
#       def wait_for_effect
#       def show_attack_animation
#       def show_normal_animation
#
#==============================================================================

class Scene_Battle < Scene_Base  
   #--------------------------------------------------------------------------
   # * Wait Until Animation Display has Finished
   #--------------------------------------------------------------------------
   def wait_for_animation
     update_for_wait
   end
   #--------------------------------------------------------------------------
   # * Wait Until Effect Execution Ends
   #--------------------------------------------------------------------------
   def wait_for_effect
     update_for_wait
   end
   #--------------------------------------------------------------------------
   # * Show Attack Animation
   #     targets : Target array
   #    Account for dual wield in the case of an actor (flip left hand weapon
   #    display). If enemy, play the [Enemy Attack] SE and wait briefly.
   #--------------------------------------------------------------------------
   def show_attack_animation(targets)
     if @subject.actor?
       show_normal_animation(targets, @subject.atk_animation_id1, false)
       show_normal_animation(targets, @subject.atk_animation_id2, true)
     else
       Sound.play_enemy_attack
       abs_wait(5)
     end
   end
   #--------------------------------------------------------------------------
   # * Show Normal Animation
   #     targets      : Target array
   #     animation_id : Animation ID
   #     mirror       : Flip horizontal
   #--------------------------------------------------------------------------
   def show_normal_animation(targets, animation_id, mirror = false)
     animation = $data_animations[animation_id]
     if animation
       targets.each do |target|
         target.animation_id = animation_id
         target.animation_mirror = mirror
         abs_wait(5) unless animation.to_screen?
       end
       abs_wait(5) if animation.to_screen?
     end
   end
end


Hope it helps.


__________________________
Freelance Programmer (C#, C++, Ruby)
#onegameamonth

Go to the top of the page
 
+Quote Post
   
Mustaklaki
post Aug 17 2012, 04:08 PM
Post #3


Level 3
Group Icon

Group: Member
Posts: 35
Type: Developer
RM Skill: Skilled




This is for VX


__________________________

My epic game. Put this in your siggy if you support it! Demo was just updated, check it out!
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=56261"][img]http://i197.photobucket.com/albums/aa100/moepippy/ISupport.png[/img][/url]

Siggy Image
Go to the top of the page
 
+Quote Post
   
Mustaklaki
post Aug 20 2012, 09:22 AM
Post #4


Level 3
Group Icon

Group: Member
Posts: 35
Type: Developer
RM Skill: Skilled




Nevermind, the original creator has already fixed it


__________________________

My epic game. Put this in your siggy if you support it! Demo was just updated, check it out!
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=56261"][img]http://i197.photobucket.com/albums/aa100/moepippy/ISupport.png[/img][/url]

Siggy Image
Go to the top of the page
 
+Quote Post
   
amerk
post Aug 21 2012, 09:06 PM
Post #5


Level 56
Group Icon

Group: Global Mod
Posts: 1,795
Type: None
RM Skill: Undisclosed
Rev Points: 15




So since this is resolved, I'll go ahead and close this. You can PM me if you need it re-opened.


__________________________
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 12:29 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker