Punamaagi

Hero on their own terms
Veteran
Joined
Jan 23, 2016
Messages
231
Reaction score
338
First Language
Finnish
Primarily Uses
RMMV
I'm trying to make "channeled" spells into my game, which would mean that the actor which starts to channel a spell and then automatically casts a spell on their turn for a few rounds. I'm currently trying to make the effect with a state using Yanfly's Buff & States Core, but I have no idea how to make the spellcasting happen before the player gets to input commands (i.e. before choosing 'Fight', 'Guard', 'Item' etc.).


Does anyone know if there is any way to do this? I tried a workaround method by selecting 'Attack an Enemy' as a restriction and using Yanfly's Weapon Unleash to replace the attack skill with the desired spell, but that causes the actor to target a random enemy, which is not what I want.


Below is a link to my previous thread in the JS plugin request forums about my idea of channeling magic. The linked thread gave me a lot of useful advice, but due to changes in the Buff & States Core, the method described there (using the <Custom Turn End Effect> notetag) doesn't work for the automatic casting anymore. 
 

killerfer

Veteran
Veteran
Joined
Nov 4, 2015
Messages
198
Reaction score
51
First Language
Portuguese
@Punamaagi


I just happen to still have the skill I made to help you the other time, and it's not working. The battler simply ignore the force action and waste a turn. Is the same happening to you? I think this is a bug on Yanfly Battle Engine Core. Have you tried asking him/her about it?
 

Punamaagi

Hero on their own terms
Veteran
Joined
Jan 23, 2016
Messages
231
Reaction score
338
First Language
Finnish
Primarily Uses
RMMV
@killerfer


