dappadude

Warper
Member
Joined
Jul 30, 2020
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RMMV
I was wondering if there was a way to play a common event once the player leaves the event's sight? What I want to do is when the event sees the player, I want it to play music and turn a switch on. I can do that already, but when the event can no longer see the player, I want to turn the music off along with the switch. Thanks!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,169
Reaction score
1,158
First Language
English
Primarily Uses
RMMV
Open the plugin with a text editor. On line 106, hit Enter to make a new line and paste in:
Code:
 *  this._lostCommonEvent = x This event will play when player is lost.

Then go to line 189, make new line, and paste:
Code:
  this._lostCommonEvent = 0;

Go to line 394, make a new line, and paste:
Code:
    if (this._lostCommonEvent)
        $gameTemp.reserveCommonEvent(this._lostCommonEvent);
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,672
Reaction score
15,291
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Thank you.

 

dappadude

Warper
Member
Joined
Jul 30, 2020
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RMMV
Open the plugin with a text editor. On line 106, hit Enter to make a new line and paste in:
Code:
 *  this._lostCommonEvent = x This event will play when player is lost.

Then go to line 189, make new line, and paste:
Code:
  this._lostCommonEvent = 0;

Go to line 394, make a new line, and paste:
Code:
    if (this._lostCommonEvent)
        $gameTemp.reserveCommonEvent(this._lostCommonEvent);
Thank you! I ended up having to put the last line of code 2 lines down, after the "if (!this._returnAfter) return;" thing. I know hardly anything about coding languages, so for some reason putting the code two lines down just kinda worked?? Thanks again, I can finally have my cringe chase sequence work right!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,169
Reaction score
1,158
First Language
English
Primarily Uses
RMMV
Thank you! I ended up having to put the last line of code 2 lines down, after the "if (!this._returnAfter) return;" thing.
What do you mean you "had to"? Changing that means that your common event will only run if you have told the event to return to its original position. Where I put it, the event should run when the event loses sight of you, regardless of whether it's set to return or not.
 

dappadude

Warper
Member
Joined
Jul 30, 2020
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RMMV
What do you mean you "had to"? Changing that means that your common event will only run if you have told the event to return to its original position. Where I put it, the event should run when the event loses sight of you, regardless of whether it's set to return or not.
For whatever reason, nothing happens when it's in the original spot.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,169
Reaction score
1,158
First Language
English
Primarily Uses
RMMV
Huh. Well, if it works for you, I won't bother trying to troubleshoot it :wink:
 

Latest Threads

Latest Posts

Latest Profile Posts

That moment when you came up with a very good game title, but when you searched it, it has already been used... T.T
Crazy week. My anxiety decides to go nutz. Worse thing about it is that it causes me to lose focus on my work. I was able to leave early one day and take a nap. Seemed to help. How is everyone? Boosters coming soon here. Get my life back on track again.
Finally got my new Discord Server up & Running! I'm still improving it as much as I can, & I'm open for any Suggestions!
I've been busy trying out different art styles for my game.

Enemies deserve some spotlight also

Forum statistics

Threads
115,873
Messages
1,093,650
Members
151,117
Latest member
Wolfy0913
Top