RPG Maker MV

RPG Maker MV

An Ning Feb 22, 2018 @ 6:51am
"If" statements
Googling this one got me nowhere.
Is there a list of possible "if" statements you can make in this -or perhaps better-phrased: a list of terms you can use in them?

I really have no idea what I am and am not able to enter into them
Last edited by An Ning; Feb 22, 2018 @ 6:52am
< >
Showing 1-15 of 33 comments
Hajami Feb 22, 2018 @ 7:37am 
The corresponding Eventcommand in the Editor would be: "Conditional Branch"
which comes with a big variety of pre defined Branch Options.
Additionaly Users use the Eventcommand "Control Variables" thatway they can assign a Variable to the amount of Potions in there Inventory, and than using that Variable in the Conditional Branch to see if for example the Hero has 5 Potions for the Villagers Quest.
For Advanced if statements for which no pre made access is inbuild, like for some Plugins, there users can use the Script Line Feature within the Eventcommand "Control Variables" or in "Conditional Branch". (edit: or in the eventcommand script on page 3)
There is no list i can think of since nearly any Data can be put into an If Statement (Conditional Branch).

Your Question apears a little vague, so if your Question isnt answered, than please explain in more detail what you mean and what you try to do.

Edit:
One guess :) ... in case you mean the Scriptline Feature, here is a big List:
https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mv-script-call-list.46456/

In case you wanted the If branches in the Combat System, than here is another List for the Damage Formula Options:
https://www.rpgmakercentral.com/topic/36290-damage-formulas-101-mv-edition/

Last edited by Hajami; Feb 22, 2018 @ 8:30am
Caethyril Feb 22, 2018 @ 7:47am 
^ This. Script calls, skill formulae, and any "Script" options for event commands are all evaluated as pure JavaScript, so technically you can do an awful lot if you know how. If you have any specific ideas you're unsure of how to implement, feel free to ask! =)
An Ning Feb 22, 2018 @ 3:23pm 
The current thing I am trying to make is a healer NPC in a certain town.
But, I want them to refuse with "you're not in need of healing" if you are at full hp, and "character HP" is not an option in the conditional branch menu, so I figured it would have to be something I write in myself somehow
Last edited by An Ning; Feb 22, 2018 @ 3:24pm
Dinurs Feb 22, 2018 @ 3:56pm 
Originally posted by An Ning:
The current thing I am trying to make is a healer NPC in a certain town.
But, I want them to refuse with "you're not in need of healing" if you are at full hp, and "character HP" is not an option in the conditional branch menu, so I figured it would have to be something I write in myself somehow
You can do that by setting two variables, one to be equal to the current hp and another to be equal to max hp and then check those two against each other.
An Ning Feb 22, 2018 @ 3:56pm 
I'm sorry, but that one confused me.
Dinurs Feb 22, 2018 @ 4:03pm 
Something like this: https://imgur.com/a/KDmvc
An Ning Feb 22, 2018 @ 4:22pm 
I see. Thanks
An Ning Feb 23, 2018 @ 4:49am 
Back again with another query:
Is it possible to set an "If" command to have multiple triggers?
ex: Get healed ("remove status") if you OR party member A OR party member B (as there is no "person in your party") have knockout or sleep or confusion or poison, etc (as there is no "if status ailment" tag), remove status?

Or would I have to have multiple "If" chains for this -or does multiple "ifs" not work?


...still tryign to get that town healer thing to work
Last edited by An Ning; Feb 23, 2018 @ 4:58am
Hajami Feb 23, 2018 @ 5:06am 
You can make If statements for ailment.
Conditional Branch Page2 --- Choose an Actor --- than choose if he is Poisoned, Knocked out or whatever state exist can be branched there in an if statement.

Yes you can make more than one condition:

if var[1] equals 5
if var[2] equals 5
Textbox: If you see me both Variables are 5
end
end

or

if var[1] equals 5
if var[2] equals 5
Textbox: If you see me both Variables are 5
else
nothing
end
else
nothing
end
An Ning Feb 23, 2018 @ 5:14am 
I saw there were individual status ailments.
I meant there was no tab for "status ailment: any", meanign if I want an NPC to heal, I (presumably, still not sure) have to do somethign like

If:
`Member A
``knockout
--if gold >10
`remove status knockout
-else
-end

`else
if Member A
-poison
--if gold >10
-remove status poison
-else
-end

else
if Member A
-confusion
--if gold >10
-remove status poison
-else
-end

(continue/remake for all 4 members)

else
End
Last edited by An Ning; Feb 23, 2018 @ 5:17am
Hajami Feb 23, 2018 @ 5:19am 
Event Commands Page 1 --- Under the Category Actor ---Eventcommand: Recover All
You got 3 Options there: Entire Party, Specified Actor, or Actor Specified by a Variable.
This allows a NPC to fully Heal you. It should also revive Knocked Out Party Members.

Keep in mind there are always several Ways to do something, so maybe tell us what you are trying to do in detail and not how you want it to do, atleast in this case.
Last edited by Hajami; Feb 23, 2018 @ 5:22am
An Ning Feb 23, 2018 @ 5:23am 
Yes, I saw that option earlier... the problem is I don't want to recover all (I know, I'm being picky, but it's for a reason).
The healer NPC here is just to heal status ailments -otherwise the inns are pointless -the inns also remove status ailments, but they are -in the current design- more expensive (as they also restore hp and mp)..
Last edited by An Ning; Feb 23, 2018 @ 5:27am
Caethyril Feb 23, 2018 @ 5:34am 
Conditional Branch > Script:
$gameParty.members()[0]._states.length === 0
This will return true if party member 0, the leader, has no states. Change the number in the brackets to check a different member (e.g. 1 for the second party member). =)

Then to remove all states, either remove them individually using commands (you don't have to check whether they're already present) or you can put this in a Script command to remove all states:
$gameParty.members()[0].clearStates();
Again, just change the number in the brackets to affect a different member.

If you want to target particular actors rather than party members, use these variants instead:
$gameActors.actor(1)._states.length === 0
$gameActors.actor(1).clearStates();
Note that here, 1 refers to the first actor in the database; there is no actor #0.
An Ning Feb 23, 2018 @ 5:38am 
...script is probably what I will be tryign to learn once I get the "simple" stuff here...
Hajami Feb 23, 2018 @ 5:41am 
You can use this Script Snippets/Lines directly in the Conditional Branch Eventcommand.
So no need to learn real Scripting yet.
< >
Showing 1-15 of 33 comments
Per page: 1530 50

Date Posted: Feb 22, 2018 @ 6:51am
Posts: 33