Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Heretic86

121
So Im looking at Blizz's Full Reflect System, and thinking of a way to add a bit of strategy to battles.  For example, an enemy that heals itself every round would reflect spells back.  But to target the enemy with Magic, I'd need to be able to cast an offensive spell on a Party Member that also has Reflect on.  IE, cast Fire on a Party Member and it Reflects to hit the Enemy.  Unfortunately, there is nothing in the Scope dropdown menu that allows a skill to target Anyone, hence I need to turn to a script.

The other thing I was thinking this might be useful for is Vs Undead.  I think there may be a script for this already, where Friendly Spells cast on Undead have the Opposite Effect.  IE Heal Spells Damage Undead, but first, I'd need to be able to Target the Undead with a Friendly Spell.

Any suggestions?
122
Resources / Alpha Channel Fog / Cloud Graphic
May 03, 2012, 07:18:53 pm
I guess I should share this.  Had it laying around for quite some time, but I think it could still be very useful to people.


(right click, save target as, keep the PNG file extension or the Alpha Channel will be destroyed)

Dont worry if your Browser doesnt render it correctly, it renders right in game.

In Game Examples (using RMXP)


123
Im pretty sure there is a script for this already, so I decided to NOT post it in Script Requests.  Admins, feel free to move this to Script Requests if you feel it is better suited there, but you've got my reasoning already.

What Im hoping for is just a link to an existing script that does the following:
Last Non Dead Actor dies of some sort of Poison
Message Pops up - "Your Party has Died Of Dysentery" (wait for Input.trigger?(Input::C))
Hide Message
Game Over

I dont really wanna do this as a Parallel process, although I know it can be done.  Too much impact on performace doing it with Parallels.

Advice?
124
Title should be self explanitory.  Just looking for a way to do Self Switches using $game_temp during Battle (in the DB, under the Troops Page where Eventing takes place), so being Temporary, its fine if they reset the next time that battle starts against the same Troop.  Its just something to make battles a bit more interesting.  I dont think a script exists yet.

Can someone do this without too much effort?
125
Not releasing this script here yet.  I wanna do some more tweaking to something I dont particularly care for.

Script is for simulating Cloud Altitude.
http://www.775.net/~heretic/downloads/rmxp/CloudAltitude0.2.zip

There are two versions.  One for Devs to help them figure out what Speeds and Altitude they want to use.  They can use key combos in that version to adjust the variables on the fly so they can work out what looks good for them.  The math for both versions is the same.  What I've come across is that if the Cloud (Fog) Scroll Speed is moving faster than the players speed, when the player walks in that same direction the Clouds are moving, the clouds seem to get "stuck" at the same speed as the player moves, regardless of the speed the Clouds are set to move at.  Yeah, there is probably a ton of stuff I could improve on, but its a work in progress.

I think the only way to explain it is to see it in action for what the script does, hence the download above.

Here's the part that the way of crunching the numbers needs to change...

Spoiler: ShowHide
  def set_scroll_speed
    # Scrolls Fog Opposite Direction
    # for the appearance of Height
   
    #player_spd = $game_player.move_speed
    #fog_spd_x = $game_map.fog_origsx
    #fog_spd_y = $game_map.fog_origsy
    #altitude = $game_map.fog_altitude
   
    if $game_map.fog_direction == 2
      #Screen DOWN, Fog UP
      $game_map.fog_sy =  $game_map.fog_origsy - ($game_player.move_speed + $game_map.fog_altitude)

      #Resets Horizontal Fog Speed
      $game_map.fog_sx = $game_map.fog_origsx
    elsif $game_map.fog_direction == 4
      #Screen LEFT, Fog RIGHT
      $game_map.fog_sx = $game_map.fog_origsx + ($game_player.move_speed + $game_map.fog_altitude)

      #Resets Vertical Fog Speed
      $game_map.fog_sy = $game_map.fog_origsy
    elsif $game_map.fog_direction == 6
      #Screen RIGHT, Fog LEFT
      $game_map.fog_sx = $game_map.fog_origsx - ($game_player.move_speed + $game_map.fog_altitude)

      #Resets Vertical Fog Speed
      $game_map.fog_sy = $game_map.fog_origsy
    elsif $game_map.fog_direction == 8
      #Screen Up, Fog DOWN
      $game_map.fog_sy =  $game_map.fog_origsy + ($game_player.move_speed + $game_map.fog_altitude)

      $game_map.fog_sx = $game_map.fog_origsx
    end
  end


