06-01-2005, 01:00 PM
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
okay this is the easiest way for the scripting illiterate to do this......
first make a base skill... in the demo mine is at position 81 and is called geomancy, now make the skills that you are gonna have it change to based on the battle background... in the demo the skills are all the ones below skill #81 but i will only use two of them...
open up the script editor, make a new script, right click-->insert, call it geomancy or whatever...and paste this in there
Code:
#========================================
# Simple skill manipulation by makeamidget, emphasis on "simple"
#========================================
class Geomancy
def initialize
case $game_map.battleback_name
when "001-Grassland01"
$skill = $data_skills[86]
when "001-Woods01"
$skill = $data_skills[86]
when "005-Beach01"
$skill = $data_skills[87]
end
actor = $game_actors[1]
actor.forget_skill(81)
actor.learn_skill($skill.id)
end
end
okay, i'll explain what this does, step-by-step, well from the initialize step anyway..
Code:
case $game_map.battleback_name
based on the name of the current map...
Code:
when "001-Grassland01"
when the battlebackground name is 001-Grassland01, it will execute whatever is between this line and either the next when statement, or until it comes to an end, so in the next line it assigns to the global variable $skill the skill you want it to use when you have the battleback 001-Grassland01
the same is true for the next statement, when you put in a new when statement, you must put in the name exactly as it appears in the battlebacks folder, and it must be inclosed by ""
Code:
actor = $game_actors[1]
actor.forget_skill(81)
actor.learn_skill($skill.id)
assigns $game_actors[1] to the instance variable actor, to change the person in the party that uses this skill, change the 1 to the number in the party that will use this... right now it is arsches(1)..
it then make him forget the base skill (geomancy) which i put in skillid 81, so change this to the skill that you will use as a base, this will also be the skill that is seen when you enter the skill menu from the map, and makes him learn the skill that was assigned to $skill, which is determined by the battleback
now go to Scene_Battle1 and right under main put
Code:
@skill_check = Geomancy.new
this is so that it will run the check at the beginning of the battle and change the skill accordingly
still in Scene_Battle 1 search(ctrl+shift+f) for def battle_end(result) and right below that add
Code:
actor = $game_actors[1]
actor.forget_skill($skill.id)
actor.learn_skill(81)
this is to make him forget the skill that was based on the battleback and learn the base skill again, you have to learn and forget so that the skills are useable in battle...
if there are any questions please check out the demo first, if that doesn't help then ask away
geomancy.zip (Size: 209.72 KB / Downloads: 1)