2 Inventare/Tagebuch|2 Inventories/Diary

  • #1, by irinahuw_Tuesday, 20. February 2018, 17:52 6 years ago
    Hallo!

    Ich würde gerne neben dem normalen Inventar eine Art Tagebuch erstellen.
    In dieses Tagebuch kommen Informationen, wenn die Spieler etwas gefunden haben, das kein Item ist.

    Beispiel:
    Spieler entdeckt Vogel-->klickt drauf-->erhält Steckbrief über Vogel-->Steckbrief wird in Tagebuch abgelegt

    Dieses Tagebuch soll den Spielern immer zur Verfügung stehen.

    Beispiel für so etwas ähnliches ist das Tagebuch im Adventure "Dead Synchronicity" von Daedalic, wobei ich das Tagebuch lieber ausserhalb als eigenes Icon oder in einem Menü ausserhalb des Spiels haben würde.

    https://youtu.be/vk72wsknIGk?t=36m9s hier das Beispiel (bei 36:10)

    Weiss jemand wie das geht? Habe leider nix dazu gefunden und wäre superfroh um Ideen und Lösungen, wenn möglich ohne Skriptzeugs smile))

    ENGLISH (short):

    Next to the regular inventory, I would like to have some sort of a diary. So the player can collect informations in this diary and look it up whenever they want to. I prefer to have the diary outside of the inventory as a button or in a separate menu, not like it is done in the following example. But if this is the easiest way, I would be okay with it.

    Example for a diary in Dead Synchronicity: LINK (36:10)

    Does anybody know how this works? I would be very happy about a solution or idea, especially when there is no scripting required smile))

    Newbie

    49 Posts


  • #2, by sebastianTuesday, 20. February 2018, 22:39 6 years ago
    Because mostly diary entries are text based you likely build something up which includes writing the text into a VS Value string and display it via e.g. object text.

    I would suggest the following:

    create a definition script in the LUA workspace and add a global table which includes ALL diary entries which are possible in this game:

    entries = {
    "Some log text about a thing i discovered in the forest next to a skeleton.\nThe text after the word skeleton should be written inside a new line.\nBlah",
    "some other entry",
    "some next entry"
    }
    

    Thats for the database itself.

    Now you need to construct the diary itself. I would recommend displaying two pages like in your example video in an interface. Use an open book image as the background image.

    Create the interface and assingn an own interface class to it. Make the interface usable for your character.

    In this diary interface create two buttons, type action area:

    Button: left_side , type: action area
    Button: right_side , type: action area

    No need for images in here.
    Also create 3 Values in the interface:

    Value: page_left: default string: TEST LEFT SIDE
    Value: page_right:  default string: TEST RIGHT SIDE
    Value: current_page: default: 1

    Create also a new button in the interface, type action area and call it "texts". In this we will setup the diary behaviour.

    select the "texts" button and go under its "Actions" tab.
    Create a new tab "display_entries", type "called by other action".

    When opening the interface via your preferred action, just call after the "show diary" interface the "display_entries" action from the diary interface.


    In this "display_entries" action add a "display object text" action part and select the "left_side" object, choose a font and the coordinates for the soon to be displayed text on the left page . As text use "<vs=page_left>" Do the same for the right page and enter "<vs=page_right>" as text and coordinates for the right side text.</vs=page_right></vs=page_left></div>


    Now when you go in game and show the inventory, calling the "display_entries" action, it should show TEST LEFT SIDE on the left page and TEST RIGHT SIDE on the right side.

    So far so good.

    Now we need to make these pages dynamic. Remove the TEST LEFT SIDE, TEST RIGHT SIDE texts from the value strings.

    For this we need a new Lua array which will only contain the entries which are "learned" on the characters journey. Go into the lua workspace and add a new table under the "entries" table. Call it e.g. "diary". At start it contains 0 items:

    diary = {}
    

    to add an entry from to the diary use a table function whenever you want to put something new into the diary:

    table.insert(diary, entries[1])

    This would add the content from "entries" table at index 1 to the "diary" table.
    Now you can feed the your diary as you wish with new content.

    Back to the interface. You need to display the arrows and if clicked on them they need to add/substract 2 pages (because this is a two page display of entries)

    Left Click Action - Execute a script, Left arrow Button

    if Values["current_page"].Value > 1 then
      Values["current_page"].Value -2
      startAction(Actions["display_entries"])
    end
    
    Left Click Action-Execute a script, Right arrow Button

    if #diary > 2 and Values["current_page"].Value < #diary then
      Values["current_page"].Value +2
      startAction(Actions["display_entries"])
    end

    this should trigger the clicking only when you are inside the table dimensions.
    After each click "display_entries" gets called again. We need to edit this action a bit, so that the entry depending on the current page gets displayed:

    Edit "display_entries" action. Before the "display object text" action parts enter an "execute a script" action part:

    Values["page_left"].String = diary[current_page]
    Values["page_right"].String = diary[current_page+1]

    this should update the ValueString just before you display it. to the objects.



    ----

    The End.

    -----

    Disclaimer :: This was all written out of my head without any testing. There could be something missing or may need some adjustments in the if queries... I hope this all would lead you into the right direction^^

    Thread Captain

    2346 Posts

  • #3, by afrlmeTuesday, 20. February 2018, 23:08 6 years ago
    It's a shame the recent value option that was added to determine if scene objects should be active/visible or disabled/hidden wasn't also added as an option to the interface buttons properties tab as it would make it so much easier to create a simple diary system just by increasing/decreasing a value.

    @SimonS could you implement it please? Cheers. wink

    Imperator

    7278 Posts

  • #4, by irinahuw_Wednesday, 21. February 2018, 09:25 6 years ago
    Hello Sebastian,

    thank you so much for your idea & help, much appreciated!

    I got parts of your idea, but unfortunately I am absolutely unfamiliar with scripting. Totally want to give the scripting a try, but I would like to ask another question first because I did not explain myself too well:

    I do not want to use a text-database, or generally any text written in Visionaire for the diary. My diary-idea is rather a picture book than a diary, so I would like the diary to collect pictures i create and import into visionaire beforehand.

    Example:
    Player sees bird-->clicks on bird-->gets factsheet about that bird-->factsheet is filed in the diary

    the factsheet would be a simple .png picture with text and everything, imported into visionaire.

    Does this make the whole thing any easier?

    Newbie

    49 Posts

  • #5, by afrlmeWednesday, 21. February 2018, 12:02 6 years ago
    You can use conditions to determine which image(s) should be visible. You would need to use combined conditions to determine if x page is shown & x content has been found. A combined condition is made up of 2 existing conditions.

    Imperator

    7278 Posts

  • #6, by esmeraldaWednesday, 21. February 2018, 13:24 6 years ago

    Key Killer

    513 Posts

  • #7, by afrlmeWednesday, 21. February 2018, 15:06 6 years ago
    Here is another idea how to do it:
    I completely forgot about that thread. grin

    Imperator

    7278 Posts

  • #8, by stothewWednesday, 21. February 2018, 16:44 6 years ago
    This stuff looks all to complicated to me.

    Why not just create a Scene/menu page with a big Book as background ?
    Ever page or picture is an object.
    Two buttons at the bottom that increase or decrease a value.
    Use the value as indicator which page you are on.
    If you need to "unlock" single elements on the page i would use an extra condtion on every Object.
     And use "show/hide scene" instead of "change scene"

    This way the book is not "dynamically created" but in my guess it´s much eayser to achieve.

    Hope this one is easier for you. Anyway the other solutions will work, too.

    Forum Fan

    127 Posts

  • #9, by constantinWednesday, 21. February 2018, 17:04 6 years ago
    I had it the way you mentioned but i found out it gets complicated when you want to translate the language or just want to edit texts or change fonts or even small things. Esp when you have lots of infos. Today i tested the method above and it is not so much work. Thanks for that by the way. It works perfectly. 

    Forum Fan

    167 Posts

  • #10, by irinahuw_Friday, 23. February 2018, 10:22 6 years ago
    Thank you all so much for your help! I am very glad that there is such a cool community behind Visionaire Studio smile

    I will try to figure it out with the ideas from esmeralda and stothew, thank you guys!
    If i managed to do it and/or found a different work around I might post it here smile

    Newbie

    49 Posts