fanadventures.net

Header
English
 
Forum overview > Questions about having a NPC move between scenes
  • by irinahuw_ · Tuesday, 29. May 2018, 10:52 h ~ 2 years ago
    Hello!

    I have the same/similar problem, but I do not understand the suggested solution.

    First question: Outfits & changing scenes

    Currently I set up 2 different persons for one NPC. One in scene 1, another in scene 2.
    I could not make it work with the outfits somehow, that's why i have 2 NPCs which are the same Character, but in different scenes. How can I make it work with the outfits only? I think using only one character with different outfits shown at different scenes would make more sense, but I could not place the NPC with a different Outfit in another scene.

    Second question: Values/Conditions

    I don't understand how and where I should set up the values/conditions for showing/hiding the character in the 2nd scene.

    What I want:
    The Maincharacter talks to the NPC in Scene1. The NPC then switches the scene from 1 to 2, but the scene itself for the Maincharacter & Player is not supposed to switch. After the Maincharacter enters scene 2, the NPC is waiting there and does something after talking to the Maincharacter. Then it returns to Scene 1 again.

    What I have:
    The Maincharacter talks to the NPC. In the Dialogue i set up an Action, so that after talking to the NPC, the NPC walks out of the scene and disappears (send character to position, hide character). After this, I would like the NPC to appear in the 2nd scene. But currently it is always there, no matter if the Maincharacter talked to the NPC or not. Also I did not manage to make the NPC return from scene 2 to 1. When all the actions are done and Scene 1 is entered, the NPC keeps walking away & disappearing.

    It's very confusing...I'd be very happy about inputs & suggestions!

    Irina

    irinahuw_
  • by afrlme · Tuesday, 29. May 2018, 11:31 h ~ 2 years ago
    Outfits are just what they sound like, outfits. They are meant for storing animations or variations of your character. Let's say he has a hat, then let's say later on that he loses or takes the hat off.

    The change scene action part changes to the next scene & drags whichever character you specify over into the specified scene & places them at the scene object you specified.

    The action parts you should be using for teleporting an NPC over to another scene or position are the set character to position & set character to object action parts. Both of those action parts allow you to move a character to a new position or scene without changing scene.
    afrlme
  • by irinahuw_ · Tuesday, 29. May 2018, 11:46 h ~ 2 years ago
    hello afrlme!

    thank you for your answer.

    i tried both, set character to position & set character to object.
    i have the NPC in scene 1, and an object (positioncharacter) in scene 2 where i want the NPC to go.
    when i chose "set character to object", i chose "posbiber" in scene 2. unfortunately, the NPC moves seemingly random across the scene 1 when executing the action, and it does not go to scene 2.

    you can see how i did it in the picture. i want the NPC to move from scene "biberhabitat" to "koben" and back again.
    what am i doing wrong?
    irinahuw_
  • by afrlme · Tuesday, 29. May 2018, 11:57 h ~ 2 years ago
    I don't speak German, but I can see from the screenshot that you are using the send character to object action part because I can see a "& wait" at the end of it. Keep looking through the action parts because there are 2 for directly setting the character to an object or position & not sending. Sending will try to make the character walk to the new object or position.

    The correct action parts in German are: person auf position setzen & person zu objekt setzen.
    afrlme
  • by irinahuw_ · Tuesday, 29. May 2018, 12:04 h ~ 2 years ago
    this did the trick!
    i used send to position instead of set to position. i get easily confused at times because there are actionparts with similar words in it which do totally different things... i try to be more conscious about that in the future.
    thank you very much, again!!!
    irinahuw_
  • by afrlme · Tuesday, 29. May 2018, 12:24 h ~ 2 years ago
    No worries.wink
    afrlme
  • by irinahuw_ · Tuesday, 29. May 2018, 13:42 h ~ 2 years ago
    already have the next issue:

    when the NPC is in the new scene, it starts the dialogue from scene 1. but of course i want it to start another dialogue. but i don't know where i have to put the values so that it happens.
    i have used values before for objects, so that if the player has clicked 2 objects, another object appears. but i haven't figured out how and where to set up the values for things like dialogues. does someone have a solution or example how they usually do it?
    irinahuw_
  • by afrlme · Tuesday, 29. May 2018, 13:59 h ~ 2 years ago
    Can you post some screenshots of how you have setup the dialogs & interaction actions for them please?

    But, anyway... the solution still lies in conditions/values. You have to create if queries. If queries are used to determine if x or y event should happen.

    Let's say you left click/execute a command on the npc. Inside of the left click/command action block you could do something like this...



    You said dialogs, so I am just assuming you are talking about the actual dialog system & not display texts, either way you can use the same method. If you just want the character to say something specific based on a value, then it works the same way.

    P.S: game development & development in general is just a bunch of 1's & 0's; aka true & false. Most events & states in your game will be determined by if queries, values & conditions.
    afrlme
  • by irinahuw_ · Tuesday, 29. May 2018, 14:17 h ~ 2 years ago
    Can you post some screenshots of how you have setup the dialogs & interaction actions for them please?
    of course! but i am not sure which parts are the most helpful to see. i added a picture of my dialogue set up and the actionpart of the dialogue part which should make the character go to the other scene:

    first problem is that i only manage to make the character either walk to the scene border and then disappear, OR that the character appears in the 2nd scene but does not walk, but just disappears from scene 1. in one of the pictures you can see how i tried to set it up. with this set up, the character starts the walk animation, walks to the border of the scene and disappears, but does not appear in scene 2 "koben".

    when i just choose to set the character in scene "koben", it does not walk out of scene 1, but just disappears.

    i will try the thing you showed in the screenshots for the dialogue problem!! thx a lot

    EDIT: thanks to your screenshots i could start a different dialogue in scene 2. now i have only the problem above left, which is also true for the 2nd scene: i only manage to make the npc walk to the border of scene 2 and then disappear, but not reappear in scene 1. added a screenshot for the actions here too.
    irinahuw_
  • by afrlme · Tuesday, 29. May 2018, 14:41 h ~ 2 years ago
    Yeah, set = teleport. It seems you are telling the character to walk somewhere first & then teleporting the character when it reaches the destination, which is correct if you want it to walk somewhere first. Now the question is: can the character actually reach the destination position?

    Also, I'm confused as to why you are using multiple outfits. Each outfit has built in idle, walk, talk & random animation sections. They also have a character animation section which allows you to add animations that should be played manually via the play animation action part or via Lua script with the startAnimation() function.

    As for the dialog, I see you actually meant dialog parts & not multiple dialogs. You can assign conditions or values to each dialog part to determine if it should accessible. I think your issue here might be to do with the dialog level. Have you figured out how to change levels? Just look at the dialog tree, you can see that all the dialogs in 6.1 are in a different level from all of the other dialog options. If you click on dialog 6 option then you should change the dialog level so that it shows the dialogs in 6.1. I think you have shifted them down by 3 levels, but I'm not 100% sure as I don't use dialogs much.

    *edit: checked the new screenshot. You have hidden the character instead of set him to the new scene. Also you should always close of if queries with an end if action part at the end of the query block. example...

    if value "x" is 1
     some action parts
    end if
    afrlme
  • by irinahuw_ · Tuesday, 29. May 2018, 15:50 h ~ 2 years ago
    thank you so much for your patience and help!
    Yeah, set = teleport. It seems you are telling the character to walk somewhere first & then teleporting the character when it reaches the destination, which is correct if you want it to walk somewhere first. Now the question is: can the character actually reach the destination position?
    i added a picture again for this, because i cannot make it work. first i send the character (only "biber" now, no other characters involved) to the scene border and then i set it to another scene, as you can senn in the picture. imo the character should activate its walk animation and go to the position i am telling it and then change scenes. but instead it stays in its standing animation and weirdly hovers over the scene to the position... what could it be? i do have assigned all walk animations in the character tab.
    Also, I'm confused as to why you are using multiple outfits. Each outfit has built in idle, walk, talk & random animation sections. They also have a character animation section which allows you to add animations that should be played manually via the play animation action part or via Lua script with the startAnimation() function.
    the many outfits come from trying out a lot of option whenever something did not work, xD
    but i am using now only the character "biber".

    and for the dialogues: definitely need to have a closer look at them, i have set them up very roughly for now. thank you!


    irinahuw_
  • New post