Avoid the searchlight puzzle

Bowtirage

Veteran
Veteran
Joined
May 12, 2016
Messages
31
Reaction score
6
First Language
English
Primarily Uses
I thought it would be easy.
I'm trying to have a puzzle where there are giant searchlights that appear and disappear on the ground every few seconds and you need to cross the map while they are off before they turn back on with you in it's radius and either trigger into a battle or send you back to the start of the map.
I thought having a $sized event would be big enough to cover a 3 by 3 size of tile space and account for the light's radius, but it only accounts for the 1 square the event is placed.
In addition, I'm having trouble getting the player touch on the event to work if I'm already in the spotlight area. .
Does anyone have a solution to this at first glance, simple puzzle?
An example would be the beginning level of Deltarune where you're walking across the chessboard, avoiding the changing floor lights.

-Thank you.
 

LordOfPotatos

Veteran
Veteran
Joined
Oct 9, 2015
Messages
151
Reaction score
127
First Language
english
Primarily Uses
there are a couple of ways...
-you can sorround the searchlight with invisible events that move with it and trigger the thing.
-you can use player and event map coordinates to calculate the distance between player and searchlight via parallel process and trigger the thing.
-you can look for a plugin that resizes event hitboxes. I know Yanfly has one but I'm not sure if it's free. the plugin releases forum might have one too, IDK.
 

RianQuenlin

Veteran
Veteran
Joined
Jul 28, 2022
Messages
100
Reaction score
68
First Language
English
Primarily Uses
N/A
.
 
Last edited:

KoldBlood

Innovation from Limitation
Veteran
Joined
Feb 5, 2014
Messages
96
Reaction score
90
First Language
English
Primarily Uses
RMVXA
I'm not sure which version of RPG Maker you're using (I'm using VX Ace) so my idea might not work in your version but if the searchlights are static (not moving) and just turning off and on at different intervals then you should be able to use Region IDs to handle this. Full Disclosure: I've never tried to do anything like this in my own game so I could be way off base here.

What I'd do is paint a Region ID around the area of effect for the searchlight then have a parallel process event running on a Switch that turns ON when the searchlight is on and OFF when the searchlight is off. While the searchlight is on, the parallel process event repeatedly checks the player's current Region ID and compares it to the searchlight's Region ID and activates whatever commands if it ever matches while the searchlight is on.

Tip: To get the player's Region ID you'll need 3 variables. 1 each for the player's Map X, Map Y, and Region ID. You have to use the "Control Variables" command to save the player's Map X and Map Y data into the Player X & Y variables respectively. Then you use the "Get Location Info" command to get the player's current Region ID using the Player X & Y variables as the location. Why they made getting a player's current Region ID so convoluted and split it between two different commands is beyond me but that's how you have to go about it if you're using only event commands.

You'll likely need more switches, conditional branches, etc. to handle additional searchlights but that's a matter of play testing different setups until you find something that works. Hopefully this at least helps you get started on it or helps to inspire your own solution.

Good luck with your game!
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,762
Reaction score
609
First Language
German
Primarily Uses
RMMV
One Parallel Event could Set the Moveroutes and Waits for the Spotlights, thatway they start Moving even if they are far outside of the visible Screen where they normaly dont start to move.
A 2nd Parallel Event would handle the Calculations and Conditions for the Hit detection of all spotlights.
Than you do not need touch events.
 

Latest Threads

Latest Posts

Latest Profile Posts

DamageEvil_2.png added!
index.php

Important update for Leafko!

Forum statistics

Threads
125,671
Messages
1,172,700
Members
164,801
Latest member
PurpleClouds
Top