Creating a very simple gun turret

Status
Not open for further replies.

Cuddlebuns

Veteran
Veteran
Joined
May 5, 2019
Messages
45
Reaction score
4
First Language
English
Primarily Uses
RMVXA
I am attempting to create a very simple gun turret enemy on the map through events only. It would work by checking if the player's x matches its own, then playing an animation and waiting before checking again. If the player's x matches the turret's x on the second check, it plays a second animation and damages the player repeatedly until the player moves to an unmatching x coordinate.

Unfortunately, testing has shown that the turret plays the first animation but fails to proceed to the second coordinate check even if the player is standing still, looping the first animation repeatedly instead.

The event is in the spoiler below. It is likely that I am overlooking something exceptionally obvious to this forum, and so I ask for your assistance.

RPGMV_ziE5Gab3pM.png
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,501
Reaction score
727
First Language
indonesian
I am attempting to create a very simple gun turret enemy on the map through events only. It would work by checking if the player's x matches its own, then playing an animation and waiting before checking again. If the player's x matches the turret's x on the second check, it plays a second animation and damages the player repeatedly until the player moves to an unmatching x coordinate.

Unfortunately, testing has shown that the turret plays the first animation but fails to proceed to the second coordinate check even if the player is standing still, looping the first animation repeatedly instead.

The event is in the spoiler below. It is likely that I am overlooking something exceptionally obvious to this forum, and so I ask for your assistance.

Hmmm maybe try adding another WAIT at the END of the parallel process event...

also you said the second animation did not execute... does the hp damage still happen though? just to make sure you enter the second if condition...

hope this help...
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,499
Reaction score
2,615
First Language
English
Primarily Uses
RMMZ
One problem here is that you're checking the X coordinates again after that 16-frame wait, but you're *not setting the variables to that data again* so it's just taking the values it had the first time round anyway and this condition is always going to end up being true.
 

Cuddlebuns

Veteran
Veteran
Joined
May 5, 2019
Messages
45
Reaction score
4
First Language
English
Primarily Uses
RMVXA
One problem here is that you're checking the X coordinates again after that 16-frame wait, but you're *not setting the variables to that data again* so it's just taking the values it had the first time round anyway and this condition is always going to end up being true.
Hidden in plain sight just as suspected. Thanks, this worked perfectly.

This is officially solved.
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Hope he recovers fast :|
Looks like it's functional:
It's a common thing to forget eating &drinking while you are working concentrated, right?
If I had discovered RPG-Maker before moving together with my girlfriend, I'd have died of dehydration a long time ago.
Ami
trying to change my picture & got screwed up...
I've been busy working on my next music pack, and I've also been busy composing some personal compositions. Depending on the type of mood and setting, sometimes I just really love the sound of music created in lofi mono. It has its charm.

Forum statistics

Threads
112,491
Messages
1,068,669
Members
146,162
Latest member
Pre_tw
Top