Action Battle Script: Getting the Enemy to Attack

Kyonko802

Villager
Member
Joined
Oct 10, 2015
Messages
27
Reaction score
10
First Language
English
Primarily Uses
I'm new to scripting and making an action battle system so I'm probably gonna be in here a lot. I have the shell set up for the player character attacking and doing damage and all that, but I'm sure I'll run into a problem with that later because I barely know what I'm doing. But hell, I can only get experience by writing my own scripts and asking questions so here we go:

I was wondering how to put enemies on the map and get them to detect that my player is in front of them for an attack. I've looked through the help file and google but I couldn't really find anything. I was able to accomplish this with an event and some variables in the RPG Maker engine but it feels... clunky if that makes sense. I would rather script it all myself than rely on a workaround method.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,425
Reaction score
7,710
First Language
German
Primarily Uses
RMMV
I'm new to scripting and making an action battle system
You know, picking the most complex and problematic type of script to write might not be the ideal choice for a beginner to programming...
Can you tell us what your experience with programming is? Because if you're still learning, you can basically forget this and should place it on hold for a year or so while gaining experience with simpler scripts.


If you have some programming knowledge - enemies on the map are usually simulated by events. So in the basic game loop, you have to check every event for some marker that identifies it as an enemy instead of an object/decoration/story element.


Then for each event identified as an enemy, you have to check where it is in regard to the player and either move it with a pathfinding script or have it attack.
 

Kyonko802

Villager
Member
Joined
Oct 10, 2015
Messages
27
Reaction score
10
First Language
English
Primarily Uses
wow... that's really tedious.

And I am still kind of learning, but this is a lengthly project to put it simply. I've created a few simpler games in my youth, but I wanted to go for broke this time and actually make a GOOD game for once. I have completed a course and written a few simpler programs, so this is definitely a giant undertaking. So yes I do have programming knowledge, and yes I am a beginner.

So I can make the enemy event as normal in RPG Maker, then fish through the basic game loop, identify it, and customize and tweak it from there?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,425
Reaction score
7,710
First Language
German
Primarily Uses
RMMV
So I can make the enemy event as normal in RPG Maker, then fish through the basic game loop, identify it, and customize and tweak it from there?
No, it is not a "normal" enemy event, because it will not contain any normal enemy data. Your problem is that what you want to use doesn't exist in the engine and - more important - it doesn't exist in the editor either.
Because it doesn't exist in the editor and you can't change the editor, your only choices are either


1) use a different editor (one you would have to write yourself, so forget it)


2) use something that exists in the editor as a marker and build your own data in the engine around it.


And because events have always been intended as placeholders for NPC, you can also use them as placeholders for enemies.


I suggest you start using one of the existing ABS scripts and implement it to see how others handled the interface between the editor and their scripts.
 

Kyonko802

Villager
Member
Joined
Oct 10, 2015
Messages
27
Reaction score
10
First Language
English
Primarily Uses
Gotcha. Thanks for the help.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,357
Members
137,803
Latest member
andrewcole
Top