Conditional Branch to test if actor X has buff Y on?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
797
First Language
French
What it says.
But since buffs can also be doubled (or even tripled etc with Yanfly's stuff), is it also possible to test for double buffs? Just wondering.
 

deykuzor

Korean Guy Screaming in Italian American
Member
Joined
Sep 7, 2017
Messages
23
Reaction score
5
First Language
English
Primarily Uses
RMMV
if(condition){
doThis;
}

condition is an eval of a variable or a returned function call. If true, the if statement executes code within the brackets. If false, it's skipped

doThis can be a command or a function.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,900
Reaction score
797
First Language
French
Yes but what's the syntax to test a buff (or double buff) on a given actor?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,654
Reaction score
1,106
First Language
EN
Primarily Uses
RMMV
The buff level of a basic param is 0 for no (de)buff, -1 for 1 debuff, +2 for 2 buffs, etc. :kaophew:

This will return the current MHP buff level (MHP is param ID 0) of actor ID 1:
JavaScript:
$gameActors.actor(1).buff(0)
This will return the current ATK buff level (ATK is param ID 2) of the party leader (party index 0):
JavaScript:
$gameParty.members()[0].buff(2)
So you could use one of these references (adjust the numbers as needed) and test it against a suitable number. E.g. Conditional Branch > Script:
JavaScript:
$gameParty.members()[0].buff(6) > 0
I.e. "does the party leader have an AGI buff active?". :kaopride:

Basic param ID <-> param name reference:
0 MHP
1 MMP
2 ATK
3 DEF
4 MAT
5 MDF
6 AGI
7 LUK
[Edit: whoops, I had MAT and MDF swapped in the spoiler. Fixed!]
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

When you are trying to make progress in your game. But something is stopping your motivation. Like come on mind! Let me do what I want! :<
Tfw everyone is trying their hardest to brainstorm about unique ideas and game mechanics, here I am just going: "How am I gonna event conversations with busts" everyday. :kaoswt2:
Comedy is third person, tragedy is first person.
Man. A historic 130 year old church nearby had all of its windows broken out with bricks last night. Such a shame, it wasn't generic stained glass patterns either but had beautifully crafted murals depicting various parts of the gospels.
The Steam Summer Sale's been treating me nicely. Now if only game sales were always this good...

Forum statistics

Threads
99,310
Messages
964,083
Members
130,919
Latest member
megazeroxzvk
Top