String in Dialogtext ausgeben

  • #1, by boringsuburbandadMonday, 02. August 2021, 11:12 2 years ago
    Dies ist mein erster Post, daher erstmal herzliche Grüße in die Runde!
    Mein Name ist Timo, ich hab unter anderem das Spiel "Dinner with an Owl" (gibt's gratis auf Steam) veröffentlicht.

    Ich steige gerade von einer anderen Engine auf Visionaire um. Vieles funktioniert hier sehr anders als ich es gewohnt bin. Eventuell stehe ich daher gerade völlig auf dem Schlauch.
    Hoffe ihr könnt mir helfen...

    Ich möchte innerhalb eines Dialogs gerne Strings und Integers ausgeben können. Sollte ja eigentlich trivial sein...
    Folgendes Beispiel, geschrieben im Dialogteil-Text (ohne Anführungszeichen, ohne die Leerzeichen nach den eckigen Klammern):

    "Hallo mein Name ist < name > und ich bin < alter > Jahre alt."

    Ich denke, dass ich die Variablen "name" und "alter" in einem Lua-Skript (Definitions-Skript) anlegen muss. Nach meinem Verständnis tue ich das auch:

    name = "Peter"
    alter = 45

    Während der Laufzeit werden die Inhalte von "name" und "alter" jedoch nicht ausgegeben. 

    Was mache ich falsch?

    Newbie

    2 Posts


  • #2, by afrlmeMonday, 02. August 2021, 14:33 2 years ago
    A'llo, you can link to the string & number fields belonging to values inside of display texts.

    Check out this wiki page here.

    Quick note #1: you can only set the initial string belonging to a value inside of the editor. There's currently no action part for updating it - I've no idea why - but you can use script to update them as needed. Add something along the lines of this...

    Values["insert name here].String = "hello world"

    Quick note #2: names are case sensitive when being accessed by script, so make sure they match exactly what you called them; lowercase, uppercase, white space & all.

    Imperator

    7278 Posts

  • #3, by esmeraldaMonday, 02. August 2021, 16:08 2 years ago
    ... Quick note #1: you can only set the initial string belonging to a value inside of the editor. There's currently no action part for updating it ...
    lehman made a plug-in, creating an action part to change the string of a value. Not sure it is available outside the visionaire discord.
    I recommend joining the discord, response time is much quicker there.

    Ach ja: Hallo Timo! Schön dich hier zu sehen! 
    Dinner with an Owl muss ich jetzt endlich mal spielen, nachdem du es vor einer Weile überarbeitet hast...

    Variablen, die du nur in lua anlegst, werden soweit ich mich erinnere nicht gespeichert. Also im Editor selbst einen Wert anlegen, einen String zuweisen (über lua oder den plug-in) und dann kannst du im Display Text über <v= name_wert> den Integer des Wertes und über <vs=name_wert> den String des Wertes zeigen.

    Key Killer

    513 Posts

  • #4, by afrlmeMonday, 02. August 2021, 16:23 2 years ago
    You forgot to link to the discord server. grin

    https://discord.gg/g5zFejW

    & yeah, I meant default editor action parts, not plugins. I completely forgot he'd written one to do that. Simon should really just implement an official action part into the editor - really should have been in since the start.

    Imperator

    7278 Posts

  • #5, by boringsuburbandadTuesday, 03. August 2021, 16:37 2 years ago
    Thank you for your quick help and getting me started - It works fine!

    And thank your for the warm welcome Esmeralda smile




    Newbie

    2 Posts