Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Notetag Conditional Evaluations

GobbleGobble

Villager
Xy$
0.00
Hello.

What I'm looking to do is conditional evaluations in notetags that cannot be solved through the conditions feature of RMV...

In battle...
If [actor 1] targets [enemy 1] then...

Examples:
- Either triggers a common event
- Or toggles a switch on/off or increases a variable...
- Or triggers dialogue, effect, or some kind of buff on Actor 1 (or whomever else I want to target)...

...I have this one example to go by from Yanfly's page about evalulations with Battle A.I....

Example: Eval user.name() === ‘Bat A’: Skill 10, Highest HP%

However, things like user.name() and other such inputs are foreign to me. Is there an index for things like this?

Can someone provide an example of conditional if, then, else inside of notetags written as a single-line script?

And is there an index I can refer to?
 

GobbleGobble

Villager
Xy$
0.00
I tried this code in an enemy note tag so that when you target this enemy a message appears... but it doesn't work...

First I tried this... which did not work...
<Custom Select Condition>
if (target.name() === ‘Bat’) {
condition = true;
$gameMessage.add(“Bat = True”);
}
</Custom Select Condition>

Then I tried this... which did not work either...

<Custom Select Condition>
if (target.name() === ‘Bat’) {
condition = true;
$gameMessage.setFaceImage('Actor1',0)
$gameMessage.setBackground(1)
$gameMessage.setPositionType(1)
$gameMessage.add(“Bat = True”);
}
</Custom Select Condition>


This is Yanfly's code for Selection Control...
<Custom Select Condition>
if (target.name() === ‘Harold’) {
condition = true;
} else {
condition = false;
}
</Custom Select Condition>


What am I missing here?
 
Top