Stacking Messages Common Event

jezebelthenun

Veteran
Veteran
Joined
Sep 24, 2014
Messages
99
Reaction score
113
First Language
English
Primarily Uses
RMMV
When making a common event for skill learning messages, I'm finding that my messages are stacking.  Rather than showing one single message for the specific character and skill used at that moment, the messages cycle through every learned skill so far in order.

Video

I've added screen shots to help identify the issue, too.  Note that I have tried this with and without the else statements, using each character and skill separately as well within the event, with the same results.  The pattern shown repeats for each skill and character.

Thanks for any help!

Common Event 1.png



Common Event 2.png
 
Last edited by a moderator:

LadyBaskerville

Hell-poodle
Veteran
Joined
Sep 12, 2016
Messages
645
Reaction score
524
First Language
German
Primarily Uses
RMMV
The conditional branches in the common event check if a certain actor has learned a skill and display a message if they have. The problem is that "actor has learned a skill" means that the actor has learned the skill at any point in the game, not necessarily directly before the common event. So when the actor learns the fire skill, the common event checks if the fire skill has been learned - it has, so it displays the message for the fire skill. If the actor learn the ice skill after that, the common event checks again if the fire skill has been learned - it has (no matter when - the actor knows the skill now and that is the only thing the engine checks), so it displays the message for the fire skill again before displaying the message for the ice skill.


To fix this, I would change your common event setup a bit: Make a common event for each skill instead of each actor and have the item add a state to the actor it is used on. This state doesn't (or rather, shouldn't) have any effects, it only serves to mark the actor the item is used on. Then have the conditional branches check for all of the actors if they are affected by that state. If they are, display the correct message and remove the state from the actor. This also has the advantage that you don't need to worry about calling multiple common events from a single item.


Hope that helps :)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
the problem here is that you're probably using the wrong condition.


"has learned skill" is an absolute condition - it will always be true after the actor has learned the skill.


So yes, the messages will repeat for every time the common event is called, no matter if the actor learned the skill now or learned it twenty years before.


Assuming you want that message as the result of using an item that has given the skill just now, you need to identify which actor has used the item, not which has learned the skill three days ago - and there is no conditional branch that can identify that directly.


you'll need to do several steps, not all of them in the common event.


1) make a state "target" that has no function and does not go away automatically


2) add that state as an effect of the skill that calls this common event


3) for each actor, make one single conditional branch without else "actor has state target".


4) inside that conditional branch, give any messages (and add any other effects) you want to give if that actor used the item


5) at the end of 4, but still inside the branch, remove the state from that actor only


finished
 
Last edited by a moderator:

jezebelthenun

Veteran
Veteran
Joined
Sep 24, 2014
Messages
99
Reaction score
113
First Language
English
Primarily Uses
RMMV
the problem here is that you're probably using the wrong condition.


"has learned skill" is an absolute condition - it will always be true after the actor has learned the skill.


So yes, the messages will repeat for every time the common event is called, no matter if the actor learned the skill now or learned it twenty years before.


Assuming you want that message as the result of using an item that has given the skill just now, you need to identify which actor has used the item, not which has learned the skill three days ago - and there is no conditional branch that can identify that directly.


you'll need to do several steps, not all of them in the common event.


1) make a state "target" that has no function and does not go away automatically


2) add that state as an effect of the skill that calls this common event


3) for each actor, make one single conditional branch without else "actor has state target".


4) inside that conditional branch, give any messages (and add any other effects) you want to give if that actor used the item


5) at the end of 4, but still inside the branch, remove the state from that actor only


finished
So, for 6 skills, would I make 6 target states?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
no, one is enough as long as each item giving any skill calls the common event directly. The common event removes the state, so there is no need to keep track of different states.


and you don't need to quote the entire post to answer, you can use the @username function, like @jezebelthenun and use the quote only for pointing to specific references when needed.
 

jezebelthenun

Veteran
Veteran
Joined
Sep 24, 2014
Messages
99
Reaction score
113
First Language
English
Primarily Uses
RMMV
@Andar Okay, sorry about the quotes.  Thanks for letting me know.

I guess my confusion about the state is how to show the correct skill in the message box.  If the same state is applied regardless of the skill, how do I show "Miku has learned Fire Song" or ". . . Water Song"?    I'm adding the state to the skill learn item, the song book, for each skill.  Is that correct?

I'm so sorry I'm bad at this.  I'm a visual learner, so it's hard for me to read and understand it.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
In the case above, I was talking about one common event per skill, and if an item gives a different skill it would use a different common event.


If you want the common event to check for different skills learned, then yes one state per skill would be a solution. In this variant, I suggest naming the states like "XYZ learned" for better readability instead of naming it "target".


There are a few other ways to handle this, but that would just complicate things here and now - just keep in mind that there are always a lot of roads to a target and don't be fixed on this solution but ask again if a different problem makes this too problematic.
 

jezebelthenun

Veteran
Veteran
Joined
Sep 24, 2014
Messages
99
Reaction score
113
First Language
English
Primarily Uses
RMMV
OH GLORY BE TO RPGMAKERWEB!

I was finally able to get it to work correctly without any bugs!

Thanks to everyone who helped me out!  I'm sure I'll be back with more extremely n00by questions shortly. :D

@Andar and @LadyBaskerville you are today's big damn heroes! 
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top