A special kind of Inventory/Dialogue Box (or not?)

  • #1, by JoelMonday, 09. November 2015, 22:39 9 years ago
    Hi Guys!

    Well, things are progressing with my little project, i'm learning more by the minute, which is really great. Visionaire is awesome, i was able to "program" the whole very first section of my game without ever looking at Tutorials and just playing around with the Actions. Granted, i'm kind of used to visual scripting, since i worked in Construct 2 a lot before but still, thanks to the hard work of all the Developers, i know you guys are basically doing this more or less in your spare time and it's really appreciated!

    Let's not get sentimental though grin The reason i'm opening up another stupid Thread is because i'm not quite sure about how i should make my Inventory/Dialogue Box idea. The Interface section is still the most complicated thing for me so i hope some of you can nudge me in the right Direction.

    What i want to do basically is this:

    I got an Inventory which is always visible in the Bottom of the Screen. Now, i also have a Character Portrait there, which i want to animate when the main character is talking but also throw a few Random Animations in there and some Reaction Shots when there's something going on (i.e. a scared expression when something eerie happens etc.)

    On the Right side, i want to show the Portraits of the NPC's, which will only appear, when they talk and are not constantly visible. So basically it's a multi-purpose Hotbar.

    For better Understanding i produced this lovely Mockup which will hopefully explain what i mean a little bit better smile

    Thanks for your help, appreciate it!

    Forum Fan

    129 Posts


  • #2, by JoelTuesday, 10. November 2015, 10:44 9 years ago
    Allright, i found a way to search the Forums without the Forum Search function by just using Google wink

    I found this thread which probably does pretty much what i want:

    http://www.visionaire-studio.net/forum/thread/moving-comment...

    Now, is there a way to activate/deactivate a black square png file over the Inventory Box whenever there's a Text being spoken? I guess that could be done with the Interface Tab, am i right? The reason i want to do this is, because as soon as the Character speaks, the Inventory Items should be hidden of course, since the Text is going to be in it's spot.

    Hope that makes sense smile

    Forum Fan

    129 Posts

  • #3, by afrlmeTuesday, 10. November 2015, 21:26 9 years ago
    Create a button that contains a black image & add it to both inactive & active image tabs of the button. Next create a condition, set to false as default & add that to the properties tab of the button - there's a bit where you can add conditions. This will allow you to toggle the image on & off via the condition. Alternatively you could also only set the image to either the active or inactive image tabs & change that with the relevant action part instead.

    As for the trigger. I recommend using the registerHookFunction() with setTextPosition event as that can be used for both checking when a text begins & for positioning said text.

    You can use a registerEventHandler() function with a textStopped event for checking when text is stopped.

    However I do not recommend using those event listeners for toggling the black image thing on & off as it will flash on & off between each displayed text. Instead I recommend changing the condition or swapping between the active / inactive image of the button just before the initial display text / dialog & then reverting whatever method after the final display text or after ending a dialog.

    Quick note #1: all 3 of the text events allow you to query the owner of the text & whether it belongs to a character or not. So essentially you could also use the textPosition event to set right hand side avatar of the speaking character while checking if the owner is a character & is not the active character.

    Quick note #2: there are loads of threads on here which provide examples of all 3 Lua text event handlers / listeners, as well as examples on the wiki, which is why I've not bothered providing one as I've provided them multiple times in multiple threads already.

    Quick tip: Seeing as the text box is so small I recommend limiting the max width of the text via the font section of the editor. There's an option for setting the max line width or something (I forget the exact name of the option).

    Anyway... good luck.

    Imperator

    7278 Posts

  • #4, by JoelTuesday, 10. November 2015, 22:01 9 years ago
    Thank you sir smile

    Forum Fan

    129 Posts

  • #5, by sebastianTuesday, 10. November 2015, 22:03 9 years ago
    additionally you could set the said button as button type "action area" to prevent it acting as a command button inside Visionaire itself. By that the black box command won't appear as a selectable command everywhere you set or check for commands in the dropdown lists.

    Thread Captain

    2346 Posts

  • #6, by JoelTuesday, 10. November 2015, 22:06 9 years ago
    That's a very good hint, thank you smile

    Could i set the always visible portraits up as a button as well and just trigger different animations with the action parts? Or should i rather try to make the portrait a separate outfit or even character?

    Forum Fan

    129 Posts

  • #7, by afrlmeTuesday, 10. November 2015, 22:12 9 years ago
    I don't think you will be able to layer characters on top of the interface, so if you did want to create them as a character you would need to cut out the background of the interface where the character needs to go & include the missing part of the background in the characters image.

    Alt method would be to create a single button for the npc avatars & then create multiple animations for it. Then play each animation as needed or you could add all frames into a single animation or animation per npc (various expressions) then control the active frames via Lua script.

    Imperator

    7278 Posts

  • #8, by JoelTuesday, 10. November 2015, 22:16 9 years ago
    I think i'm getting it, thank you, i already bookmarked all the scripts i could find about text (during my working hours so don't tell my boss razz ) so i'm going to experiment smile Thanks for the help!

    Forum Fan

    129 Posts

  • #9, by JoelWednesday, 11. November 2015, 19:52 9 years ago
    Visionaire is just so amazing, it works just as i imagined!!!! THANK YOU! (Well, i've only done the Portrait Animation part so far but i even got it so she blinks at a random time so it feels more alive smile )

    Forum Fan

    129 Posts

  • #10, by afrlmeWednesday, 11. November 2015, 21:19 9 years ago
    Very nice smile

    Did you know that you can control pause action part value via an actual value you create? Also possible to update the value &/or set a random value, which is a great way to create dynamically changing content.

    It's also possible to control animations in a similar way. You can update the play direction, the global pause (delay) value between frames or you can even force it to play between x & y frames.

    In the game I'm currently helping with, I have the character randomly decide at the beginning of each idle character loop to decide whether the character should blink once, twice or not at all. I did that by calling a random value in the first frame of the animation to determine which animation frame it should play up to before looping back to the beginning. The end result turned out quite good.

    Imperator

    7278 Posts

  • #11, by JoelWednesday, 11. November 2015, 21:41 9 years ago
    That's a good idea smile I made two animations so far with her "flirting" to the player or just blinking. The only problem i'm encountering is, that sometimes it starts the animation inbetween two text lines, since i'm calling the talk animation in the talk section of the regular character. I guess there's like a very tiny pause when text is getting switched and then she itches for a milisecond into the random animations. Not quite sure how to solve this yet. I was hoping to avoid calling the animation manually each time she talks and then deactivate it again when she stops...

    Forum Fan

    129 Posts