Trying to create a Tutorial Battle.

Okay, I'm in the process of trying to program my Tutorial Battle. What I want to happen is that before you get to attack, that some dialogue appears between the two characters I have at the moment.


And then the battle window shows.


And if you physically Attack them instead of using a Skill, the Slime (specifically) has a chance of stealing your weapon. No, I have no clue how to program that in JS, any help would be great because nobody is answering my question about Enemy Thieves in JS Support at all.


When it does so the first time, more dialogue shows up, talking about the theft, and triggering the Battle Equip plugin from Yanfly, where he switches to a different weapon. And then the battle continues until the Slimes do a suicidal explosion attack that leaves my characters alive at 1 HP each but under the Slimed effect I made (lowers Agility, can only be removed by Water attacks which washes it off). And then the battle ends.


Does anybody have any advice on how to do any of this?
Well for the Dialogue, you could  use Battle events.


Create an event, create a switch, like "tuto battle" and set it on.


In your tuto battle troop, setup an event page with the condition "Tuto Battle" switch on, in that event, make your dialogue, and at the end of the dialogue, turn off "Tuto Battle" Switch


For the Theft, does that weapon theft becomes a recurrent game mechanic feature later, or do you want to implement this to illustrate the battle equip Plugin?
I think I already have a "First Battle!" Switch...


Both for the theft thing? 


And what about reducing my actors's HP to 1 at the end of the battle? Or any move?


edit: Wait, could I just apply the Second Chance effect if I want them at 1 HP?
Is your "first battle" switch already doing something else?


for the theft thing, tbh I don't know how to set that up either. I tried to look at your JS thread, but I'm not really into coding...


for the self destructing effect  that leaves target at 1 HP, make a new skill damage Type HP, a custom formula of :


a.addState(1); b.hp-1 and a variance of 0%. you can add to this attack an effect that will give the "Slimed" Status.


Sadly with this method there is no collapse animation...
Nope, it's not even been used yet. I think I temporarily forgot it existed until you reminded me, since I have like at least 25-30 Switches made right now... hehe...


Damn. No wonder Yanfly's such a Godsend. Then again, that's not even his code according to him, so he can't help me besides telling me to look at the Script Call list...


So I should modify this?


I would show you the picture I took of my Skill, but I can't upload more than 61.88 KB for some reason, even though it was 4 something before, I don't know what made it change. I'm pressing Alt+Print Screen... >:(  


So I guess I'll just tell you the formula then:

100 + a.mat * 8 - b.mdf * 2

Type is HP Damage. Element is None. Notetag is <HP Cost: 100%> Skill Type is None. Add the State "Slimed" 100%.


Slimed is a state that is Element Rate Water*200%, Agility is Debuffed, and the Notetags say:

<Steal Rate: 40%>


<Custom Respond Effect>


// Get the water element ID.


var water = 3;


// Check if water damage is dealt.


if (this.item().damage.elementId === water) {


// Get the Slimed status effect ID.


var stateId = 110;


// Remove the status effect from target.


target.removeState(stateId);


</Custom Respond Effect>

Which I modified from Yanfly's Freeze code. 🙂 I figured the Steal Rate being raised would be a nice touch. After all, if you're covered in slime, your fingers would be all sticky, right? 😉


Okay, how'sabout this?

100 + a.mat * 8 - b.mdf * 2; a.addState(41); b.hp-1

Edit: Oooookaaay... I have a problem here. My Slimes aren't doing ANYTHING. I reduced their moves to just the explosion attack just to test and see if it was working... and they just stand there doing nothing, letting my guys hit them in the Battle Test. I tried setting the formula back to what I originally had it, nothing. I set it to your formula, nothing. I try the formula above that I cooked up, nothing. 


Please help.
Slimes do a suicidal explosion attack that leaves my characters alive at 1 HP each but under the Slimed effect I made (lowers Agility, can only be removed by Water attacks which washes it off). And then the battle ends.

If you are using Yanfly's Damage Core, Battle Engine Core and Action Sequence Pack 1, you could try recreating the skill in the following screenshot:


Slime Burst.png


That's my take on the suicidal slime explosion skill, and it at least seemed to work when I quickly tested it.


As for the slimes eating players' weapons, that part was recently answered in your other thread over at the JavaScript/Plugin Support subforum (by myself and someone more knowledgeable in JavaScript than me). 🙂
Yep, I got Yanfly's stuff!


Thanks SO much! I'll try this out right now!


Well, I'm facing off against two slimes here. The first exploded fine. The second when it went to explode gave me "SyntaxError unexpected end of input" *tests again* Yeah, against one Slime it's fine, but not multiple ones. Ummm...


Also, thanks for the tip in the JS Support area!
Well, I'm facing off against two slimes here. The first exploded fine. The second when it went to explode gave me "SyntaxError unexpected end of input" *tests again* Yeah, against one Slime it's fine, but not multiple ones. Ummm...

Oops, sorry - I forgot to test about multiple slimes. It seem a bit like the error could be caused by a bug, though, because I got it even after I changed the value to a normal number. I will try to test it in a new project and submit a bug report to Yanfly it needed, but if you want a temporary solution, you could edit the Finish Action part to be collapse: friends, force and try to compensate the missing second burst with action sequences.


I also discovered that you can simply write value = (target.hp - 1); in the Damage Formula and it works fine (for the first use, that is).
According to someone else, add state can only be added at the start of a formula too, I think.
I actually managed to pinpoint the error to my Slimed state. I had copypasted your effect without changing any IDs and such, so naturally the game got confused when it tried to run the Custom Respond Effect. ^^' After the edits, the notebox of my Slimed state looks like this:


<Steal Rate: 40%>

<Custom Respond Effect>
var water = 5;
if (this.item().damage.elementId === water) {
var stateId = 23;
target.removeState(stateId);
}
</Custom Respond Effect>


This version worked for me with two slimes. Naturally, you need to set the value of 'water' to the ID of your Water element in the Types section of Database and the value of 'stateId' to the ID of your Slimed state.


Just to be safe, I also changed the Slime Burst's element to Normal Attack (from None), but I'm not sure if that's necessary.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-create-a-tutorial-battle.60027/