How to implement a simple projectile system?

Bladeration

Villager
Member
Joined
Jan 25, 2014
Messages
10
Reaction score
0
First Language
German
Primarily Uses
So with Vexed's Horror City Battler Archive Content I'm finally able to make the player shoot at zombies.
Pressing the Spacebar now plays the shooting animation and all looks great, however there's still no projectile flying around. What's the best and most vanilla way to implement a simple "bullet"?


I've already implemented an invisible event that'll start moving away from the player after firing but soon realized that "event touching another event" isn't a valid trigger option. I also want something different to happen whenever the player talks to a zombie and zombies should have custom movement parts (so the zombie events can't have anything related to projectile processing).


Any ideas?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
basically you'll need a parallel process comparing the coordinates of the bullet event with the coordinates of other events.

or you'll have to look for an ABS-type plugin that changes the entire battlemechanics
 

Bladeration

Villager
Member
Joined
Jan 25, 2014
Messages
10
Reaction score
0
First Language
German
Primarily Uses
basically you'll need a parallel process comparing the coordinates of the bullet event with the coordinates of other events.
But wouldn't this require to declare and update two variables (X,Y) for every zombie event? On a larger map with, let's say 10 zombies, this would already fill an entire variables-page... Or am I just missing a simpler approach?

So far I've tried to avoid ABS plugins as they tend to change so much more and can be pretty difficult to set up.
 

Johnny_Ray

Villager
Member
Joined
Sep 11, 2019
Messages
23
Reaction score
21
First Language
English
Primarily Uses
RMMV
Maybe this could help you:
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
two variables (X,Y) for every zombie event?
not automatically, there are other ways depending on how you wish to handle this

you can test before you move the projectile and use get location info command on the coordinate the projectile will move to. It will give you the ID of an event on that position or zero if there is no event

and there are a number of other ways like reusing variables
 

Bladeration

Villager
Member
Joined
Jan 25, 2014
Messages
10
Reaction score
0
First Language
German
Primarily Uses
alright thanks for all the answers, guys!

you can test before you move the projectile and use get location info command on the coordinate the projectile will move to. It will give you the ID of an event on that position or zero if there is no event
This one did the job. Once the player shoots the projectile, it checks the tile adjacent to the direction of movement for an Event ID. If it's zero (== no event) it keeps moving, if it's not then a variable is set to the specific event ID. Now each zombie has a different value of that variable as a condition and making use of higher page priorities and self switches, only the zombie that actually got hit by the projectile "dies".
Additionally I've added a movement check, to see if the projectile has moved at all even when the Event ID returns 0. That is to prevent an infinite loop if the projectile reaches the maps end without hitting anything.

It's far from perfect but all I need for now. Thanks again for the responses!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,539
Members
137,834
Latest member
EverNoir
Top