Pot of soup event

Discussion in 'RPG Maker MV' started by evmaster, Jan 15, 2019.

  1. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    I have an event that walks up to the player and tells them about the soup they are making. Which the player will need an empty bottle and 5 mushrooms for the soup. However when I make the scene for the event, during the talking the NPC keeps moving around. How do I stop the NPC from moving around in the event?

    At first I thought I could fix this if I made it an auto run with a self switch that turned to the page but now I am out of ideas as to how to keep the NPC from wandering randomly while talking during the scene. (The Npc randomly walks around the house when not in the cutscene normally)

    Help would be very much appreciated! (Lemme know if I need to clarify anything else)




    Page 1
    ◆Control Self Switch:A = ON

    Page 2

    ◆If:#of creamy mushroom = 5
    ◆Control Variables:#0024 #of creamy mushroom = The number of Creamy Mushroom
    ◆If:Party has Empty Bottle
    ◆Set Movement Route:NPC (Wait)
    : :◇Script:this.moveStraight(this.findDirectionTo(18, 4));
    : :◇Script:if (this.pos(18, 4)) { this._moveRoute.repeat = false; };
    : :◇Turn Left
    ◆Text:None, Window, Bottom
    : :Excuse me for a moment.
    ◆Set Movement Route:Player (Wait)
    : :◇Move Left
    : :◇Turn Right
    ◆Set Movement Route:Creamy soup (Wait)
    : :◇Turn Up
    ◆Comment:play sound effect boiling water or something
    ◆Set Movement Route:NPC (Wait)
    : :◇Turn Left
    ◆Text:NPC(3), Window, Bottom
    : :Thank you for waiting. Please enjoy.
    ◆Change Items:Empty Bottle - 1
    ◆Change Items:Bottle of creamy soup + 1

    :Else
    ◆Text:None, Window, Bottom
    : :You do not have an empty bottle for the mushroom
    : :soup.

    :End

    :Else
    ◆Text:None, Window, Bottom
    : :You do not have enough mushrooms.

    :End

    Page 3
    ◆Set Movement Route:NPC (Repeat, Wait)
    : :◇Script:this.moveStraight(this.findDirectionTo(18, 4));
    : :◇Script:if (this.pos(18, 4)) { this._moveRoute.repeat = false; };
    ◆Set Movement Route:NPC (Wait)
    : :◇Turn Left
    ◆Set Movement Route:NPC (Wait)
    : :◇Turn Left
    : :◇Walking Animation OFF
    : :◇Stepping Animation OFF
    ◆Text:None, Window, Bottom
    : :You look interested in the contents of
    : :that pot. I am actually trying to make
    : :creamy mushroom soup.
    ◆Text:None, Window, Bottom
    : :However, I do apologize, I do not
    : :have enough ingredients. I am missing
    : :some mushrooms.
    ◆Text:None, Window, Bottom
    : :If you find some on your adventure
    : :and bring them back, I will gladly share my
    : :soup with you. You will need an empty
    : :bottle to store it as well.
    ◆Set Movement Route:NPC (Wait)
    : :◇Walking Animation ON
    : :◇Stepping Animation ON
    ◆Control Self Switch:B = ON
    ◆Control Self Switch:A = OFF
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    27,099
    Likes Received:
    5,941
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    please give screenshots of your events - the content alone is not enough, this is most likely a case of using the wrong triggers and options.
    We need to see the entire events to check that and try to find the cause of the error.
     
    #2
    evmaster likes this.
  3. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm working on the other two screenshots.

    Here is this one in the meant time. It is the event I want the most looked at

    Edit: Got all the screenshots
     

    Attached Files:

    Last edited: Jan 15, 2019
    #3
  4. Andar

    Andar Veteran Veteran

    Messages:
    27,099
    Likes Received:
    5,941
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    1) Is there any other place where you set the variable for the mushrooms? Because otherwise the sequence on the second page is on the wrong order.
    2) has nothing to do with this problem, but it would be easier if you sort your pages better - here you need to switch off self-switch A because its page has a higher priority than the page triggered by B. It can work this way, but you need additional commands and it can get convoluted.
    3) please provide screenshots for the NPC event as well - with these lines, the NPC event should stop moving - if it doesn't, it gets commands from somewhere else.
     
    #4
  5. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    1. By place do you mean events? I do not understand ^^; I was trying to make the player have 5 mushrooms before proceeding with the event. I have since edited the event for it to start with "if player has empty bottle" and then check for mushrooms. Still not working as I thought it would though...

    2. I do not understand. Is it because I put page 2 as "self switch B" and page 3 as "self swith A"?

    3. I have the NPC on autonomous movement set to Random. He is doing exactly that during the conversation. During the conversation he does not go anywhere specific, he just randomly walks like he does normally around the house. I have attached the first page of his event
     

    Attached Files:

    #5
  6. Andar

    Andar Veteran Veteran

    Messages:
    27,099
    Likes Received:
    5,941
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    1) In your event, the first line is "If Variable # of creamy mushrooms = 5", followed by control variable "set # of creamy mushrooms = number of item in inventory".
    By default all variables start at 0, so by default this if is never true and never executed - and after you check if the number is 5, you set the number to what you really have in your inventory - which will never happen unless a different control variable command has previously set that number to 5.

    To check how many of an item the player has in inventory, you need to set the variable to that inventory first, before you can check it with the conditional branch.
    And I asked you if you have that control variable command in some other event, so that the engine knows the number before this event is triggered.

    2) yes - you should check some tutorials about page priority, and why a sequence should always go up in page numbers.
    Your event is executed in the order page 1- page 3 - page 2. That is why you need to disable the A variable - page 3 has a higher number and thereby a higher priority than page 2. Events will work much better if the sequence is handled in the order of higher page numbers, page 1-2-3 instead of 1-3-2.

    3) you need to disable autonomous movement if you want the NPC to stop. As long as the active page of NPC has autonomous movement, it will continue new movement after the previous one is completed. That is why the event continues to move.
    Best solution is to have that event a non-moving page and switch to that page while the event is running with a general switch.
     
    #6
    evmaster likes this.
  7. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    Okay, 2 and 3 are fixed. But as for 1...

    How do I set to check if the player has more than 5 mushrooms? I'm confused.
     
    #7
  8. Andar

    Andar Veteran Veteran

    Messages:
    27,099
    Likes Received:
    5,941
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    1) you just need to exchange the order of your two commands

    wrong order:
    >if variable # > 5
    >control variable # is #of item

    correct order:
    >control variable #ofcreamymushrooms is number of creamy mushrooms
    >if variable #ofcreamymushrooms >=5 then do
     
    #8
  9. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm also trying to check first if there is an empty bottle for the soup. I'll edit my post, I'm still having trouble.

    If it says
    IF PARTY HAS EMPTY BOTTLE

    ELSE

    If the party has empty bottle wouldnt the events be written under the IF PARTY HAS BOTTLE rather than the ELSE?

    I'm really confused here.


    Edit 2: Shouldn't it be

    IF PARTY HAS EMPTY BOTTLE
    IF VAR CREAMY MUSHROOM COUNT
    <insert event messages under these?>
     
    Last edited: Jan 15, 2019
    #9
  10. Andar

    Andar Veteran Veteran

    Messages:
    27,099
    Likes Received:
    5,941
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    The control variable command has to be before the check for it.
    Otherwise it's like locking a car with the keys still inside - consider the control variable command to be the command that decides on the key, and if it is inside the box (inside/below the if condition) then you can never open the lock to get inside.

    it doesn't matter if you check for bottle or creamy mushrooms first - and you should simply disable the else branches for now, the else branch should only contain messages like "you don't have xy" later, after you got your basic logic to work without the else branches.
     
    #10
    evmaster likes this.
  11. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    I apologize, I'm having a hard time trying to imagine this in my head. I'm more of a visual person, could you please show me an event example? Like how to check if you first have an empty bottle, then enough mushrooms to proceed with the event?

    I would appreciate it. ^^;
     
    #11
  12. Andar

    Andar Veteran Veteran

    Messages:
    27,099
    Likes Received:
    5,941
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    checkitemnumber.png
    As I said the control variable commands need to come first before you can check the numbers.
     
    #12
    evmaster likes this.
  13. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you! I had the branch set to check if the part has the item Empty bottle but I never considered using a variable to check for an empty bottle as well. ^^; I'll go try to fix it and edit this post again.
     
    #13
  14. Andar

    Andar Veteran Veteran

    Messages:
    27,099
    Likes Received:
    5,941
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    both works - as long as those cases where you use variables are set before the conditions - that was your mistake in the event above, to have the control variable command below the conditional branch.
     
    #14
  15. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    Okay, so I need to state what I have before it can check what I have, right? It's working now btw.

    Thanks so much! ^_^

    Edit2: Well it works except for when I try to get soup a second time. Then the character doesn't go back to the spot I wanted him too. I'll try figuring it out and edit back later if I have any success.

    Edit3: Seems to happen when I sped up the event...hmm..

    Edit4: There's nothing that blocks the NPC path when he comes to the soup bowl for a second time. I'm not sure why the second time matters any as to why the script will work or not. I have the script set to repeat so he will keep moving but it is not working..Hmmm.

    Edit5: It is like the script will not work a second time. I don't understand why though.

    Edit6: The idea was to have ingredients for the soup., have the npc come over and make it, give player item and then move away. When I touch the bowl again it should activate the same event for where the Npc moves straight to the spot I told him to via script. Why is it that it works the first time but not the second?
     
    Last edited: Jan 15, 2019
    #15
  16. Andar

    Andar Veteran Veteran

    Messages:
    27,099
    Likes Received:
    5,941
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    If you want an event to repeat, then you need to make sure that it is back to the original conditions after the first sequence is complete.
    That means when the event is finished all self-switches and everything else that you used for page conditions must be made to go back to the defaults.
     
    #16
  17. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    I do not think the script is working right. The even should be working fine. I have it set to the tile I want the NPC to go to. But sometimes he stops from tile short of the tile he is suppose to be on. Now what??
     
    #17
  18. Shaz

    Shaz Veteran Veteran

    Messages:
    36,927
    Likes Received:
    10,860
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Can you show screenshots of your event pages now? You had 2 and 3 in the wrong order (it would have worked because you were turning off self switch A when you turned on B, but it's confusing to look at, because we generally expect things that happen later to be on higher numbered pages).

    And a screenshot of your map (in the editor), with tile 18,4 highlighted so we can see where you're trying to make the NPC go to.
     
    #18
  19. evmaster

    evmaster Think Outside the Box Veteran

    Messages:
    400
    Likes Received:
    696
    First Language:
    English
    Primarily Uses:
    RMMV
    ◆Set Movement Route:NPC (Repeat, Wait)
    : :◇Script:this.moveStraight(this.findDirectionTo(18, 4));
    : :◇Script:if (this.pos(18, 4)) { this._moveRoute.repeat = false; };

    I think it's the script that is not working. It seems to work fine after I enter and exit the building. But making it repeat once the event is done so the NPC goes straight back to the same spot? Uh uh, does not work. Is that possible? Nothing is blocking it to my knowledge. And every time I activate the event, the NPC stops a tile further down each time for the event.

    I think I will just change the event where the NPC doesn't have to come up to the point and gives you the soup. =/ I think I will just have the player go to the house to get the soup. It's fine. Just giving an update.
     
    Last edited: Feb 3, 2019
    #19
  20. Shaz

    Shaz Veteran Veteran

    Messages:
    36,927
    Likes Received:
    10,860
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
     
    #20

Share This Page