Yes, the same thing is happening to me. I tried to change <Custom Turn End Effect< into <Custom Turn Start Effect>, too, but that just leads into the situation I described above (i.e. player getting to input a command on the battler's turn).


Since the channel is heavily based on the Buff & States Core, I thought it might have been a bug with the plugin, but apparently Yanfly had to change the plugin because forced actions were causing problems in the earlier version. I actually asked about this in Yanfly's own plugin thread and got a reply suggesting me to ask here and to try finding an alternative way of producing the effect. (link to the thread and reply below)
 

Punamaagi

Hero on their own terms
Veteran
Joined
Jan 23, 2016
Messages
231
Reaction score
338
First Language
Finnish
Primarily Uses
RMMV
After Yanfly released the Target Core plugin, I have been trying to see if I could combine it with the Battle Engine Core, Buff & States Core and Weapon Unleash to achieve the effect I want. Here is the basic idea (though it hasn't changed much from my previous posts):

  • Actor casts Spell 1, which gives him the Channelling state and saves the index of target to variable 20 (according to the instructions from my previous thread)
  • The Channelling state has restriction set to 'Attack an enemy' and uses the tag <Replace Attack> to replace the actor's basic attack with Spell 2.
  • Spell 2 uses the Target Core to make the spell target the enemy specified in variable 20. 
  • When the Channelling state expires, it forces the actor to cast Spell 3, which is done with Buff & States Core (by typing $gameActors.actor(1).forceAction(15, $gameVariables.value(20)); as the <Custom Leave Effect>).

However, the third step isn't working, and the actor keeps on casting Spell 2 on random targets. I've tried putting this into the Note section of Spell 2:


<Custom Target Eval>


var member = $gameVariables.value(20);


if (member != 0) {


targets.push(member);


}


</Custom Target Eval>


I've also tried copy-pasting the example in the plugin's help file and just modifying it a bit, which leads to a slightly longer variant:


<Custom Target Eval>
for (var i = 0; i < foes.aliveMembers().length; ++i) {
var member = $gameVariables.value(20);
if (member < 0) targets.push(member);
}
</Custom Target Eval>


I'm not sure if I am trying to attain something that's impossible or simply unable to find the solution due to my lack of JavaScript knowledge. :p
 

killerfer

Veteran
Veteran
Joined
Nov 4, 2015
Messages
198
Reaction score
51
First Language
Portuguese
@Punamaagi


I think it's a error from target core. I tried doing it here and the target works fine if the skill is used directly, but when the actor tries to use it by the "confusion" state, it doesn't work. It IS stated as beta version so I think it still needs lots of updates. But I think I found an alternative without using Target Core, but using the Action Sequence Pack 1.


Set a common event to force action for the actor to use the skill with the scope being Last Target. I made common event 2 be Force Action: Harold, Fire, Last Target.


For the channel skill, set the state for your character, like you did before.


Now, set up a dummy skill that does no damage and has no cost. In the notebox set this:


<target action>


common event: 2


</target action>


Of course, you change the number of the common event for your own.


Then in the channeling state you put <Replace Attack: 12> in the notebox


With 12 being my dummy skill, you change that to your dummy skill id.


I tried here and it worked. He attacked the right target every time. And no need for variable to save the target. Although you will need to set common event for each actor (or a lot of if...else statements)
 

Punamaagi

Hero on their own terms
Veteran
Joined
Jan 23, 2016
Messages
231
Reaction score
338
First Language
Finnish
Primarily Uses
RMMV
Set a common event to force action for the actor to use the skill with the scope being Last Target. I made common event 2 be Force Action: Harold, Fire, Last Target.


For the channel skill, set the state for your character, like you did before.


Now, set up a dummy skill that does no damage and has no cost. In the notebox set this:


<target action>


common event: 2


</target action>


Of course, you change the number of the common event for your own.


Then in the channeling state you put <Replace Attack: 12> in the notebox

I finally had time to test this, and I discovered that it doesn't work properly if the initial spell (=the one which gives the caster the Channeling state) doesn't do any damage. If I have three enemies (A, B and C) use my channel skill on enemy B on the first round, the character will still cast the spells on enemy A, who is the default target. My initial spell originally didn't do any damage because it was instant (= speed set to maximum) and was mostly supposed to show a flashy effect, but I ended up turning it into a more normal spell which gives the desired state. It makes much more sense, too.


I wonder if it would be possible to save the ID of the spell into a variable, though, and then make the common event contain a conditional branch to force the actor to cast the appropriate spell? My game won't probably have more than a single character channeling spells, but he will quite likely get several, and it would be nice not to have to make common events for each of them.
 
Last edited by a moderator:

killerfer

Veteran
Veteran
Joined
Nov 4, 2015
Messages
198
Reaction score
51
First Language
Portuguese
@Punamaagi


Does your initial spell have an "action effect" in the <target action>? Because if it doesn't then it won't save the target. You must put the action effect even if it doesn't do damage.


You can also have in the <target action> tag the change variable x = y, to set a variable that you may want to use in the common event for the channeling spell. So you can have a condition for each spell.
 

Punamaagi

Hero on their own terms
Veteran
Joined
Jan 23, 2016
Messages
231
Reaction score
338
First Language
Finnish
Primarily Uses
RMMV
@killerfer Seems like my initial was indeed missing the 'action effect' part. No wonder why it didn't work. *Facepalms* I also realized only a moment after sending my previous reply that I can simply use the 'change variable' command in Target Action (like you said) instead of trying anything needlessly complex.


Well, now that I've fixed all my mistakes, channeling seems to be working exactly the way I wanted them to be. It's been something I've wanted to include in my game ever since I got the idea, so I'm definitely grateful for all of your help.
 

Latest Threads

Latest Posts

Latest Profile Posts

7DcJlIG.png


Made a lot of progress on the tileset for the more sumptuous interior areas for the priory
I keep thinking up of new changes or improvements... Edit: Forgot to add the image Gimpwork.JPG
Hello, my nickname is Rigomor, but I am also known as Mopsikus. I work on RPG Maker games, and are currently working on a game called Peony of War.

Forum statistics

Threads
117,301
Messages
1,106,307
Members
153,485
Latest member
apoctil
Top