Main Menu
  • Welcome to The RPG Maker Resource Kit.

[VXA] Geomancy 1.0

Started by modern algebra, December 02, 2011, 10:36:07 PM

0 Members and 1 Guest are viewing this topic.

modern algebra

Geomancy [VXA]
Version: 1.0a
Author: modern algebra
Date: April 28, 2012

Version History




  • <Version 1.0a> 2012.04.28 - Fixed an error with Battle Test
  • <Version 1.0> 2011.12.01- Original Release

Description



This script allows you to set it so that specified skills can only be used on particular types of terrain.

Features


  • Allows you to prevent actors from using certain skills depending on the terrain they are at. This allows you to, for instance, only allow the use of air spells while above ground, or only allow earth spells when not in the water, etc...
  • Very easy to configure

Instructions

To install this script in the demo, see this tutorial. If you wish, you can download a copy of the Scripts.rvdata2 with this script included and test it out.

For instructions on setting the terrains on which skills can be used, see the header of the script.

Script




#==============================================================================
#    Geomancy [VXA]
#    Version: 1.0a
#    Author: modern algebra (rmrk.net)
#    Date: April 28, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to set it so that certain skills can only be used
#   on particular types of terrain.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    To set it so that a skill can only be used on particular terrain tags,
#   simply put the following code in the notebox of the skill:
#
#        \Terrains[x, y, ..., z]
#
#   where x, y, ..., z are the terrain tags you want to enable it for. If you
#   don't set this code at all, then the skill can be used on any non-excluded
#   terrains.
#
#    You can also do it backwards - if you want the skill to be usable on all
#   terrains EXCEPT specified terrains, then you use the following code:
#
#        \!Terrains[x, y, ..., z]
#
#   where x, y, ..., z are this time the tags you DON'T want to be able to use
#  the skill on.
#==============================================================================

#==============================================================================
# ** RPG::Skill
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new method - valid_terrain?
#==============================================================================

class RPG::Skill
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Valid Terrain?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def valid_terrain?(terrain_tag)
    if !@valid_terrains
      @valid_terrains, @invalid_terrains = [], []
      self.note.scan (/\\(!?)TERRAINS\[(.+?)\]/i) { |match|
        match[1].scan (/\d+/) { |tag|
          if match[0].empty? 
            @valid_terrains.push (tag.to_i)
          else
            @invalid_terrains.push (tag.to_i)
          end
        }
      }
    end
    return false if @invalid_terrains.include?(terrain_tag)
    return true if @valid_terrains.empty? || @valid_terrains.include?(terrain_tag)
    false
  end
end

#==============================================================================
# ** Game_BattlerBase
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - skill_conditions_met?
#==============================================================================

class Game_BattlerBase
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Skill Available?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mal_vxageo_sklconds_6gc1 skill_conditions_met?
  def skill_conditions_met?(skill, *args, &block)
    return false if (!$BTEST && !skill.nil? && !skill.valid_terrain?($game_player.terrain_tag))
    mal_vxageo_sklconds_6gc1(skill, *args, &block) # Run Original Method
  end
end


Credit




  • modern algebra

Thanks


Support



Please post in this topic at RMRK for support.

cozziekuns

So nice of EB to reintroduce terrain tags. Scripts don't get any simpler than that!

Nice work, MA!

Gracie

And the prize for fastest script made for VXA goes to Modern Algebra!


LoganF

I wonder if he would have done it had there not been a post about VXAce not being used until scripts were made.

Also, was the OP copy/pasted and edited from the original thread for the VX script? I'm not quite sure if Komodo Frog requests this script for VXAce in particular. I just find it amusing.

Still, nice little script for when we can make use of it. In fact, it might just get used by me for my little project I'm working on for VXAce.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

oriceles

I tought that Yanfly made it first with his Core Engine. Not sure anyway, but hey! this is awesome. I'll move my project from VX to VXace when it gets full released.

Sorry but, does anyone know how to setup regions? (they are the new areas isn't it?) I don't see a tab on database or a dropdown on troops tab

yuyu!

Quote from: oriceles on December 03, 2011, 05:29:34 AM
Sorry but, does anyone know how to setup regions? (they are the new areas isn't it?) I don't see a tab on database or a dropdown on troops tab

I downloaded a fan translation patch that has most of the game translated. I've not got a chance to look much at Ace yet. So, i'm not sure, but is this what you're looking for? Or are you asking how exactly to set up the regions?

[Spoiler=My Games and Art]
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]

[/Spoiler]

oriceles

I was asking on how to setup region, it was not very intutive but then i found that you can set them doing a right click on a map name (the only that bothers me is that u only can set 3 monsters by region number, but well more that 36 regions must be strange). In that menu you can setup the display name of maps too and general monster encounter like VX had.

modern algebra

Well, regions are set using a paint tool, which is what yuyubabe screenshotted.

With regard to monsters, you can set as many monsters as you want per region - you can only set a monster to be in three regions. However, you can easily get around that by making more than one slot with the same monster in it, and setting different regions for the identical troop.

But yeah, regions don't have a specific setup screen like areas did in RMVX. But given that, I think it makes sense to have encounters set up in the map with all other encounters.

oriceles

#8
true true, but i find weird to find slimes on sea, so general monster encounter is not so good however. With regions we can create sea monsters locations easily :3. I'll create another topic on this board if something else about regions shows up.


Sorry for go out of topic MA', and by the way your new avatar is awesome!.


Edit: My English grammar get worse everyday.

digdarkevil

you made so much scripts so far, so i was wondering if SOME wer compatible witth VXA

digdarkevil


modern algebra

Without any modifications at all, none of them would be.

Some, however, would only require very little to make them compatible.

jwei44

I tried this script in a blank project, and battle test throws me this:


modern algebra

#13
Thanks.

I updated the first post and it should work now. Mind you, it basically turns the script off during battle test so the terrain requirements of the script do not apply. This is because the script depends on terrain tags, and in battle test there are none.