Event graphic changing randomly?

Hi guys
I'm trying to make a game where you're being a waiter, so I was trying to make it so that there are different customers,
and my brother helped me make it so there are three different icons, and it picks randomly :3
Then came the problem, whenever you talk to them and what they say isn't pre set (like the variable below, where it's random from 1 to 3)
instead of using the icon from the variable at the top of the coding, it uses the Event's Graphic, which I haven't set, so the person just vanishes for a few seconds :/
I know there must be some way to fix it, and it's probably really obvious, but I'm new to eventing, so I thought I better ask for help XD
Also, my brother said to put up the other event that's linked to it, 'cause it might help 🙂

Spoiler
Eventing one.JPGEventing five.JPGEventing six.JPGEventing two.JPGEventing three.JPGEventing four.JPG
Did you tried, and if not, can you afford making direction fix for the events? I don't really get it, but this should help, maybe?
I'm sorry if I didn't make much sense, I'm new to the actual Eventing part of the RPG Maker, so I probably didn't explain things very well :/


The reason I didn't put direction fix on the Event is because it's an NPC, and they turn when you talk to them without any problem when what they say is fixed, they only disappear when what they say is randomly chosen. (and they do have to turn, because you'd be talking to them, and It's not very nice talking at someone's ear XD)


I have to keep the random dialogue though, because it's for a mini game where you're being a waiter, so the NPCs will ask randomly for 1 2 or 3, so then when you play it again, they'll ask for something different, otherwise they'd always ask for the same thing, or there would be a pattern to what they ask for and the game would get boring very fast


because you know what they're gonna say . . .


Also, because it's set in a Café, I wanted it so that it would randomly pick which sprite this NPC would have whenever you enter that map, so that there would be different customers there when you come back later 🙂


And my brother helped me make it so it would randomly pick one of three sprites when you enter the map, and so they'd ask randomly for one of three things, but they don't fit


together, so when you talk to them and it uses the random dialogue, for that conversation it uses the Event Graphic instead of the Conditional Branch at it top of the Event, which is how it picked their sprite :/


So what I really want to know is how I could have it pick a random sprite when you enter the map, but then have random dialogue and it still keep the sprite it chose when you entered the map for that conversation 🙂


Again I'm very sorry if I didn't make sense in my first qeustion 🙂
I'd like to help you if I can, but I copied your two events exactly as you have them, but I cannot get any characters to appear. Is there another event which determines the variables? Because you have "Conditional Branch: Variable [0019: Customer one Visual] == 1" but I cannot see how you determine which variable is activated?
Thank you very much, I'm really not very good at the RPG Maker yet, so I'm happy for any help I can get 🙂


Yes, there is another Event on a different map that sets the Variable, which sets Customer one Visual (and all the other customer visuals) to a random number from 1 to 3


It dosen't need to be on a different map though, 'cause it just sets that Variable.


Thank you again 🙂
No problem, but could you post screen shots of that event please? Then maybe I can get it working on my game to test out what is happening.
Of course 🙂


I've got it set as an action button, so "customer one" should appear when you talk to the event. :3

Spoiler
Eventing 7.JPG
(Please excuse this post since I cant delete it!)
I've got it set as an action button, so "customer one" should appear when you talk to the event. :3



Cool, great, already got a small fix for the problem, but another very minor one has occurred. Can you post screenshots of pages 3, 4, and 5 of "Customer 1" that way I can see if I can fix up the whole thing for you.


Mods: sorry for the double post!
No problem 🙂


Pages 3 and 4 are almost the same as page 2, just for if they chose "blue" or "yellow" instead of "red"


Thank you for all the help :3

Spoiler
Eventing 8.JPGEventing 9.JPGEventing 10.JPGEventing 11.JPGEventing 12.JPG
Thank you for all the help :3

Hey, no problem. Couple questions: What is the variable "Spoke to customer" for, I don't see it used anywhere on your event except to add to it at the bottom of page 1.


I'm assuming at the end of page 1, when they tell you what colour their order is, you have to walk away and go fetch it, correct?
Hey, no problem. Couple questions: What is the variable "Spoke to customer" for, I don't see it used anywhere on your event except to add to it at the bottom of page 1.


I'm assuming at the end of page 1, when they tell you what colour their order is, you have to walk away and go fetch it, correct?

Sorry for the late reply 🙂


You're correct, you do have to go get their order, but I've got it set up so you have to talk to all the "customers" before you can access any of the items they're ordering, then collect all their orders at the same time ('cause I thought It would make the game more challenging) "Spoke to customer" is so it can tell you've talked to everyone 🙂