Other thing is problematic is that it isnt compatible with 8 directional movement scripts.  Just kind of hoping one of our more experienced scripters has a solution, at least to fix the speed stuff...  Suggestons?
126
RMXP Script Database / [XP][VX][VXA] Fade Events
April 23, 2012, 05:50:00 pm
Fade Events
Authors: Heretic
Version: 1.0
Type: Fade Events with Duration
Key Term: Misc Add-on



Introduction

This script will allow you to Fade Events in and out gradually.  The Default Options allow you to change an events opacity, but does not allow you to make a gradual transition.  Thus, if you wanted to have an Event that "dissolved", "teleported" or "flickered", you would have to use quite a few Change Opacity commands, then use Wait after each and every Change Opacity command.  Sorry to say, but I think that is a pain in the behind.  This script offers an easier way to accomplish that same effect by using one line of script: fade_event(new_opacity, duration).  Short Fades can be accomplished without this script by adjusting the opacity every frame for a few frames, but if you need rather long Fades that take a lot of frames, then this is the script for you!


Features


  • Saves Time by changing Opacity for you Automagically

  • Super Duper easy to use

  • Only ONE Command to Remember

  • No Configuration Necessary

  • High Degree of Compatability

  • Reported to me to be compatible with VX and VXA as well




Screenshots
Spoiler: ShowHide








Demo

http://www.775.net/~heretic/downloads/rmxp/fade_event/fade_event.exe


Script

Fade Event (with Developer Errors)
(has a little more code, lets you know if you do something wrong)

Spoiler: ShowHide
# Name: Fade Event (With Developer Errors)
# Author: Heretic
# Ver: 1.0
# Date: Yes, please, but with a pretty girl! (yes, that was a joke!)
# Timestamp: Apr 23rd, 2012
#
# FADE EVENT is Super simple to use.  Put above Main somewhere. 
#
# Pretty much anywhere between Scene_Debug and Main should be fine.
#
# In the Editor, in Edit Events, go to Set Move Route, and hit Script
# in that window, enter "fade_event(255, 20)" without the quotes
# and adjust 255 for Not Transparent to 0 for Fully Invisible
# the second number is the number of Frames for the Transition
#
# Note: 1 Second in RMXP is 20 Frames

module Fade_Events #(for including in any new or custom classes)
  #--------------------------------------------------------------------------
  # * Fade Event - (Opacity 0 to 255, Duration in Frames)
  #--------------------------------------------------------------------------
 
  def fade_event(arg_opacity_target, arg_opacity_duration)
    if arg_opacity_target.nil? or arg_opacity_duration.nil?
      print "fade_event(opacity, duration) expects Two Arguments\n"
      return
    elsif not arg_opacity_target.is_a? Numeric
      print "\"", arg_opacity_target, "\" is not an Number!\n",
            "Both Arguments should be Numbers!\n\n",
            "I.E. fade_event(255,20)"
      return
    elsif not arg_opacity_duration.is_a? Numeric
      print "\"", arg_opacity_duration, "\" is not an Number!\n",
            "Both Arguments should be Numbers!\n\n",
            "I.E. fade_event(255,20)"
      return
    elsif arg_opacity_target < 0 or arg_opacity_target > 255
      print "\"", arg_opacity_target, "\" Opacity Out of Range\n",
            "Valid Range: 0 - 255"
    elsif arg_opacity_duration < 0
      print "\"", arg_opacity_target, "\" Duration Out of Range\n",
            "Valid Range: Any Positive Number or 0"
    end
   
    self.opacity_target = arg_opacity_target * 1.0
    self.opacity_duration = arg_opacity_duration.abs
    if self.opacity_duration == 0
      self.opacity = self.opacity_target.clone
    end
  end

