Status
Not open for further replies.

AeroFunk80

Veteran
Veteran
Joined
Aug 25, 2016
Messages
263
Reaction score
143
First Language
English
Primarily Uses
RMMV
I'm using Yanfly's Event Chase Player plugin. Works great. Wanted to see if anyone knew a specific script I could use but wasn't sure of the coding.

In the plugin parameters, you can choose whether the event has to see the player or not to chase them. There's also scripting you can add within the movement route to turn this on/off per event:

this._seePlayer = true Requires the event to be able to see player.
this._seePlayer = false Doesn't require event to be able to see player.

What I'd like to do in my game is have this turn on/off based on whether a switch is on/off. Players have a flashlight. When it's on... I have a switch active. I then turn that switch off when players turn off their flashlight.

Is there a way for me to write a script that has the "seePlayer" check to see if a switch is on first? If on... seePlayer = false. If off... seePlayer = true
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
754
Reaction score
1,137
First Language
German
Primarily Uses
RMMV
this._seePlayer = $gameSwitches.value(x);

where x is the ID of the switch you want to use.

If the the switch is on, it will be true, else it will be false.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,684
Reaction score
2,763
First Language
EN
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Spent all day writing code, only for it to result in an endless loop...sigh.:kaosigh:
So um what is the deal with rpgmakerofficial.com ,why are there two rpg maker websites now? Is it any different from the current one rpgmakerweb.com??
ScreenShot_7_1_2022_11_41_55.png
When the Panic gauge is full, Mike will turn into Omar in a state of actual panic. his move list changes and until the meter depletes completely, he'll be able make use of this alter ego.
So unbelievably excited for IGMC this year! First public game was for the original one and I'm just so pumped!!
Sometimes I am amazed at how relentless spam bots are. I would clear the que and then see 800~5k more depending on their mood.

Forum statistics

Threads
123,263
Messages
1,155,320
Members
161,645
Latest member
MercyTales
Top