Random state at max tp

Joined
Dec 15, 2014
Messages
86
Reaction score
44
First Language
English
Primarily Uses
RMMV
I cannot figure out how to change these notetags into something that will
  • Give a random state out of a group of states to the actor when they reach max tp
  • Reduce said actors tp to zero
  • Remove the previous state and add a new one when they reach max tp again
here is the thread with the notetag in question - [SOLVED] Give a Random State
--------------------------------------------------------------------------------------------
edit: So I managed it somewhat, but it doesn't always add replace the state, sometimes it just removes it and leaves them with no state at all.

Code:
<Custom Turn Start Effect>
if (user.tp>=100) {
user.removeState(32);
user.removeState(33);
user.removeState(34);
user.removeState(35);
user.startAnimation(123);
var rr = Math.floor(Math.random() * 4);
if(rr==1){
user.addState(32);
}else if(rr==2){
user.addState(33);
}else if(rr==3){
user.addState(34);
}else{
user.addState(35);
}
user.gainTp(-100);
}
</Custom Turn Start Effect>

also I can't figure out how to add a wait time for the animation to finish
 
Last edited:
Joined
Dec 15, 2014
Messages
86
Reaction score
44
First Language
English
Primarily Uses
RMMV
This one made it work
Code:
<Custom Turn Start Effect>
if (user.tp>=100) {
user.startAnimation(124);
var rr = Math.floor(Math.random() * 4) + 1;
switch(rr){
case 1:
user.addState(32);user.removeState(33);user.removeState(34);user.removeState(35);
break;
case 2:
user.addState(33);user.removeState(32);user.removeState(34);user.removeState(35);
break;
case 3:
user.addState(34);user.removeState(33);user.removeState(32);user.removeState(35);
break;
case 4:
user.addState(35);user.removeState(33);user.removeState(34);user.removeState(32);
}
user.gainTp(-100);
}
</Custom Turn Start Effect>
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Currently without internet due to storm damage and most of our state is devastated. No idea how long I'll be unable to log onto here, but I'll answer questions as soon as I can.
This is supposed to be pso2 photon blast inspired animation
I'm sure this question's been asked before, but I can't find an answer: is there any way to run the Steam version of RPGMaker *without* being logged into Steam? It's a frustrating extra step sometimes.
Been seeing bright flashes in the sky for a while, and thought it was my eyes playing tricks on me. Nope! Lightning. Now it's raining heavily. Seeing lightning, but not hearing thunder, is weird.
Small Update for myself:
>Two Dungeon maps are done, Dungeon 3 is in progress. Dungeon 4 needs work.
>4 characters set up out of a possible 6 but those come later.
>Hub area needs work.
>Game completion..., 20-25% maybe?

Forum statistics

Threads
100,714
Messages
978,680
Members
132,331
Latest member
NKG__
Top