Projectile map ability

Niloc

Veteran
Veteran
Joined
Jul 27, 2020
Messages
57
Reaction score
3
First Language
French
Primarily Uses
Other
Hello,
I'm building a stealth game in which my character uses some sort of map abilities.

One of the ability I try to build is a projectile that my character can throw at one of the ennemies to temporarly stun them. What I want to do is, when the user press a specific key, then the player throw a projectile in the direction that the character is facing, and if it collides with an ennemy, then something happens to the ennemy.
I'm really not sure how to get started on this.
Here is a quick draw on how it would look :
ScStun.gif

Does anyone have an idea on how to do this ?
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
285
Reaction score
262
First Language
german
Primarily Uses
RMMV
Chances are high that there are already Plugins out there doing actions like you described. In short, I can tell you a solution that only requires eventing. When you are a beginner in MV then it could be a little bit difficult but it will teach you a lot of what RMMV can.

Make a Event with parallel process. It wont work well as Common Event, because with all the Variables and Event IDs some parameters are map-specific. Then make a Event that represents the bullet.

The bullet event (parallel process):
Place it at any location of your map. With eventing we can spawn it at the Player's position. The even't page should have a switch as condition so the bullet is only visible when the Player fires.

The main event (parallel process):
Using IF statements you can check if a specific key is pressed. Using Plugins you can expand it and use eg. the Ctrl button. But lets keep it simple and use Space. Once the player presses that key, you do this (roughly)
- store X, Y coordinates and direction of the Player using Variable OPs
- There's a command to move an event to specific position. Call this command and use the variables we just stored. Using a Move Event you can turn the bullet into the player's direction.
- Make some switch OP to activate the bullet event.
- by the way, once you gained more practice, you can use this switch as condition to not fire twice within a very short time

Now we go back into the bullet event:
- store its X, Y coordinates using Variable OPs
- the following must be repeated for each guard. So for each guard, you store their X, Y coordinates, too.
- using IF conditions, you can check if the bullet's X any Y coordinates are identical. Then you got a hit.
- you need some mechanism to erase the bullet and allow the Player to fire again. Turning off the Switch could do the trick.

Well, this is a very briefly instructions to do it. You may need some hours until everything works fine. But then you have learned a lot about RMMV to improve this mechanic. Like, the bullet should dissappear when it hits a wall.
 

Niloc

Veteran
Veteran
Joined
Jul 27, 2020
Messages
57
Reaction score
3
First Language
French
Primarily Uses
Other
Well that could work indeed, the thing I am a bit worried about with this method is that I'm gonna have maybe hundreds of Guards during the whole game, so I would have to individually store their coordinates all the time ?
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
285
Reaction score
262
First Language
german
Primarily Uses
RMMV
Ah okay, well then you should look if there's a Plugin out there or, if not, make a request in JS forums. I bet you are not the first planning to do this mechanic, so there should exist. a Plugin
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,430
Reaction score
4,486
First Language
English
Primarily Uses
RMMV

I've moved this thread to JS Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

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

Latest Threads

Latest Posts

Latest Profile Posts

Currently without internet due to storm damage and most of our state is devastated. No idea how long I'll be unable to log onto here, but I'll answer questions as soon as I can.
This is supposed to be pso2 photon blast inspired animation
I'm sure this question's been asked before, but I can't find an answer: is there any way to run the Steam version of RPGMaker *without* being logged into Steam? It's a frustrating extra step sometimes.
Been seeing bright flashes in the sky for a while, and thought it was my eyes playing tricks on me. Nope! Lightning. Now it's raining heavily. Seeing lightning, but not hearing thunder, is weird.
Small Update for myself:
>Two Dungeon maps are done, Dungeon 3 is in progress. Dungeon 4 needs work.
>4 characters set up out of a possible 6 but those come later.
>Hub area needs work.
>Game completion..., 20-25% maybe?

Forum statistics

Threads
100,713
Messages
978,679
Members
132,330
Latest member
jakobwolf
Top