Quote from: Metaron on September 15, 2012, 07:25:55 pm
My second question is I've made world map skills, the type of skills that don't do any damage or a very little amount and are used to remove obstacles in the game, such as boulders and bushes. The other actors keep using these skills in combat, so is there any way to block npc actors from using certain moves?
this is just a theory (which i need to try and prove myself after i get the X-Grid, Camping and Mission systems done) but if you created a multidimensional array of flags for every skill and used that as a "master" reference to the skills character do know, then remove the skills you want only player controlled character to use and not the allies and restore these when you change character
something like this
# first run (creates your master looup array)
masterSkillLookup = Table.new({total no. of actors},{total no. of skills})
while(i < {total no. of actors})
while (j < {total no. of skills})
if($game_actors[i].skill_learned?(j))
masterSkillLookup[i, j] = 1
else
masterSkillLookup[i, j] = 0 # i'm not sure if a new instance of Table sets every value to 0, this is toi make sure it did
end
j += 1
end
i += 1
end
#---------------------------------------------------------------------
# when a new skill is learned
masterSkillLookup[{actor id}, {skill id}] = 1
#---------------------------------------------------------------------
# when you change the party learder (controled player)
forgetSkills = Table.new({total no. of skills you dont want allies to use})
forgetSkills[0...{total no. of skills you dont want allies to use}] = [{list of skill ids, eg. 1, 5, 124, 16}]
while(i < {total no. of actors}) # for every actor
if($game_actors[i].party_index == 0) # if the currect actor in the loop is in the front of the party (party learder)
while (j < {total no. of skills you dont want allies to use}) # for every skill you want only the player to use
if(masterSkillLookup[i, forgetSkills[j]] == true) # if the actor does know the skill
$game_actor.learn_skill(forgetSkills[j]) # makes the actor learn the skill
end
j += 1
end
else #same as above however we get them to forget the skill
while (j < {total no. of skills you dont want allies to use})
if(masterSkillLookup[i, forgetSkills[j]] == true)
$game_actor.forget_skill(forgetSkills[j])
end
j += 1
end
end
i += 1
end
don't take the code at face value, some of the syntax's may be incorrect and the first script needs to be run at the start of the game, the second needs to be run after the actor learns a new skill outside the third script and the third script needs to be put into Scene_Map, also, should really have used for loops but i couldn't remember how
works, anyway, the code above is amateur, someone with more experience can turn it into a proper working script
otherwise you can do all of this in a common event and have it run on parallel process with a switch but it'll be a huge thing and it's quicker to code as a script
Quote from: KK20 on September 19, 2012, 02:07:50 pm
I did create a script where certain skills can or cannot be used if a switch is ON or if applied with a specific status effect.
doesn't help when you have 15 pages of previous posts in your profile, could you post up a link, the second part to your script may be what i need for my Tetrix abilities since the Field of Ather that Aqua made doesn't work in 2.x of Blizz-ABS and i was going to use something like what i just posted up to do just that eg. if the "Fire Tetra" status is on a character, then all "Neutral" Tetrix skills are replaced with "Fire" Tetrix skills, with your script i don't have to worry about removing the skills all the time