I dont think many people will use this until some scripts are made.
Alrighty then; challenge accepted
#==============================================================================
# Geomancy [VXA]
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: December 1, 2011
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# 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)
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 unless skill.nil? || skill.valid_terrain?($game_player.terrain_tag)
return mal_vxageo_sklconds_6gc1(skill, *args, &block) # Run Original Method
end
end
If anyone else wants to play around with writing scripts, it's not too hard but it's a pain.
The trial doesn't let you save any changes made to scripts, but you can get around it. Basically, all you need to do is create a new project in RMVX Ace. Then, go to the folder in which it is created, go into Data, and copy the Scripts.rvdata2
Create a new RMVX (Not Ace) project. Go into the Game Folder, and then go into Data. Paste the Scripts.rvdata2 into the Data folder, delete Scripts.rvdata, and rename the Scripts.rvdata2 to Scripts.rvdata.
Now, when you go into the VX project and go to the Script Editor, you will see that they are the scripts from RMVX Ace. It will obviously be totally broken if you try to play test, so you'll have to script blind. Once you write your script, save the project. Go back into the Data Folder of the RMVX project. Copy Scripts.rvdata and move it to the Data Folder of the RMVX Ace project. Delete the Scripts.rvdata2 and rename Scripts.rvdata to Scripts.rvdata2. Now playtest the RMVX Ace project. The changed script won't show up in the Script Editor (since you can't shut down without the whole project being deleted), but when you playtest, the script will be interpreted with the rest and so you can test it there.
It would be a huge pain if it was a script that needed to be tested often. Anyway, now I've written my first script for RMVX Ace
I attached the Scripts.rvdata2 with it included if anyone wants to test it out, though it's kind of boring.
Also, that's a great idea to go through it like that LoganForrests. Thanks for doing it.