Jump to content
lavalord96

"Wave Attack" Help

Recommended Posts

Alright, I have an issue, I have a boss in my game that does not use the conventional RPG fight style in the game; It uses events as attacks. I am trying to make an attack that will travel in a straight line, and if it hits the player, it will do damage and disappear when it touches the player, But here's the catch; if it DOESN'T hit the player, it NEEDS to disappear after a while, then reappear in it's original starting location, it also needs to be able to be used multiple times. I've been scratching my head, trying to figure out how to make it work within ONE event, because if I try to do multiple parallel process EVENTS, it could seriously lag the game. So recap: I need to make an attack that moves a certain distance before disappearing, it needs to disappear upon TOUCHING the player, it needs to be all stored within ONE event, and finally, it needs to teleport back to it's starting position AFTER it either hits the player or has gone for a certain distance or time. Please help, I would really appreciate it. If you need pictures of what I've tried to do, then just ask, I'll be more than happy to get them for you.

Share this post


Link to post
Share on other sites

Alright, I played around a bit with a test project, and I think I found a way to do what you want, using 2 events, 1 switch, and 0-2 variables (depending on how many directions the wave can go, and how comfortable you are with using script calls). 

 

To use this, have any other event turn ON the switch used by these two events. It will then move forward until it either a) hits the player, or b) goes out of bounds. To re-use it afterwards, just turn the switch ON again. 

 

1. Make your "Wave" event (Trigger: Event Touch) (Condition: SWITCH is ON) (Priority: Same as Player)

> When this event touches the player, have it do whatever you want it to do, THEN:

> Use the movement route command to set its graphics to none. 

> Set Event Location on itself, teleport it to somewhere the player can't get to. (Else it might hit your player immediately upon being re-activated)

> Turn OFF the switch. 

 

 

ayc53wjs.png

 

2. Make a "Manager" event (Trigger: Parallel Process) (Condition: SWITCH is ON)

> Set event location for your "Wave" event, and teleport it back to its starting position. 

> Set Move Route for "Wave" (Skip, Wait)

>> Change its graphic back so it's visible again

>> (optional) have it turn towards the player

> Set Move Route for "Wave" (Repeat, Skip)

>> 1 Step Forward

> Loop: 

>> Wait 60* Frames

>> Next, you need to check if the event is far enough away to be disabled. To do this, you can use variables (Set => Game Data => Character WAVE's Map X/Y).

Note: When viewing events on the map, you can click anywhere and it'll display the exact coordinates of that tile in the bottom right corner of the window, which you can use to figure out when it should disable the wave. For example, let's say we're using a default 17 x 13 tiles map and want to disable the wave when it reaches the very edge: 

>> Conditional Branch: If (the X variable) is >= 16

>>> Jump to Label: End

>> Conditional Branch: If (the X variable) is <= 0

>>> Jump to Label: End

>> If (Y variable) is >= 12

>>> Jump to Label: End

>> If (Y variable) is <= 0

>>> Jump to Label: End

>> Repeat Above

> Label: End

> Movement Route for "Wave" to change its event Graphic to None

> Set Event Location for "Wave" to be somewhere the player can't go

> Turn OFF the switch

 

* you can wait longer than this. Higher numbers are better for performance, shorter times means it responds faster. In my quick testing, 60 frames (1 second) seemed pretty decent. 

3l5iirrn.png

 

Also, if you don't want to use game variables for this, you can use script calls instead. For example: 

id = 8   # <= Change this number to the Event ID of your "Wave" event
s = 5    # <= Change this to the ID of the SWITCH you're using
disable_wave = FALSE
disable_wave = TRUE if $game_map.events[id].x >= 16
disable_wave = TRUE if $game_map.events[id].x <= 0
disable_wave = TRUE if $game_map.events[id].y >= 12
disable_wave = TRUE if $game_map.events[id].y <= 0

if disable_wave == TRUE
  $game_map.events[id].set_graphic('', 0)
  $game_map.events[id].moveto(0, 0)
  $game_switches[s] = FALSE
end

You'd want to edit the numbers used here to match your own event id/switch id/map size (i.e., you'd want to change 16 / 0 / 12 / 0 to the coordinates that should disable the wave). 

 

I hope that explanation made some semblance of sense, and that I didn't misunderstand what you are trying to do 

 

Edit: Sorry, didn't see how old this thread was. Not sure if it's still relevant 😅

 

Edit #2: On second thought, I think there's a better way to handle the script idea:

id = 8   # <= Change this number to the Event ID of your "Wave" event
s = 5    # <= Change this to the ID of the SWITCH you're using

# Event Boundaries - Disables the Wave:
min_x = 0 # <= if the event is ON or LEFT OF here (X Axis)
max_x = 16 # <= if the event is ON or RIGHT OF here (X Axis)
min_y = 0 # <= if the event is ON or ABOVE OF here (Y Axis)
max_y = 12 # <= if the event is ON or BELOW OF here (Y Axis)

disable_wave = FALSE
while disable_wave == FALSE # start of loop

  wait(60)

  disable_wave = TRUE if $game_map.events[id].x >= max_x
  disable_wave = TRUE if $game_map.events[id].x <= min_x
  disable_wave = TRUE if $game_map.events[id].y >= max_y
  disable_wave = TRUE if $game_map.events[id].y <= min_y

end # end of loop

$game_map.events[id].set_graphic('', 0)
$game_map.events[id].moveto(0, 0)
$game_switches[s] = FALSE

This one replaces the loop and wait commands above, and anything that comes after it. It still waits for 60 frames before checking again if the switch should be disabled. Using a nearly empty default-size map, with a Normal/2x Slower speed wave event, the script ran 3-4 loops before the Wave event went out of bounds and the switch was turned off.

 

jj2gerrf.png

Edited by YTD

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted