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,812
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

yo i made a post but it hasnt really gotten any answers so uhhhh
Finished switching to a new PC. Now I could potentially start working at projects or plugins again if I feel the motivation to do so.
If you don't read the news, you are uninformed. If you read the news, you are misinformed.
Custom slip rates and custom ailment durations for enemies really opens up the floodgates for status effect use. I can have Poison and Time Stop affect bosses without it breaking their balance! Finally, a healthy middle ground.

(Especially after I cooked up a thing that prevents you from re-applying deadly states more than once in specific occassions.)
Voice.gif
The Voice... They usually show up to talk to you about leaving your mark on the world, which is one of the major themes of my game... How will you be remembered by society.

Forum statistics

Threads
124,533
Messages
1,164,269
Members
163,366
Latest member
kurutami
Top