If you want the enemy to stay dead, activate a switch on page 3, then make a page 4 with no coding or graphic that is conditional to that switch. : animation: This event, Event On this last page, set the event graphic to nothing. This page is a parallel process, conditional to self switch B. Make some kind of animation for this, and call it "dead". The end links to the final page, for when the enemy is dead. The movement is set to look like the target is being knocked back. : Branch: Switch =ON Animation: This event, Move Route: This event (ignore if can't move) : :$>Move Animation OFF : :$>Change Speed: 6 : :$>Change Freq.: 6 : :$>1 Step Back : :$>Change Speed: 4 : :$>Change Freq.: 4 : :$>Move Animation ON for move's completion Switches:=OFF Variables:-=1 :Else Animation: Player, Move Route: Player (ignore if can't move) : :$>Move Animation OFF : :$>Change Speed: 6 : :$>Change Freq.: 6 : :$>1 Step Back : :$>Change Speed: 4 : :$>Change Freq.: 4 : :$>Move Animation ON for move's completion HP: Party, -1 :Branch End Branch: Variable =0 Self Switche: B=ON :Branch End This sets the fact that if your character is swinging his sword when touching the enemy, then the enemy takes damage. It is an event touch trigger that activates when self switch A is on. DO NOT MAKE THIS A LOOP OR IT WILL FREEZE THE GAME!!!!!! Anyway, this code works fine. If anybody want to try and edit this code, then heed this warning. I actually got help from Melch on this part, so I'll be sure to add in what I originally did wrong. Now for the most complicated part of the code. : Variables:=10 Self Switch: A=ON This sets the enemy's HP to 10. It is a non-conditional parallel process. The enemy will consist of three event pages. Next, make sure that the switch "Sword1" is activated from the start, or this code will not work. Input Processing: Branch: Variable =16 Switches:=ON Branch: Player is facing Down animation: Player, move route: Player (Ignore if can't move) : :$>Change Speed: 6 : :$>Change Freq.: 6 : :$>SE:'064-Swing03', 80, 130 : :$>1 Step Forward : :$>Change Speed: 4 : :$>Change Freq.: 4 for move's completion Switches:=OFF Variables:=0 :Else Branch: Player is facing Left animation: Player, move route: Player (Ignore if can't move) : :$>Change Speed: 6 : :$>Change Freq.: 6 : :$>SE:'064-Swing03', 80, 130 : :$>1 Step Forward : :$>Change Speed: 4 : :$>Change Freq.: 4 for move's completion Switches:=OFF Variables:=0 : Else. The animations will be called "attackUP", "attackLEFT", "attackRIGHT", and "attackDOWN". I'll show a sample using the same switches and variables. ![]() Then set the above code under conditional branches for each direction the player is facing, adding the animation code just before the move event. The first frame has the sword at a positive 45 degree angle from where the player is facing, the secon frame has the sword facing where the player is facind, and the third is a negatice 45 degree angle. I am not good at explaining this part, but basically, make 4 animation files. Then go to the animation editor and make each animation of the swinging sword. To do that, import the picture of a sword into the animations folder. To add more detail, make an animation of a sword swinging. Input Processing: Branch: Variable =16 Switches:=ON move route: Player (Ignore if can't move) : :$>Change Speed: 6 : :$>Change Freq.: 6 : :$>SE:'064-Swing03', 80, 130 : :$>1 Step Forward : :$>Change Speed: 4 : :$>Change Freq.: 4 for move's completion Switches:=OFF Variables:=0 :Branch End What this does is make it so that when you press D, your player moves forward one space quickly, making the sound of a sword swing. Also make a variable called "attackON", and a second switch called "swordON". Call this event "Melee attack", and the switch "Sword1". ![]() Set it to a parallel process to a switch. A swing of the sword, a flying fist, whatever! This will take two different events. Part 1: Melee attack: This is the coding for the basic attack. There are four parts I will cover, and this tutorial covers part one. ![]() This is going to go into how to make a real-time battle system, where your character encounters enemies that move and fight, while you move around, avoiding attacks and fighting back. it feels odd being the first to write an RMXP tutorial, but here it goes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |