Need help with a pretty complicated boss fight (Solved!)

I swear this must be getting annoying for you xd
unknown.png

It IS a parallel process, btw

I play tested it, this comes up when i get to the boss :
unknown.png

Did i do something wrong?
PS: My slash event is empty, I tried removing the 1st page of the boss, still didn't work. So close.
No, you did nothing wrong. There was a typo in my previous message (I wrote nt instead of ny). I am going to edit the message to correct that.

EDIT: Just a little piece of advice. In this situation the else branch is not needed. Remove parts you do not need whenever possible to make your events easier to read.
Okay! I changed it, No more errors!
However, the boss does not teleport and just stays where he originally was. Should i make him teleport with an event?
Is the boss your event number 1? Because than is supposed to only move your event 1 and 2, no other events are involved.

EDIT: I changed a couple of things that were wrong in the original script call. None of them has anything to do with your boss not being moved properly anyway. Now that I can access the engine I tested it and it works in my project. It should work in yours as well.

As a side note...now that I can access the engine I have a question: why is your script box so damn small in both height and width? I could put EVERYTHING in a single script and still had lines to spare (or space at the end of each line). It sounded weird to me that such a short script call was exceeding your box limit but based on your screenshots there was no doubt about it. However now that I can see it in my own engine I can say for sure that your is way too small.
Spoiler: Script 1: multiple instructions per line
Script.png
Spoiler: Script 2: one instruction per line
Script2.png
Alright, it wasn't. So i removed all the events and copy pasted the boss one. It works now, however, There is a last problem:
This time, it's animation related. The dude does teleport to me now, and everything works perfectly. However, the animation isn't right as he basically becomes invisible. I'll try to fix that by myself and have a back up of the event in case i screw it up. (At first, i'll try copy pasting the sprites into the walking animations since all i have right now is down,left,right,up. If it doesn't work, I'll start messing around with the direction commands in the script.
I'll keep you informed.

EDIT : Alright, its not an issue with the sprites. Weird. While writing this ^, I forgot one little detail. I can't script :distrust:
halp?
Also, Worth mentioning, It's a little too fast. And by too fast, i mean that it literally obliterates the characters' health in less than 5 seconds (-60HP, character has 400.).
I tried adding "Wait" events, didn't change anything. Is it script related?
(Crap. Accidental repost.)
Ok, you ran into the problem before reading my fix for it. I was just editing my previous message here to tell you to copy/paste the script once more. Those changes I made are for animations.

@Archeia do you know anything related to the weird question (the one in the edit) in my previous post? Based on the screenshots the OP provided I can tell the OS is different from mine. Does VX Ace have a different script box size for each different OS?
ouch. Sorry. I didn't see the Edits when i wrote that. I'll try it.
Also, got a windows "hack" that lets you turn non resizable windows into resizable ones. Got one, and it worked. I can finally put 43245 lines of code into one script! yasss
Also, are you sure it's $game_switches[6] = false at the end? and not something else like 31?
Alright, this is weird.
So i tried writing both of your scripts. Line by line (2nd one) first, it tells me something like "expected $end}". So i added it at the end, and it told me something about an unexpected "map" problem.
I tried the 1st one then. This shows up :
upload_2019-3-10_18-31-33.png


Also, Just for information. I'm not (actually) supposed to remove the old ones, right? Because i did.
And if it was the wrong thing to do, you can officially call me an idiot.
You are supposed to replace the old one with the new version of the script itself. That error means you are storing in either p, boss or slash something that does not exist. Since you mentioned $game_switches[6] I have to clarify this: those screenshots were used in MY project so they refer to MY events ID as well as MY switches. Do not copy things from my event, copy them from my previous message. It has been modified accordingly. If you take a look at that you will see that there is no line using $game_switches[6] at all.

The error you got means you stored in either p, boss or slash something that does not exist (thus nil). If you copied the events in my screenshots that is 100% because of that, if you copied the right one from my previous message and are still getting that issue I suggest you to check your event IDs once more. That might be the cause. The script call itself is not at fault here since it is tested and works in a blank project.

