Status
Not open for further replies.

AeroFunk80

Veteran
Veteran
Joined
Aug 25, 2016
Messages
268
Reaction score
148
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
765
Reaction score
1,157
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,811
Reaction score
2,870
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

Mimics! Mimics everywhere!
Pirate portrait quickie :LZYcheeze:
pirate.png
My game has a (much needed) tutorial now...
Game Making Every Day #20:kaohi:

ScreenShot_8_14_2022_11_55_51.png
FINALLY added the comic bubble to the Title Screen...

Forum statistics

Threads
124,508
Messages
1,164,120
Members
163,334
Latest member
Spiketrap
Top