V2 Example Code for using and displaying all the current inky external functions

Discussion in 'Ink NPC Dialogue Composition' started by Anpu, Apr 5, 2023.

  1. Anpu

    Anpu Avatar

    Messages:
    7,944
    Likes Received:
    9,015
    Trophy Points:
    153
    Location:
    Hemut
    Copy and paste this code and save as an .ink file. This code will ONLY work on crown Shop conversationalists, due to the character limit of over 2,000. This will use all the currently available external functions and return the value they currently have.

    Code:
    //All Current in game functions example v2 05-07-2023 by Anpu
    //This code works in the Inky Editor
    // Line needed to call this function in game
    EXTERNAL playEmote(emoteName)
    VAR playerName = "SHROUDVARIABLE"
    VAR adventurerLevel = "SHROUDVARIABLE"
    VAR producerLevel = "SHROUDVARIABLE"
    VAR playTimeNumber = "SHROUDVARIABLE"
    VAR playTimeString = "SHROUDVARIABLE"
    VAR PVPFlagged = "SHROUDVARIABLE"
    VAR currentScene = "SHROUDVARIABLE"
    VAR NBPeriodOfDay = "SHROUDVARIABLE"
    VAR NBDayOfWeek = "SHROUDVARIABLE"
    VAR NBMonth = "SHROUDVARIABLE"
    VAR NBSeason = "SHROUDVARIABLE"
    VAR NBPhaseOfMoon = "SHROUDVARIABLE"
    VAR NBWeatherName = "SHROUDVARIABLE"
    VAR NBWindType = "SHROUDVARIABLE"
    VAR VirtueTruth = "SHROUDVARIABLE"
    VAR VirtueLove = "SHROUDVARIABLE"
    VAR VirtueCourage = "SHROUDVARIABLE"
    ->start
    ==start
    How may I assist you {playerName}?
    * Emote
    I will attempt to do the Bow Emote.
    ~ playEmote("Bow")
    ->start
    * Player Levels
    Currently {playerName} your Adventuring Level is {adventurerLevel} and your Producer Level is {producerLevel}.
    ->start
    * Play Time String
    Currently {playerName} you have existed in New Britannia for exactly {playTimeString}.
    ->start
    * Play Time Number
    The playTimeNumber inky function currently returns as {playTimeNumber}.
    ->start
    * PVP
    The PVPFlagged inky function currently returns as {PVPFlagged}.
    ->start
    * Scene
    You are currently residing within the {currentScene} area.
    ->start
    * Current Time Period
    The NBPeriodOfDay inky function currently returns as {NBPeriodOfDay}.
    ->start
    * Week Day
    The NBDayOfWeek inky function currently returns as {NBDayOfWeek}. 
    ->start
    * Month
    The NBMonth inky function currently returns as {NBMonth}. 
    ->start
    * Season
    The NBSeason inky function currently returns as {NBSeason}. 
    ->start
    * Moon Phase
    The NBPhaseOfMoon inky function currently returns as {NBPhaseOfMoon}. 
    ->start
    * Weather
    The NBWeatherName inky function currently returns as {NBWeatherName}. 
    ->start
    * Wind
    The NBWindType inky function currently returns as {NBWindType}. 
    ->start
    * Truth
    The VirtueTruth inky function currently returns as {VirtueTruth}. 
    ->start
    * Love
    The VirtueLove inky function currently returns as {VirtueLove}. 
    ->start
    * Courage
    The VirtueCourage inky function currently returns as {VirtueCourage}. 
    ->start
    * Done
    -> END
    // This code is needed to use the Inky editor
    === function playEmote(X) ===
    ~ return
    
    Just thought this simple example might be helpful for new people experimenting with these inky functions.
     
    Last edited: May 7, 2023
  2. Anpu

    Anpu Avatar

    Messages:
    7,944
    Likes Received:
    9,015
    Trophy Points:
    153
    Location:
    Hemut
    Updated code to version 2, this version WILL work in the Inky editor. My previous example broke the Inky editor and then you could not use it to preview the dialogue. Ooops :/
     
    that_shawn_guy likes this.
  3. ConjurerDragon

    ConjurerDragon Avatar

    Messages:
    1,698
    Likes Received:
    1,021
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Rhineland-Palatinate
    Just tried your script and it works fine on my Information conversationalist.
     
    Anpu likes this.