NPC that fights in the map

AlexPlayer3000

Villager
Member
Joined
Sep 23, 2018
Messages
20
Reaction score
0
First Language
Italian
Primarily Uses
Other
Hello, i wanted to create a game where the player will travel through a large map full of enemies, but i also want some NPC that aren't in the party, like soldiers, to look for the events that trigger a battle with the enemies, walk to that events, blocking them, and then there will be a 60/40 chance that or the guard or the monster get killed and disapears after a while, and then respawn.
It would be great if the guard could collect XP and loot that the player can obtain later.

Is there a Plug-in or a vanilla way to do this?
 
Last edited:

PresaDePrata

Veteran
Veteran
Joined
Dec 4, 2014
Messages
83
Reaction score
16
First Language
Portuguese
Primarily Uses
RMMV
You can do this vanilla way, but it will be a lot of repetitive work.

I suggest you check Yanfly's event scripts (search for event). They add a ton of time saving functions and ways of doing several gameplay wise actions.

The part where an event triggers another event, i just got a reply by @ImaginaryVillain on an issue of mine which may just do the trick:

Create an if statement, and in the script section of it put...

JavaScript:
$gameMap.distance($gamePlayer.x, $gamePlayer.y, $gameMap.event(this._eventId).x, $gameMap.event(this._eventId).y) === 0;

Then put whatever you want it to do when it touches the player inside of the if statement. You'll need to set this event as a parallel, so you'll probably want a wait command in there so the player can respond. If you wish to use another event to do the checking, replace "this._eventId" which the eventId you want to check.
 

AlexPlayer3000

Villager
Member
Joined
Sep 23, 2018
Messages
20
Reaction score
0
First Language
Italian
Primarily Uses
Other
That... doesn't help at all... because i don't know anything about scripting
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,009
Reaction score
7,019
First Language
German
Primarily Uses
RMMV
That... doesn't help at all
sorry that you feel that way, but your request is too far outside the engine's default (which have no event-to-event-triggers at all).
And plugins are not wonder-machines. They can add functionality, but the more complex they are the more configuration they need. And that configuration will often require at least some basic knowledge of computer logic or direct javascript knowledge in the more extreme cases.

at this moment your choices are to either start learning how to use scripts and plugins, or to reduce the scope of your idea to something lesser. Or you could try to find someone you pay for writing such a specific plugin, because that is too much work to be requested for free and very unlikely to be done that way without some payment.
 

ImaginaryVillain

Now A YouTube Cool Kid! =D
Veteran
Joined
Jun 22, 2019
Messages
421
Reaction score
1,525
First Language
Absurdism
Primarily Uses
RMMV
It really depends on your plan here. If you just want the two to meet up the same way every time. You could just move them both via move commands and have a random number decide the outcome. Then increment a treasure variable every time the guard wins a fight, and at the end give rewards based on the treasure variable.

This method could even start with a random chance to pick from multiple pre-programmed routes. So it doesn't always look exactly the same. Of course the downsides to this are you'll have to manually make all of the move routes, and it won't look very random. But it's definitely the easiest way, since you don't need any scripting.

If you wish to create a whole event interaction system so it can be truly random. Well, that's going to take scripting. Though you might be able to repurpose one of the ABS systems like Chrono Engine, Alpha ABS or QABS.... But make no mistake about it, event interaction in MV is no cakewalk.
 

AlexPlayer3000

Villager
Member
Joined
Sep 23, 2018
Messages
20
Reaction score
0
First Language
Italian
Primarily Uses
Other
You could just move them both via move commands and have a random number decide the outcome. Then increment a treasure variable every time the guard wins a fight, and at the end give rewards based on the treasure variable.

This method could even start with a random chance to pick from multiple pre-programmed routes. So it doesn't always look exactly the same.
Thanks, i will try that way
 

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

Latest Threads

Latest Posts

Latest Profile Posts

So, the other day i come across to became closer to other developers and realiza im not even a novice. i am lower than thrash rigth now, worse than people that don´t know anything about this things cause i used to think i knew. good news is; today thrash, tommorrow, maybe not so much, and someday, i´ll be a god?
Ahh, end of the day stinky feet, fresh out of the boots. Smells like a job well done. Seriously, I have to rinse my feet when I get home, or it's not fair to my wife.
Stream will be live shortly with some pixel art! Feel free to drop by!

Can't believe I forgot to put an image of my drawing pad! It looks kinda like this, maybe I'll get a better pic tomorrow...
Backup tip: If you don't want to back up your whole project every day, at least back up everything *except* your Image and Audio folders, which you can do weekly/as needed/etc.

Forum statistics

Threads
97,829
Messages
947,200
Members
129,039
Latest member
elskampo
Top