RMMV Script Into Lunatic mode

Lu_

Veteran
Veteran
Joined
Sep 26, 2019
Messages
40
Reaction score
14
First Language
German
Primarily Uses
RMMV
i used this codes as custom passive conditions for the yep auto passive states
Code:
<Custom Passive Condition>
if ($gameActors.actor(1).isStateAffected(1) && !$gameActors.actor(1).isStateAffected(16) && $gameSwitches.value(10) == true) {
  condition = true;
} else {
  condition = false;
}
</Custom Passive Condition>
Code:
<Custom Passive Condition>
if ($gameActors.actor(2).isStateAffected(1) && $gameSwitches.value(10) == true) {
  condition = true;
} else {
  condition = false;
}
</Custom Passive Condition>
but because i am using the $ prefix i get a lot of errors. is there a way to do the same with lunatic mode?
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
481
Reaction score
204
First Language
German
Primarily Uses
RMMV
Sry but i dont understand why using " $ " does any problem.. perhaps u need to use more "()" ?
examples:

1st Example
JavaScript:
<Custom Passive Condition>
if ( ($gameActors.actor(1).isStateAffected(1)) && (!$gameActors.actor(1).isStateAffected(16)) && ($gameSwitches.value(10) == true)) ) {
  condition = true;
} else {
  condition = false;
}
</Custom Passive Condition>

2nd example
JavaScript:
<Custom Passive Condition>
if ( ($gameActors.actor(2).isStateAffected(1)) && ($gameSwitches.value(10) == true) ) {
  condition = true;
} else {
  condition = false;
}
</Custom Passive Condition>
using more "()" helps to make sure that stuff like "!" only affects the code inside of the "()"..
(just incase that this made any problem.. like i said i am not sure what makes your errors)

Edit
i added both examples and left some room for start and end of the main "( )" to be better visible..
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,240
Reaction score
7,618
First Language
German
Primarily Uses
RMMV
i get a lot of errors.
it would hep to see a screenshot of the error messages, because not every error message has the same cause...
 

Lu_

Veteran
Veteran
Joined
Sep 26, 2019
Messages
40
Reaction score
14
First Language
German
Primarily Uses
RMMV
every state i am using stuff like this
Code:
$gameActors.actor(2).isStateAffected(1)
i get errors
 

Lu_

Veteran
Veteran
Joined
Sep 26, 2019
Messages
40
Reaction score
14
First Language
German
Primarily Uses
RMMV
it would hep to see a screenshot of the error messages, because not every error message has the same cause...
1.PNG
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,240
Reaction score
7,618
First Language
German
Primarily Uses
RMMV
"maximum stack size exceeded" has nothing to do with your code itself.
The most common cause is a plugin installed twice, the second most common is several plugins in the wrong order, then comes the possibility of two incompatible plugins and only on last probability in something like this is a truly recursive code.

please post a screenshot of your plugin manager with all plugins and their order listed, then we can check better.
 

Lu_

Veteran
Veteran
Joined
Sep 26, 2019
Messages
40
Reaction score
14
First Language
German
Primarily Uses
RMMV
"maximum stack size exceeded" has nothing to do with your code itself.
The most common cause is a plugin installed twice, the second most common is several plugins in the wrong order, then comes the possibility of two incompatible plugins and only on last probability in something like this is a truly recursive code.

please post a screenshot of your plugin manager with all plugins and their order listed, then we can check better.
2.PNG
 

Attachments

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
126
Reaction score
68
First Language
French
Primarily Uses
RMMV
"maximum stack size exceeded" has nothing to do with your code itself.
The most common cause is a plugin installed twice, the second most common is several plugins in the wrong order, then comes the possibility of two incompatible plugins and only on last probability in something like this is a truly recursive code.

please post a screenshot of your plugin manager with all plugins and their order listed, then we can check better.
Plugin order list (for Yanfly's plugins) for reference: http://www.yanfly.moe/wiki/Category:Yanfly_Engine_Plugins#Plugin_List
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Profile Posts

currently listening to Driftwood Gaming streaming some MZ dev time and it's delightful! had no idea they were this entertaining, love it
In quarantine, will be tested soon. This year is really something... special.
I was at another orientation yesterday and I realized I'll be working with an old friend! We met at the local water park a few years back and it was so nice to see her again! We had a chat, and next week when I officially start, I'll see if maybe we can trade our Zoom IDs so we can talk!
I made some sideview closets for MV!
You can find them in my MV resource thread.

Forum statistics

Threads
105,509
Messages
1,014,319
Members
137,194
Latest member
purboy
Top