Example Script. Title Based on Producer Level.

Discussion in 'Ink NPC Dialogue Composition' started by Leucian, Nov 9, 2021.

Thread Status:
Not open for further replies.
  1. Leucian

    Leucian Avatar

    Messages:
    100
    Likes Received:
    163
    Trophy Points:
    18
    Ok this is part of the script of my tutorial NPC.

    at the top you must declare variables.

    VAR playerName = "NONE"
    VAR producerLevel = 1
    VAR title = "NONE"

    Then i create a function
    ===function give_title(x) ===
    ~temp PL=producerLevel
    {
    -PL<=10: ~title="Novice Craftsman"
    -PL<=30: ~title="Apprentice Craftsman"
    -PL<=70: ~title="Journeyman Craftsman"
    -PL<=100: ~title="Craftsman"
    -else: ~title="Grandmaster Craftsman"
    }

    Then call the function inline and print the variable

    ==hello
    Greetings {playerName}, the {give_title(title)}{title}. What would you ask of me?

    The output is this

    Greetings Leucian DeMorte, the Grandmaster Craftsman. What would you ask of me?
     
Thread Status:
Not open for further replies.