The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX Ace => VXA Scripts Database => Topic started by: modern algebra on December 02, 2011, 10:36:07 PM

Title: [VXA] Geomancy 1.0
Post by: modern algebra on December 02, 2011, 10:36:07 PM
Geomancy [VXA]
Version: 1.0a
Author: modern algebra
Date: April 28, 2012

Version History



Description


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

Features


Instructions

To install this script in the demo, see this tutorial (http://rmrk.net/index.php/topic,44419.0.html). If you wish, you can download a copy of the Scripts.rvdata2 (http://rmrk.net/index.php?action=dlattach;topic=44418.0;attach=24672) 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


Code: [Select]
#==============================================================================
#    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



Thanks


Support


Please post in this topic at RMRK for support.
Title: Re: [VXA] Geomancy 1.0
Post by: cozziekuns on December 03, 2011, 12:11:52 AM
So nice of EB to reintroduce terrain tags. Scripts don't get any simpler than that!

Nice work, MA!
Title: Re: [VXA] Geomancy 1.0
Post by: Gracie on December 03, 2011, 12:59:56 AM
And the prize for fastest script made for VXA goes to Modern Algebra!
Title: Re: [VXA] Geomancy 1.0
Post by: LoganF on December 03, 2011, 01:55:01 AM
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.
Title: Re: [VXA] Geomancy 1.0
Post by: oriceles on December 03, 2011, 05:29:34 AM
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
Title: Re: [VXA] Geomancy 1.0
Post by: yuyu! on December 03, 2011, 05:47:37 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?
Title: Re: [VXA] Geomancy 1.0
Post by: oriceles on December 05, 2011, 05:16:00 AM
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.
Title: Re: [VXA] Geomancy 1.0
Post by: modern algebra on December 05, 2011, 01:44:50 PM
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.
Title: Re: [VXA] Geomancy 1.0
Post by: oriceles on December 05, 2011, 03:25:07 PM
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.
Title: Re: [VXA] Geomancy 1.0
Post by: digdarkevil on December 09, 2011, 07:34:22 PM
you made so much scripts so far, so i was wondering if SOME wer compatible witth VXA
Title: Re: [VXA] Geomancy 1.0
Post by: digdarkevil on December 09, 2011, 07:34:45 PM
Vx Scripts of course
Title: Re: [VXA] Geomancy 1.0
Post by: modern algebra on December 19, 2011, 01:16:54 AM
Without any modifications at all, none of them would be.

Some, however, would only require very little to make them compatible.
Title: Re: [VXA] Geomancy 1.0
Post by: jwei44 on April 29, 2012, 01:04:01 AM
I tried this script in a blank project, and battle test throws me this:

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi50.tinypic.com%2Fbh10yc.png&hash=fddad29b5afc3aa5d9eeafb6950f01617a3b7ca7)
Title: Re: [VXA] Geomancy 1.0
Post by: modern algebra on April 29, 2012, 01:50:46 AM
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.