#-----------------------------------------------------------------------------
#  * Change Event Opacity
#-----------------------------------------------------------------------------
 
  def change_event_opacity
    # Manage change in Event Opacity Level
    if @opacity_duration >= 1
      d = @opacity_duration
      @opacity = (@opacity * (d - 1) + @opacity_target) / d
      @opacity_duration -= 1
    end
  end

end

#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------

class Game_Character
 
  attr_accessor     :opacity_target
  attr_accessor     :opacity_duration
  attr_accessor     :original_opacity
 
  unless self.method_defined?('fade_events_initialize')
    alias fade_events_initialize initialize
  end

  def initialize
    # Initilaize Original First
    fade_events_initialize
    # Added Properties
    @opacity_target = 255
    @opacity_duration = 0
    @original_opacity = @opacity
  end

  # IF the method hasn't been defined yet
  unless self.method_defined?('fade_events_update')
    alias fade_events_update update
  end
 
  # Redefine Updater
  def update
    # Run Original First
    fade_events_update
    if @opacity_duration >= 1
      # Manages the Events Current Opacity
      change_event_opacity
    end
  end

  # Check if the Fade_Event is already Defined (prevents errors)
  unless Game_Character.included_modules.include? (Fade_Events)
    # Make the functions inside the Module available to this class
    include Fade_Events
  end
 
end

class Interpreter
  def fade_event(opacity, duration)
    print "Please call \"fade_event\" from\n",
           "\"Edit Event\" -> \"Set Move Route\" -> Scripts Window\n",
           "instead of \n\"Edit Event\" -> Scripts Window"
  end
end 