I thought I'd post screenshots of the NPC you get the "food" from, just so you can see how I've got it set up . . . hey, it might be helpful 🙂  

Spoiler
Eventing food NPC.JPGEventing food NPC 2.JPGEventing food NPC 3.JPG
Ooookay! So first, I will point out what the problem is and I will tell you of the "quick fix".


Your problem is that when you first make the event change graphics, you are applying it only to the first page. So next, when you talk to the event it automatically switches to the second page where you don't have a graphic for it. So the quick fix is to set up another set of switches inside your "Event 10" like this:

Spoiler
Condition Branch: Variable [0017: Customer one Visual] ==1


Set Move Route: [Customer 1] (Wait)


                          : $> Graphic: 'Actor 3', 4


Control Switches: [0006: Customer 1b] = ON



Then, on your customer's second page, you will want to have a conditional branch set up like this:

Spoiler
Condition Branch: Switch [0006: Customer 1b] == ON


Set Move Route: [Customer 1] (Wait)


                         : $> Graphic: 'Actor 3', 4



You will also have to copy that code for any other page your customer switches to. The problem with this "quick fix" is that the customer will flash briefly every time they switch a page because technically the page has no image and it takes that second to read the command and load the image.


Now, if you want a permanent fix, ignore everything from above. Make separate events for all of your customers and have them look like this:

Spoiler
8wCO8Yh.jpg



lyrOpdG.jpg



uFBnELH.jpg



xoL0J0s.jpg



RY7ow1m.jpg



z1fY73h.jpg



Wzeuv7W.jpg



tTOD7n6.jpg



BglIQDo.jpg



I should point out that I condensed some of your pages into only one page for the event. Also, I didn't bother putting in some of your variables so you will have to put those variables in for yourself. I was only worried about the content that would make the event work. Let me know if there are any issues or anything I missed!
I should point out that I condensed some of your pages into only one page for the event. Also, I didn't bother putting in some of your variables so you will have to put those variables in for yourself. I was only worried about the content that would make the event work. Let me know if there are any issues or anything I missed!

Thank you so much for all your help! 😀


I showed your permanent fix to my brother (who was as stumped with Event as I was) and we got it working ☺️


Or at least I think we did, they still stutter for a second right after they say what their order is, but it's not that noticable, I just thought I'd let you know incase we messed it up somewhere :/


Also, my bro wanted me to ask you, with page 3, there's one conditional branch for if you give them the right item, and two others, one for each wrong item, so he was wondering if it needed to have three separate conditional branches, or if you could place the two incorrect choice branches under the "else" section of the correct conditional branch?


And one more question, where do you have the switch that turns on "Customer 1a"? I've got it in the same event that changes their graphic, but I'm not sure if it should be somewhere else . . . Can't hurt to ask 🙂


Thank you again! ☺️
I showed your permanent fix to my brother (who was as stumped with Event as I was) and we got it working ☺️


Or at least I think we did, they still stutter for a second right after they say what their order is, but it's not that noticable,

First, are you sure you are doing the Permanent Fix and not the quick fix? There shouldn't be any stuttering since the customer is now a solid event.

Spoiler
uFBnELH.jpg



xoL0J0s.jpg

Second, did you mean these conditional branches between "When [Red]" and "When [Blue]"?


