Event's Detecting Player Position

willer111

Hero
Member
Joined
Jul 24, 2014
Messages
24
Reaction score
2
First Language
English
Primarily Uses
Hey I am having trouble with my RPG...

I made a boss Battle on a 1x7 platform

where you are supposed to dodge fire coming up from the ground.

The events are placed so that the player always can go through them(through = ON).

Then if the switch 'Boss Attack#1' is on, the fire will charge for 60 frames then burst into a big flaming dealing damage.

If you walk INTO the flame it will deal the damage and stuff, but if you stand on top of the charging flame, then when it bursts into the big flame...

Nothing.

Anyway to fix?  If i need a script, no problem.

- I made a little video showing what i mean:

http://mfi.re/watch/pfv91m9rdffi4zx/Boss_Battle.avi

(download the video if it doesnt start playing)

(Yes I am using Nintendo's Music and Sounds, but this is no public game, and I am not taking it as my own. (and i bought the soundtrack and gave nintendo credit))

Thanks!
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
You'll need a parallel process event constantly checking the player's current position against all event positions.


That requires quite a number of control variable commands and conditional branches, and if you don't include waits, then it will cause some lag - if you include too many waits, it will react too late to position changes.


One other advice: giving credit for rips doesn't make them legal, so you should make sure that it stays non-public or you risk problems with Nintendo.
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
Do you want the player to only be struck once, when the flame goes up, or do you want it to continue damaging them as long as they're standing in it?

What you can do is assign a variable, Player X, to Player's Map X. You won't need the player Y since it will always be the same.

Then, for each of your fire events, name them something that helps you remember which one is which - perhaps Fire1 is the farthest left, and Fire7 is the farthest right, with the others appropriately numbered in-between.

Now, the fire sprites are considered to be facing down when they're at their tallest point, so what you're really looking to do is to damage the player whenever the fire events are facing down and the player shares an X-coordinate with them.

So, with that in mind, make a parallel process somewhere on the map that's activated by Switch BossAttack1 being on. Then, make a conditional branch: "Fire1 (or whatever you called it) is facing down." Within that, do another conditional branch: "Variable PlayerX is equal to (whatever Fire1's X is [which you can see by looking in the lower-right corner of the editor when selecting the event])." Then, do whatever you want them to do when they take damage: minus HP, flash screen, sound effect, what-have-you.

Here's a quick screenshot to show you where you can find the X,Y coordinates of any particular event:

Now, if you want the player to only be damaged every so often (that is, they get a small amount of immunity time before being damaged again), add a wait time here, too. So, if they can only be damaged once a second by any of the flames, then add a wait 60 frames. If you want them to continue being damaged as long as they're standing in it, then do nothing here (it will be addressed later).

You won't need any else statements for either of these conditional branches, so close both of them out, then do the same thing for all 7 flames. Here's an example screenshot:

Alternatively, if you have some flames that activate at the same time as others, you could have your "PlayerX is equal to" conditional have some else statements - so, if Fire1, Fire3, and Fire6 all go up at the same time, then you only need to do a "Conditional: Fire1 is facing down," because Fire3 and Fire6 will always be facing down at the same time - but instead, you'd add "Conditional: PlayerX is equal to (Fire1's X) ... Else, PlayerX is equal to (Fire3's X) ... Else, PlayerX is equal to (Fire6's X)." So, if Fire1, Fire3, and Fire6 all "burst" at the same time, you could have something like this:

At the very end, you'll want to add a wait 5 or wait 10 or something - as Andar said, if you don't add a wait, there's going to be lag because the event's going to be checked far too often. However, if you wait too long, the player can potentially walk over flames that should be damaging them, but aren't. The other thing is, if you didn't add a space of immunity time, this is also how often the player will be damaged as long as they continue to stand in the fire.
 
Last edited by a moderator:

willer111

Hero
Member
Joined
Jul 24, 2014
Messages
24
Reaction score
2
First Language
English
Primarily Uses
You'll need a parallel process event constantly checking the player's current position against all event positions.

That requires quite a number of control variable commands and conditional branches, and if you don't include waits, then it will cause some lag - if you include too many waits, it will react too late to position changes.

One other advice: giving credit for rips doesn't make them legal, so you should make sure that it stays non-public or you risk problems with Nintendo.
Thanks, I will test some stuff.

- And Nope, not gonna release my game public.

Do you want the player to only be struck once, when the flame goes up, or do you want it to continue damaging them as long as they're standing in it?

What you can do is assign a variable, Player X, to Player's Map X. You won't need the player Y since it will always be the same.

Then, for each of your fire events, name them something that helps you remember which one is which - perhaps Fire1 is the farthest left, and Fire7 is the farthest right, with the others appropriately numbered in-between.

Now, the fire sprites are considered to be facing down when they're at their tallest point, so what you're really looking to do is to damage the player whenever the fire events are facing down and the player shares an X-coordinate with them.

So, with that in mind, make a parallel process somewhere on the map that's activated by Switch BossAttack1 being on. Then, make a conditional branch: "Fire1 (or whatever you called it) is facing down." Within that, do another conditional branch: "Variable PlayerX is equal to (whatever Fire1's X is [which you can see by looking in the lower-right corner of the editor when selecting the event])." Then, do whatever you want them to do when they take damage: minus HP, flash screen, sound effect, what-have-you.

Here's a quick screenshot to show you where you can find the X,Y coordinates of any particular event:

Now, if you want the player to only be damaged every so often (that is, they get a small amount of immunity time before being damaged again), add a wait time here, too. So, if they can only be damaged once a second by any of the flames, then add a wait 60 frames. If you want them to continue being damaged as long as they're standing in it, then do nothing here (it will be addressed later).

You won't need any else statements for either of these conditional branches, so close both of them out, then do the same thing for all 7 flames. Here's an example screenshot:

Alternatively, if you have some flames that activate at the same time as others, you could have your "PlayerX is equal to" conditional have some else statements - so, if Fire1, Fire3, and Fire6 all go up at the same time, then you only need to do a "Conditional: Fire1 is facing down," because Fire3 and Fire6 will always be facing down at the same time - but instead, you'd add "Conditional: PlayerX is equal to (Fire1's X) ... Else, PlayerX is equal to (Fire3's X) ... Else, PlayerX is equal to (Fire6's X)." So, if Fire1, Fire3, and Fire6 all "burst" at the same time, you could have something like this:

At the very end, you'll want to add a wait 5 or wait 10 or something - as Andar said, if you don't add a wait, there's going to be lag because the event's going to be checked far too often. However, if you wait too long, the player can potentially walk over flames that should be damaging them, but aren't. The other thing is, if you didn't add a space of immunity time, this is also how often the player will be damaged as long as they continue to stand in the fire.

Thanks! I fixed it! <3
 

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
I know this game isn't going to be public.  But, FYI, even though you've bought the soundtrack and gave Nintendo credit, unless the license specifically allows you to use the soundtrack in your game, it wouldn't be legal to redistribute, even though it would be legal to play for yourself.

I'm no lawyer but I think there's a different set of rights that apply when giving a "performance" such as putting a soundtrack in a game and playing the soundtrack for yourself.

The Resource Packs are all legal to use in a game you redistribute IF you are running them from an iteration of RPG Maker (or IG Maker), because they specifically grant that right.
 

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

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top