Fade Event (no Developer Errors)
(has less code, no errors displayed if you do something wrong, so you're on your own)

Spoiler: ShowHide
# Name: Fade Event (No Developer Errors)
# Author: Heretic
# Ver: 1.0
# Date: Yes, please, but with a pretty girl! (yes, that was a joke!)
# Timestamp: Apr 23rd, 2012
#
# FADE EVENT is Super simple to use.  Put above Main somewhere. 
#
# Pretty much anywhere between Scene_Debug and Main should be fine.
#
# In the Editor, in Edit Events, go to Set Move Route, and hit Script
# in that window, enter "fade_event(255, 20)" without the quotes
# and adjust 255 for Not Transparent to 0 for Fully Invisible
# the second number is the number of Frames for the Transition
#
# Note: 1 Second in RMXP is 20 Frames

module Fade_Events #(for including in any new or custom classes)
  #--------------------------------------------------------------------------
  # * Fade Event - (Opacity 0 to 255, Duration in Frames)
  #--------------------------------------------------------------------------
 
  def fade_event(arg_opacity_target, arg_opacity_duration)
    self.opacity_target = arg_opacity_target * 1.0
    self.opacity_duration = arg_opacity_duration.abs
    if self.opacity_duration == 0
      self.opacity = self.opacity_target.clone
    end
  end

#-----------------------------------------------------------------------------
#  * Change Event Opacity
#-----------------------------------------------------------------------------
 
  def change_event_opacity
    # Manage change in Event Opacity Level
    if @opacity_duration >= 1
      d = @opacity_duration
      @opacity = (@opacity * (d - 1) + @opacity_target) / d
      @opacity_duration -= 1
    end
  end

end

#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------

class Game_Character
 
  attr_accessor     :opacity_target
  attr_accessor     :opacity_duration
  attr_accessor     :original_opacity
 
  unless self.method_defined?('fade_events_initialize')
    alias fade_events_initialize initialize
  end

  def initialize
    # Initilaize Original First
    fade_events_initialize
    # Added Properties
    @opacity_target = 255
    @opacity_duration = 0
    @original_opacity = @opacity
  end

  # IF the method hasn't been defined yet
  unless self.method_defined?('fade_events_update')
    alias fade_events_update update
  end
 
  # Redefine Updater
  def update
    # Run Original First
    fade_events_update
    if @opacity_duration >= 1
      # Manages the Events Current Opacity
      change_event_opacity
    end
  end

  # Check if the Fade_Event is already Defined (prevents errors)
  unless Game_Character.included_modules.include? (Fade_Events)
    # Make the functions inside the Module available to this class
    include Fade_Events
  end
 
end



Instructions

Just put the code above main somewhere...


Compatibility

No Incompatability Issues, as far as I know...


Credits and Thanks


  • I'd like to thank the Academy, Chucky Cheese, and inspiration from Chuck Norris!

  • Thanks to everyone who has been helping me improve my scripting skills!




Author's Notes

Thursday is Garbage Day so don't forget to take out the Trash!  Oh, wait, that isnt really a note related to this Script!  How embarassing!


---

I dont own copies of VX or VXA, but it has been reported to me that this script is compatible with VX and VXA as well!  Please advise if there are any issues and I'll see what I can do for you.
127
General Discussion / General Scripting Question...
April 20, 2012, 03:52:25 am
I wrote a script that I found I needed to fully redefine the entire method.  What I did works for the specific purposes I was aiming for, however, as a budding scripter, I'd like to make sure my scripts are as compatible with other scripts as possible.  It doest really matter what my script is, but what I'd like to know, in general, is doing a full redefinition of one of the default scripts a "bad" way to do smaller simpler scripts, or do you have any recommendations, like dont alias, or always alias, or never do full def rewrites, anything to that effect?
128
Posted this same question on another forum, but hey, Im impatient.

The script I have draws some nice looking HP Bars, but they function like frozen dog snot at the north pole in the middle of winter.  Basically, when the Interpreter is running, performance goes way way way south.  Seems to only occur when the Interpreter is running however.  So during a battle, if one of the characters says something, or performs some sort of Event Action, I get lag out the wazoo.  Wazoo.debug failed to correct the issue, and Wazoo.dispose leaves me with no purdy HP Bars.

Script I am running is called ATB: http://www.775.net/~heretic/downloads/rmxp/cat.php around line 1420 or so.

What it looks like is happening is that a non object window is being displayed each and every frame.  I dont mind doing a total rewrite of this section as long as it doesnt cause lag.  And the lag is obviously coming from drawing the HP / SP / CP / Shadowed Text each and every time.  How can I best do this efficiently so it doesnt lag like a SOB?
129
The Rewrite is from Zeriab's Caterpillar that I thought needed a few more features.  Like two or three... hundred!

I thought the original script was probably the best that I've seen, even today, but was lacking a few options.  When I started tweaking the script a bit, I kept coming across other uses for the stuff I was writing, so I've ended up putting in so many that I have literally completely lost count!

Um, yeah, so, okay, whatever, right?  I have a feeling this crowd doesnt really care about reading too much and would rather see it IN ACTION.  So while testing things, it basically turned into a DEMO.  The Demo turned out to be quite useful for trying to provide examples of features, what they do, how they work, etc.  I know the Demo is dialogue heavy, but I felt it needed to be that way to thoroughly explain new stuff that I implemented.  Things like being able to Fade Events, Render Large Sprites as FLAT (apparently not possible before), new Movement Commands like "Turn Toward Event".  There are just too many to list here.

TECH DEMO DOWNLOAD
http://www.775.net/~heretic/downloads/rmxp/cat.php

I decided against posting this in XP Scripts as it is still a Work In Progress, and wanted some feedback from everyone on things I should tweak, implement, fix, etc. before a Final Release.  My Goal is version 2.0, and Im close to that.  But still want to add and adjust a few things prior to that.

So, after you try it out, would you mind telling me what do you guys think of it so far?