Finally, if you go with the permanent fix, you shouldn't need a switch for "Customer 1a".
First, are you sure you are doing the Permanent Fix and not the quick fix? There shouldn't be any stuttering since the customer is now a solid event.

Spoiler
uFBnELH.jpg



xoL0J0s.jpg

Second, did you mean these conditional branches between "When [Red]" and "When [Blue]"?


Finally, if you go with the permanent fix, you shouldn't need a switch for "Customer 1a".

Soild event? Now I know I must have done something wrong 🙁


Yes I did mean that conditional branch, I'm sure I'm doing the Permanent Fix. I think the problem is probably the way I'm getting the Customer sprites to appear (and change what they look like), which is like this:

Spoiler
Graphic Change.JPGGraphic Change 2.JPGGraphic Change 3.JPG

You used Customer 1a switch in your event to as a requirement to get to page 2, so I'm confusded now :S


the event above is also where the "Customer 1a" switch is used, so if you don't mind me asking you two more questions:


What did I do wrong? And how did you get Customer 1a's sprite to appear (and change appearance)?


Thank you so much for your patience as well as your help 🙂
OH, the switches! My bad, that's my fault! I forgot that is what I used them for. I made a mistake in an earlier post then!


So as part of the permanent fix, add those switches in your "EV010" like this (I didn't do the whole event, you should get the idea from this one shot)

Spoiler
8Jdc5oo.jpg

Notice how I took out the "Set Move Route" because you don't need to switch the graphics anymore.  Also, you can obviously designate your own Set Event Locations mine were just for testing. The "Set Event Location" is where you want that customer to appear. Okay? So you can place the customer events anywhere you want on your map, but I suggest a place out of the way where the player won't be walking like the wall or ceiling or something, just in case. When your "EV010" activates, it will place your randomly picked customers at the location you specify.


As for the conditional branches, I will try to explain what I did because I'm not sure which ones you are talking about here.

Also, my bro wanted me to ask you, with page 3, there's one conditional branch for if you give them the right item, and two others, one for each wrong item, so he was wondering if it needed to have three separate conditional branches, or if you could place the two incorrect choice branches under the "else" section of the correct conditional branch?


Spoiler
@>Show Choices: Red, Blue, Yellow, No


   : When [Red]


      @>Conditional Branch: Variable [0012: Customer one] == 1   <Conditional Branch#1 Starts here and checks if Variable "Customer one" is set to 1.


            @>Conditional Branch: Variable [0021: Red] >=1   <Conditional Branch#2 Starts here and checks if Variable "Red" is Greater than or equal to 1.


                                                                                         If Conditional Branch#1 is not set to 1, Conditional Branch#2 will not be able to happen. So basically


                                                                                               this is saying "If Customer one is 1 AND Red is greater than or equal to 1.... 


                    @> Text: Actor                                             <---   then do this. 


                     :           : Thank You.


                    @> Change Items: [Red], - 1                                                  


                  : Else                                                            <--- but if Customer one is set to 1 AND variable Red is not equal or greater than 1.....


                    @> Text: Actor


                     :           : Stop playing around!                  <------ then do this.


                    @> Exit Event Processing


                    @> 


              : Branch End   <Conditional Branch#2 ends here.


              @>                       The area down here is still Conditional Branch#1 and is only checking if the variable "Customer one" is set to 1


        : Else


            @>


        : Branch End    <Conditional Branch#1 ends here.

So I'm not exactly sure which ones you and your brother want to try and change. If you told me exactly which ones, I could check to see if it could be done.
As for the conditional branches, I will try to explain what I did because I'm not sure which ones you are talking about here.

Spoiler
@>Show Choices: Red, Blue, Yellow, No


   : When [Red]


      @>Conditional Branch: Variable [0012: Customer one] == 1   <Conditional Branch#1 Starts here and checks if Variable "Customer one" is set to 1.


            @>Conditional Branch: Variable [0021: Red] >=1   <Conditional Branch#2 Starts here and checks if Variable "Red" is Greater than or equal to 1.


                                                                                         If Conditional Branch#1 is not set to 1, Conditional Branch#2 will not be able to happen. So basically


                                                                                               this is saying "If Customer one is 1 AND Red is greater than or equal to 1.... 


                    @> Text: Actor                                             <---   then do this. 


                     :           : Thank You.


                    @> Change Items: [Red], - 1                                                  


                  : Else                                                            <--- but if Customer one is set to 1 AND variable Red is not equal or greater than 1.....


                    @> Text: Actor


                     :           : Stop playing around!                  <------ then do this.


                    @> Exit Event Processing


                    @> 


              : Branch End   <Conditional Branch#2 ends here.


              @>                       The area down here is still Conditional Branch#1 and is only checking if the variable "Customer one" is set to 1


        : Else


            @>


        : Branch End    <Conditional Branch#1 ends here.

So I'm not exactly sure which ones you and your brother want to try and change. If you told me exactly which ones, I could check to see if it could be done.

I mean that after it checks if Customer 1 is set to 1, it does the same thing twice more, to check if it's set to 2 or 3, and if it is runs a different part of the event. Couldn't those parts be set under "else" for the first check, so if Customer 1 is not set to 1, it runs the other part, instead of having to check 2 and 3 separetly? (That last bit was written by my brother 🙂 )


Also I wanted to let you know that I've got the permanent fix working now 😀


I really wouldn't have thought to put the events somewhere else, then set mutiple events to the same location (mainly because I didn't know you could do that, I need to use the RPG Maker more 😉 )


