VitaliaDi

Jedi Master
Veteran
Joined
Mar 11, 2019
Messages
172
Reaction score
159
First Language
English
Primarily Uses
RMMV
I'm working on a game that when the player hit a button, either a key or the mouse, their sword is swung to hit an enemy. The sword would be it's own sprite that would connect to the player but I don't want it to be active all the time, just when they swing it to hit an enemy on the map. Think Legend of Zelda type games.

I'd want the sword to deal damage when it touches the enemy, so the plugin would have to work with events like that etc.

EDIT: I've decided to go the eventing route as usual. I'd love some tips on how to do this. I know I'd need to make use of variables etc. If anyone has made a system like this before out of events I'd love to hear from you.
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,807
Reaction score
2,867
First Language
EN
Primarily Uses
RMMZ
This sounds like a simple form of what's sometimes called an "ABS" (Action Battle System). ABS plugins tend to be quite complex and have a bit of a learning curve (i.e. "you've been warned" xP). I haven't tried any myself, but I understand there's a few out there, e.g. QABS: https://forums.rpgmakerweb.com/index.php?threads/qplugins-latest-qabs.73023/ :)

Alternatively you could try to rig something using events, with or without the help of plugins (e.g. Yanfly's Button Common Events and Self Variables). I imagine it would be doable but challenging. :kaoswt:
 

VitaliaDi

Jedi Master
Veteran
Joined
Mar 11, 2019
Messages
172
Reaction score
159
First Language
English
Primarily Uses
RMMV
@caethyril Thanks! Do you know which ABS plugin is the easiest? I really only want it for the simple stuff.

Or if you have tips on eventing this that would be even better. I usually prefer eventing to plugins anyway since I don't script.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,691
Reaction score
9,863
First Language
German
Primarily Uses
RMMV
Do you know which ABS plugin is the easiest
there are no easy ABS at all - even the simplest ABS will require some knowledge and configuration from you.

And there aren't that many ABS at all - because each ABS takes the programmer years to write.

You can only go through the plugin forum on this board searching for anything with ABS in its title and hope that it was completed (several are unsupported ruins due to the programmer leaving the community) and is something you can understand.
 

VitaliaDi

Jedi Master
Veteran
Joined
Mar 11, 2019
Messages
172
Reaction score
159
First Language
English
Primarily Uses
RMMV
You can only go through the plugin forum on this board searching for anything with ABS in its title and hope that it was completed (several are unsupported ruins due to the programmer leaving the community) and is something you can understand.

Sounds like I'll be trying my hardest to try to event it then. I've been searching the forum and most people have either found some ABS plugins and had issues with them working with other plugins or the posts are so old the ABSs aren't even out yet. Thanks for the clarification.

If anyone has some eventing knowledge related to ABS systems that would be more helpful then.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,691
Reaction score
9,863
First Language
German
Primarily Uses
RMMV
eventing knowledge related to ABS
eventing an ABS is possible - the biggest restriction on an evented ABS would only be the fact that special attacks or magic is almost impossible to event, but simple attacks are relativly easy.
the enemies would be set to move on the player and on event touch do something like harming him
the player would have a chance to attack first - the way with the button could either be done with a plugin or with a parallel process

and then you'll use control variable commands and get location info to see if there is an event in attack range and direction to the player and if yes modify that event.

You'll need scripts to manipulate an events self-switches, or you would be limited to a very low number of enemies per map if you want to control them by preselected general switches.

You might also want to think about a plugin that gives you the ability to copy, clone and control events.
 

VitaliaDi

Jedi Master
Veteran
Joined
Mar 11, 2019
Messages
172
Reaction score
159
First Language
English
Primarily Uses
RMMV
@Andar Thanks this is really helpful! I didn't even think about the get location info. This leads me in the right direction to start.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,704
Reaction score
560
First Language
German
Primarily Uses
RMMV
Use Screencoordinates for Hit detection of player sword, dont use Map coordinates.
Because if enemy moves fast, the mapcoordinate will change before the event starts moving to the next tile.
that can cause a swordslash visibly to hit enemy, but the mechanic isnt counting it as one. this creates frustrating moments.
Screencoordinates solve this fully.

This isnt very good and just the Basics, but maybe it helps. To create a Hitbox.
Sadly i have no working Demo at the moment, only all the code scattered around.
Thanks to Caethyril for Help with the Hit Box.
Common Event 1:
Is button W pressed? If yes activate Switch for Common Event 2.

Common Event 2:
Code:
◆Control Variables:#0004 Sword Damage = Random 1..150 //Random Damage
◆Control Variables:#0001 Sword Slash X = 0
◆Control Variables:#0002 Sword Slash Y = 0
◆If:Player is facing Down
  ◆Show Animation:Player, <3> Slash Down
  ◆Control Variables:#0002 Sword Slash Y = 48
  ◆
:End
◆If:Player is facing Left
  ◆Show Animation:Player, <3> Slash Left
  ◆Control Variables:#0001 Sword Slash X = -48
  ◆
:End
◆If:Player is facing Right
  ◆Show Animation:Player, <3> Slash Right
  ◆Control Variables:#0001 Sword Slash X = 48
  ◆
:End
◆If:Player is facing Up
  ◆Show Animation:Player, <3> Slash Up
  ◆Control Variables:#0002 Sword Slash Y = -48
  ◆
:End
◆Script:var hitDist = 0;  // just for readability
:      :for (var a = 3; a <= 100; a++) { // Events 3 to 100 can be Hit by Sword
:      :  if (!!$gameMap.event(a)) {   // check that event exists
:      :    hitDist = Math.hypot($gameMap.event(a).screenX() - ($gamePlayer.screenX() + $gameVariables.value(1))   ,   
:      :                         $gameMap.event(a).screenY() - ($gamePlayer.screenY() + $gameVariables.value(2)) );
:      :    if (hitDist <= 30) {  // in range?
:      :
:      :        $gameSelfSwitches.setValue([$gameMap.mapId(), a, 'A'], true) //Hit Event got self switch A on when hit, so you can do some magic or prevent it from attacking
:      :        this.setSelfVariableValue($gameMap.mapId(), a, 46,this.getSelfVariableValue($gameMap.mapId(), a, 46) + $gameVariables.value(4)) // boom damage dealt, include a Death Eventpage with var46 as pagecondition and the Max HP until dead, self var plugin is awesome for this.
:      :      } } }
◆Loop
  ◆If:Button [Pagedown] is pressed down // You pressed the slash, now release it to end the event in case you kept holding that button
    ◆Wait:1 frame
    ◆
  :Else
    ◆Break Loop
    ◆
  :End
  ◆
:Repeat Above
◆Wait:2 frames
◆Control Switches:#0002 CE_Sword_Slash = OFF

I included Yanflys Self Variables Script. I made Game Variable 46 pointer to Event Self Variable. Self HP = Var46.
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Whoever decided that the 5th area of Xenoblade 3 had to be THAT big and be explored in the manner it does needs to be shot. My OCD cannot leave a tiny shard of the map hidden and those controls can go right on and f*** themselves. -.-

/rant off
Raggon wrote on NoPatience's profile.
:kaohi:
Anyone know of any good guides for editing the UI in RMMV?

Forum statistics

Threads
124,433
Messages
1,163,599
Members
163,243
Latest member
coldguyim
Top