Easiest way to create a "phone" mechanic?

  • #1, z morphindelTuesday, 12. April 2022, 04:54 hodinky 2 years ago
    Hey all, struggling noob that has bitten off more than he can chew here!

    What is the easiest way to set up an interface where a player can "call" other characters at any time, and would this sort of thing be easy to do? Would i need to code in Lua, or can i acheive this using VS' editor?

    Heres how i was hoping to run it:
    • Always-on interface on screen.
    • The player can click the icon and bring up a table of NPC characters. 
    • Depending on the scene/conditions etc. selecting one those characters will show up on screen (being called) as avatars with which you can access dialogue you wouldn't when you are in a scene with them.

    The idea is that the character is on "away missions" but can communicate with his crew on the ship using a comms device to ask for hints, hack locked doors, give insights into the scene etc.

    It's a mechanic that i think would really work in the setting of the game, and having it always on screen as a "button" plays up that it is a mechanic that could always be attempted. It's basically the payphone mechanic from Broken Sword but with more flexibility. If i can get it to work that is.

    I manged to get an interface on screen, but i cant figure out how to link it to the NPC table... and even if I did figure that out, how would the dialogue work?

    Would it be easier to just use the comm device as a standard inventory oject with a bunch of conditions?

    Thanks in advance. This may be too complicated for an absolute beginner to set up, but maybe with some advice from seasoned devs i might be able to cobble something together!


    Bažant

    6 Posts


  • #2, z esmeraldaTuesday, 12. April 2022, 13:52 hodinky 2 years ago

    When the list of characters should appear not on the interface but next to it, you could use "real" characters. When the button for the intercom is pressed, use the action to set the characters to the positon - would need some checking first on which scene you are. 

    I'd go for a solution where the characters are set as buttons on a second interface that appears when pressing the intercom button. (interfaces are on top of characters, so displaying a bunch of character sprites on top is not possible. (well, could be possible by using the draw function, but I wouldn't know how to do that) )
    So I would create some buttons on the iterface and set images of the characters to those buttons. Either link the dialoges to the real characters and use narration text instead of display text for the npcs or create an invisible dummy character to link the dialoges to (but you would need to take that invisible character with you each time you change a scene).
    When a button of an npc is pressed call the linked dialoge.


    Btw - the discord might be a better place to ask questions. 
    https://discord.gg/jGsB3kT6

    Zabiják klíčů

    525 Posts

  • #3, z morphindelWednesday, 13. April 2022, 15:25 hodinky 2 years ago

    When the list of characters should appear not on the interface but next to it, you could use "real" characters. When the button for the intercom is pressed, use the action to set the characters to the positon - would need some checking first on which scene you are. 

    I'd go for a solution where the characters are set as buttons on a second interface that appears when pressing the intercom button. (interfaces are on top of characters, so displaying a bunch of character sprites on top is not possible. (well, could be possible by using the draw function, but I wouldn't know how to do that) )
    So I would create some buttons on the iterface and set images of the characters to those buttons. Either link the dialoges to the real characters and use narration text instead of display text for the npcs or create an invisible dummy character to link the dialoges to (but you would need to take that invisible character with you each time you change a scene).
    When a button of an npc is pressed call the linked dialoge.


    Btw - the discord might be a better place to ask questions. 
    https://discord.gg/jGsB3kT6
    Thanks for your advice. I did consider the idea of having a dummy character but i thought that might be a little much to set up for each scene. I will try your suggestion, though i am having trouble figuring out how to create the NPC table. I managed to get the interface to appear on screen, but i can't seem to get a new interface to pop up when it's clicked. In fact it seems to not register any clicks, even though i've defined the active area...

    Bažant

    6 Posts

  • #4, z esmeraldaThursday, 14. April 2022, 17:05 hodinky 2 years ago
    hard to say what went wrong in your setup. Maybe you can show some screenshots

    some basics:
    the interface must be assigned to the playable character
    it needs to have a background (that can be transparent) and action areas need to be placed on that background
    assign a class to the interface (if you are running out of classes, you can create them yourself -> open the exporer and add a new interfaceclass and rename it )
    you can hide / show interfaces with the action part show/hide interface by selecting the interface class

    btw - you don't need to set up a dummy character for each scene. just take the dummy with you when changing the scene with your playable character.

    on second thought - might be possible without a dummy, just by using narration text. (leaving the answer of the dialog empty and displaying narration text in the dialog action)

    Zabiják klíčů

    525 Posts