It could come in usefull in other Mini games too, so it's definitely something to remember ☺️


The only little glitch I've got is that when you play the Mini game again, the events from last time are still on, so if it picks a different event for one of the customers, the event it used last time is still visible, and you end up with people floating on the walls 😛


I'm sure I can fix it tough, I just need to find a good way for it to turn the events from last time off, I just thought I'd let you know 'cause you might already know how to fix it  . . . never hurts to ask 🙂


Thank you soooooo much for your help, I don't think I'd ever have got it working on my own, I'm definitely going to put your name in the credits as one of the programmers, if you don't mind, that is  ☺️
I mean that after it checks if Customer 1 is set to 1, it does the same thing twice more, to check if it's set to 2 or 3, and if it is runs a different part of the event. Couldn't those parts be set under "else" for the first check, so if Customer 1 is not set to 1, it runs the other part, instead of having to check 2 and 3 separetly?

Still not sure what you mean by "it runs the other part". By "other part" do you mean the texts like "That's not my order!"? Or do you mean the whole Conditional Branches that check if Customer 1 == 2?


If you mean the texts, then not really, because you still have to check if the other options are correct or false anyways, so they might as well stay where they are.


If you mean the other Conditional Branches, then yes that is possible too I think. I think it looks more organized separated like I have it and you won't have to worry about too many nestled Conditional Branches (that's what it's called when there are Conditional Branches in Conditional Branches). It can get confusing and large if you have too many nestled Branches. Again, feel free to ask questions, I can answer in more detail if you need me to.


Congrats on the permanent fix! 😀   Ya, I didn't program an "OFF" switch into the event because I wasn't worried about that at the time, only getting it working like you wanted it to. I can try to figure something out though if you want.


******Thirty Minutes Later*******


Aaaand done. lol. Um, the best idea I had was to use regular switches (instead of "Self Switch") to change the customer event pages. Then, (I'm guessing you have to leave the area when you are done?) on the transfer event to leave the area, turn OFF all the switches. If you create all the switches in a row, you can use the "Batch" instead of a lot of "Single" control switches.


Awesome! I'd love a game credit if you want to put that in there! 😀 😀 😀


One more piece of advice: For your own sanity, name your events! lol. I've gotten so many it does get crazy sometimes especially if you have to do things like "Set Event Location", you might not remember which event is which. No one but you sees the name, so you can name it stupid stuff too, but I always try to name it something that I would know what the event was just by the name.

Original thread: https://forums.rpgmakerweb.com/threads/event-graphic-changing-randomly.59631/