As a side note it is probably better if you do not use your boss event as parallel process and use another blank event instead. That way you can use switch 31 to trigger a second page of your boss event to show the new animation (with the other sprite). That way you do not have to change your boss graphics in the script.
Okay so, in recap :
1.Event "boss" which is ID:001
2.Event "Slash" Which is ID:002
3.Make a blank event, and add the script in it. (Here's the thing, do i put it just blank as a parallel process, or do i make it so the script only happens when the variable for the random attack thats for the slash gets rolled?
4.Use the boss for animations
5.make sandwich
Anything wrong in here?
Here's the thing, do i put it just blank as a parallel process, or do i make it so the script only happens when the variable for the random attack thats for the slash gets rolled?
Just use the invisible parallel process event for the whole boss fight, this way you only have to handle a single event. Boss and slash events will just be simple bystanders moved by that single event.

Everything else is correct (sandwich included).
Alright. I made the sandwich, and now i am ready for my endless, ruthless battle against RPG Maker VX Ace.
I did everything, Checked IDs, Made it so the invisible script is used for the whole boss fight, etc.
I play tested to check, and the boss teleported to me and started playing the first frame of the slash animation. However..
upload_2019-3-10_20-17-45.png


I feel like this is the last step before i can finally have something that sounded so simple, yet is incredibly hard for me to pull off. (i also learnt a little bit of ruby in the process, haha)
There was a typo in the code. You need to either add a space between "+" and "2" in the lines with
Code:
boss.set_direction(boss.direction +2)
or remove the space between "boss.direction" and "+".
Code:
boss.set_direction(boss.direction + 2)
boss.set_direction(boss.direction+2)
Pick one of the previous or just copy/paste the whole script call from my previous post.

IMPORTANT: there were two typos so be sure too fox them both.
Spoiler: Why the error happens even if you can write a sum either with or without spaces
The error happens because when writing a sum without spaces ruby treats everything before the "+" and everything after it equally. However if you put a space before "+" and then put a number after it without a space before it (in the previous code it was"+2") it gets converted into Fixnum as a whole (thus making the "+" symbol part of the number itself and nullifying the sum).

I have to thank you for that. In my project I did not make any typo, I just made it while copying the script call here. If not for that I would have never known about that strange conversion behavior in ruby (not to mention it is not documented in the official documentation either and I had to find this out through tests).

I can say I am quite satisfied about this thread. Not only did I learn something new about different operative systems possibly affecting the way the engine handles script boxes, I also learned something completely new about ruby itself.
Well. At least i contributed into something in this thread that wasn't just me being dumdumb and asking questions xd!
Thanks for the answers. It really helped. I'll try it tomorrow as i cannot access the engine right now.
I'm honestly surprised you even took the time to answer all of these and actually help me out, like, wow. Thanks.

Edit : So, from what i understand, all i have to do after fixing the script is to just make the animations and make the timing in the script So it doesn't play 32 trillion times in one nanosecond, And also make it enable a switch that enables the animation, and then disable said switch after the attack ended? woahhh
Also, Will the "event" in front of the boss will keep damaging the player or is it only for that one slash ?
Spoiler: Timing event and animations
So, from what i understand, all i have to do after fixing the script is to just make the animations and make the timing in the script So it doesn't play 32 trillion times in one nanosecond, And also make it enable a switch that enables the animation, and then disable said switch after the attack ended? woahhh
Also, Will the "event" in front of the boss will keep damaging the player or is it only for that one slash ?
If your event is properly made then it will only deal damage when the condition triggering that conditional branch is verified AND the player does not evade the attack. Changing boss and slash direction should create the animation on its own, you should not do that on your own as the script call should already to it. Of course you can modify the amount of time to wait in the script call if you want to wait a few more frames.
I'm honestly surprised you even took the time to answer all of these and actually help me out, like, wow. Thanks
I am glad you appreciate it. Having someone appreciating your efforts is always nice. However you do not need to thank me at all. I answered all those questions because I wanted to and because I honestly think it is quite bad to say something and then run away as soon as things start getting nasty. One thing is if somebody else is helping and answering before you do, another thing is to just disappear. Other than being extremely rude it is also against the rules:
Spoiler: Support Forum Rules
After posting a solution:

1) Answer any follow-up questions.

Try to keep track of the threads you've posted in and see if the poster has any other questions.
Spoiler: Helping someone is not just answering to a single question
Helping someone means guiding him/her through the right path. That might require more than just a couple of posts. And anyway a few issues were caused by my typos so how could I leave that to you? I did not have access to the engine when I originally wrote the code but once I have been able to access it checking my code was just one of the things I planned to do.
Spoiler: Your question compared to basic questions. Why helping you has not been annoying at all
Honestly speaking this thread has not been annoying even once. If I had to find something annoying that would be answering basic questions that have already been answered tons of times in many different threads. There is no merit in just answering the same thing to the same question over and over. And while there is no dumb question those question have already been answered and as such they should not be asked because the answer is already here.

Even so people still ask them. Sometimes because they do not want to look for the answer beforehand, other times because they did not go through tutorials. In the end they simply did not read the rules, otherwise they would have known that they have to check tutorials and use the search function to see if a similar problem was solved in a different thread (in both cases they would have found out why their character cannot move).

On the contrary helping people to achieve something out of the ordinary - be it animation trickery, complex eventing or anything else that is not just "basic" - is quite enjoyable. It is more challenging and thus more interesting and in the end it is also more rewarding. Knowing that somebody achieved what he/she wanted to thanks to you - not because you copy/pasted a link to an already existing tutorial but because you took active part in searching for a solution - gives off quite a nice feeling.
Yep, I am happy to say that the thing finally works!
The only problem now is the animation, as the slash animation just keeps playing while i want it to only play once. (and, thankfully, it only does damage when the boss teleports, or in my case, when the boss flashes xd). Yeap, because i tried not making any animation for the boss,
The boss just teleports and plays no animation at all, becoming literally invisible. Same thing for the slash, as i did this :
upload_2019-3-11_11-47-51.png

Well, thinking about it, maybe i could try and make a "wait" the time that the attack itself stops..

Either way, the "core" think works nice. (which is the boss teleporting and attacking, while not spamming the player if he stays still)
Spoiler: Do not use a wait command
The wait would be extremely useless as it does not prevent the animation from running more than once but (instead) it could make things worse and display the animation in a moment when it is not supposed to be displayed. At least as long as it plays continuously it is easy to find mistakes.
What you should do is turning the switch off after performing the attack. However since the script call already includes a way to animate your slash why are you using a different event to do that? The second page of your slash event is just meant to show some graphics, everything else should be handled by the script call itself.

I was not joking when I said that it is better to have a single event handle everything. Just leave everything else blank with just graphics to be displayed. Leave everything else to the parallel process event.
So, do i have to edit anything in the script so it actually animates it ? because right now, i tried to leave everything blank (slash & boss),
The boss is still invisible (although i made sure to make him visible in the boss event), and the slash does not work out well. Also, yeah. I turned off the switch after performing the attack.
although i made sure to make him visible in the boss event
What do you mean? Could you post complete screenshots of your events?

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-a-pretty-complicated-boss-fight-solved.106584/