NPC Overlap Problem

● ARCHIVED · READ-ONLY
Started by notalentgeek 16 posts View original ↗
  1. The problem is that I need my hero to talk to an NPC while under another event with above characters priority.

    Look at these images below. The hero ideally can talk to both man and the computer. For example if the hero is facing up then he can talk to the man, while if the hero facing down he talk to the computer. The thing is the hero cannot  talk to the man while he is under the computer. How can I solve this?



  2. Show us a screenshot of both events. Does your computer event have a 'player is facing down' condition or something?


    You mean the hero is under the computer?


    What other scripts are you using?
  3. Chances are the computer is set as "above characters" which may cause it to trigger when the player is underneath it. Try checking the "Through" option for the computer.
  4. Yes, it is - he says that in the first sentence :) How would checking 'through' make a difference? (not being smug - I am curious to know and I can't look it up myself right now)


    I think the problem is that (without having Ace in front of me to confirm) it's doing a check_event_here first, detecting the computer event, it's actually activating that event, and then possibly skipping the check_event_there because it believes it's found an event the player can interact with. If you have a conditional branch on the computer event checking if the player is facing down, and you remove that temporarily, you will see that it's still thinking it's interacting with the computer and not the NPC.


    Solution, if seita's suggestion doesn't work? Not sure ... will have to think about it for a bit.
  5. Boop. That's what I get for not reading the whole post~

    Yeah, a screeny of all three events would be preferrable. (moving NPC, computer, and the event just below the computer)
  6. Shaz said:
    Show us a screenshot of both events. Does your computer event have a 'player is facing down' condition or something?

    You mean the hero is under the computer?

    What other scripts are you using?
    1. Here are the screenshots for both events:



    2. Yes! In the screenshot the Hero is under the computer script.

    3. These are scripts I am using:



    seita said:
    Chances are the computer is set as "above characters" which may cause it to trigger when the player is underneath it. Try checking the "Through" option for the computer.
    I have checked the Through, still no difference. :(
  7. Yep, I just checked the code, and it's because it IS interacting with the computer event, even though you don't see anything happening.


    It sees if there's an event on the same tile as the player. If there is, it runs it and stops checking for anything else. In running the event, it checks the player's facing direction and determines that there's nothing to do, but it's still run the event.


    Out of interest, what is the point of all the conditional branches for player direction on your NPC? Looks like the same event commands are getting processed regardless of direction.
  8. I may have misunderstood what you are trying to do, and if so, please excuse me.

    If you want dialogue when the player faces the computer, and have different dialogue with the NPC while standing on the same tile but facing up, right or left, then,

    Take the computer dialogue into its own event.  Set it one tile down, i.e. on the table.  Set it to 'Same as Characters' with the priority 'Player Touch'

    That way, when the player presses the 'down' arrow the computer dialogue will run, and if the player presses the 'up', 'right' or 'left' arrow, the NPC dialogue will run, if that's where the NPC is.

    EDIT

    If the player is using a mouse, then on the first line of the computer dialogue event, if you are using Shaz's mouse script, put a comment:

    <mouse arrow 0, -1>

    then the player will move to the correct tile before the dialogue appears.

    If you're using a different mouse script, then I don't know what you would use.
  9. The event with the computer dialogue is already on the table. You can see the screenshot in the first post.
  10. Shaz said:
    Yep, I just checked the code, and it's because it IS interacting with the computer event, even though you don't see anything happening.

    It sees if there's an event on the same tile as the player. If there is, it runs it and stops checking for anything else. In running the event, it checks the player's facing direction and determines that there's nothing to do, but it's still run the event.

    Out of interest, what is the point of all the conditional branches for player direction on your NPC? Looks like the same event commands are getting processed regardless of direction.
    I got it working! :) Thanks all for the pointers you gave me in this threat! :)

    I changed the computer event into three pages event.

    1. Make it event touch and let this page detects hero's direction and put appropriate self switches.



    2. I set the second page as a parallel process. This page happens when hero is facing up, thus he can talk to the NPC. 



    3. Third page lets you to interact with the computer.



    The conditional branches are used because I want the camera to changes according to who is currently talking.



    I do not know whether these method are intuitive or simple. If you have better method, I hope you let me know. :)
  11. No, that's not good. I think if you interact with the computer from the tile below it the first time, it's going to cause the same problems ... depending, of course, on what you've got happening on the tile below.


    Your second page also shouldn't be on parallel process. There are no event commands to run. It's going to cause a teeny bit of lag (not noticeable, but if you had a lot like this, you'd notice it pretty quickly).


    Actually, if the event below the computer has the same dialogue as the computer event, I think you could remove ALL commands from the computer event and when the player is standing on the computer tile and facing down, they'll interact with the event below the computer, though they won't really be able to tell. That would be a MUCH better solution than what you've got, and would get rid of the original problem too!
  12. Yeah, I would definitely make the active event the one below the computer...but I also wouldn't want the player to be able to activate it from above, because that makes no sense. I guess he's not actually using it, just looking, but who looks at the *back* of a computer monitor? :)

    Also, do you really need the NPC that close to the computers? Seems like you're making it really hard for yourself, but I don't know what the whole scene is.
  13. The conversation is different between when the hero approach the computer from the front or the back of the computer.

    (As Shaz mentioned) I have solved this problem by removing all entries in the computers event. I think I bring this matter too complicated.  :|

    @Tommy Gun: The NPC is not that necessary to have exactly above the computers. It is just nice to know how to solve a problem.

    I have a final question, what is wrong with having empty event of parallel process? The event will only be activated when the hero touch the computer event anyway is not it?
  14. notalentgeek said:
    I have a final question, what is wrong with having empty event of parallel process? The event will only be activated when the hero touch the computer event anyway is not it?
    An empty event set to parallel process? Why even create such a useless event? Parallel process means it can run while the player still has ability to control their movements. But if it's empty, what is the use of letting it 'run'? Setting an event to parallel process means the program will check the event 60 times per second, this can cause unnecessary lag if you have a lot of them at once, especially on older computers.
  15. No, events set to parallel process are ALWAYS running, and they loop by default. Player Touch or Event Touch or Action Button require the player to be physically near or on the event. Parallel Process and Autorun do not - if the map is loaded, the event is running. If you put some Show Text commands on that page, you would see they would be running ALL the time. And they don't run through the command list once and then stop - when they get to the end they start over at the top.


    If you have no commands, then there is DEFINITELY no reason to have an event set as parallel process or autorun.
  16. Ok thanks