Activating Skills

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
This sounds to be noob or crazy but in script call or scripting, how can I perform a skill again?

Say I have a command in my BattleCommand named "Forced Magic" and when I select that, it randomly casts any skill from the database. 

What's the script for calling / casting a skill again?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
so after Forced Magic is used, you want to use Forced Magic Again???
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Nope. I want to use it once only in a battle. How can I cast a skill? or the specific script call to cast this skill?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I can't quite understand what you want... you asked how to perform a skill again, then you tell me that it should only be used once?


or do you want the Forced Magic skill to cast another skill at random? there's a script for that out there... Skill Invoke if I remember correctly
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Wait so there's two things involved here.

  1. You want a skill that selects a random other skill from a pool when used, and then force-actions the picked skill from the same actor.
  2. You want this skill to be selectable from Window_ActorCommand  (There is a yanfly script that you can use to achieve this)
Did I get it right?
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Being able to activate it randomly was just my example :)

My specific request is on how to exactly activate a skill in battle. I am using a script called SEA - Battle Common Events, however, I want to tweak it a bit so that I can cast a skill inside the script instead of using one on common events. This is specifically to control what skill is specific for that actor.
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
There's some methods to do this.
 
What I often use is inserting a new action for the battler and call use_item/execute_action directly. Something like this:

class Scene_Battle < Scene_Basedef force_skill(actor, skill) #store current subject last_subject = @subject @subject = actor #creating new action action = Game_Action.new(actor) action.set_item(skill) if actor.usable?(action.item) # insert the action to the front of the battler's actions, execute, # then remove the action from the battler's actions. actor.actions.unshift(action) use_item actor.actions.shift end #restore current subject @subject = last_subjectendendYou can look to use_item method in Scene_Battle, or the methods that calls it, to learn how skills/items are executed.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Ahhh, this helps. Does this mean that if I want an actor to perform a skill I have to do them individually? Such as one method per skill?
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
Ahhh, this helps. Does this mean that if I want an actor to perform a skill I have to do them individually? Such as one method per skill?
Well, that depends on how you code them, really. My example function takes a battler ('actor' is a misnomer, the argument can be supplied with any battler object) and a skill as argument, and forces the battler to use the skill if it fulfills the execution condition. If you remove the usable? check, it'll execute the skill even when the battler is dead. Also, as it is, there will be no delay to the execution of the skill.

(By the way, the snippet as it is will make some errors. action.set_item will set the action to item numbered item id, so the battler use an item instead of skill. Change that line to action.set_skill(skill) and it will take the proper path.)

If you want to take the inputting actor as the skill's executor, there are some parts of the code that need to be changed. Namely, how the code acquire battler.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
I see. I am currently searching on the default script and looking how they do perform however there's not one I can think of to where they actually go. I'll try to base your snippet on it, might as well see how it turns out. I've been having problems on this lately, can't figure it out.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top