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,418
Reaction score
2,513
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 Profile Posts

Create MiniMaps, Sprites for MV Enemies, & Aethereal Plane Battlebacks | RPG Maker News #74

Vtubers Vs MOTHER.png

This might be my next project. You like it?
I'm off to search the master script list for my skill issue. HOORAY! FUN!
Fun fact: Digimon is an isekai :kaoswt2:
The problem with being a perfectionist is that you are never done with something.

Forum statistics

Threads
112,326
Messages
1,067,402
Members
145,963
Latest member
Nekonix
Top