My First INK NPC Script attempt

Discussion in 'General Discussion' started by Aartemis, Nov 14, 2019.

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

    Aartemis Avatar

    Messages:
    1,377
    Likes Received:
    3,806
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Cleveland, Ohio
    Hey All,

    So I downloaded INK in preparation of the coming NPC scripting later this year. In less then about an hour or two I was quickly able to create a very basic script that could serve as an NPC Guard. I used my Bastion's Point guard as this example.

    The interface to write the script is easy to use and pretty intuitive. I used the Beginners Guide and made a few knots (i.e. conversation subroutines) and then built out from there. Before I knew it I was making deeper conversations, streamlining the script to use repeating conversation menus, and trying out some of the better commands and options.

    While there is no confirmed game hooks or anything like that yet for SOTA, these conversations are still a HUGE improvement over putting books, notes, and signs all around. Once we can use game tags like %name%, %virtue% or %skill% (examples, DLMB), or NPC emotes like SHRUG, SHIVER, BOW or THREATEN - these NPC's will really add some amazing flavor to our content.

    I think I'm really going to fall in love with player created content all over again! I think 2020 is going to be a big year for SOTA!

    [​IMG]
    [​IMG]

    I've included my BETA Script below. Feel free to Download it and play around with it yourself!


    Code:
    // Author: Aartemis D'turton of Sacrifice
    
    // Bastion's Point Guard - Dunman Kreig
    // Conversation Script - Version 1.0
    
    
    "Well Met Adventurer! Welcome to Bastion's Point. Keep your weapons sheathed and bound while in the village proper. No funny business if you know what i mean."
    
    -> ConvoStart
    
    === ConvoStart ===
    Dunman coolly eye's you curiously, not seeming too concerned yet looking for a response.
    
    + "Good Day to you as well, Sir. This is my first visit to your fair village, can you tell me about it?"
    -> BPInfo
    
    + "I seek the Marketplace for I am in need of wares and services."
    -> Marketplace
    
    + "Adventure is what I am seeking this day! Can you point me in the direction?"
    -> Adventure
    
    + "I don't think I am interested in any of those, Perhaps I'm done."
    -> Ending
    
    === BPInfo ===
    
    "Bastion's Point is Old World Village Governed by Trevour, Lord Aartemis & Lady Kaydrah and Sir Roland Deschain."
    
    "We pride ourselves on an immersive Old World layout and feel as opposed to the Mall format of many of Shroud's towns."
    
    Dunman clears his throat and straightens his tunic.
    
    "Not that there is anything wrong with that of course, we just prefer the later."
    -> AnymoreBP
    
    === AnymoreBP ===
    "What else would you like to know about Bastion's Point?"
    
    + Can I choose to settle here if I like?
    -> settle
    
    + I would like to know more about the Lore of Bastion's Point
    -> lore
    
    + I think I know enough about Bastion's Point.
    -> Anymore
    
    === settle ===
    
    The Town Crier has information on open lots within our village. He is located on the far dock near the ship with Red Sails.
    
    Dunman points over to the far docks area along the shore. It is visible from here.
    
    Any open lot will be labeled with AVAILABLE and you can get a helper icon to guide you to the actual lot location. From there you can claim the lot yourself.
    
    If you need assistance or custom lot placement, please contact Governor Trevour or Lord Aartemis.
    
    -> AnymoreBP
    
    === lore ===
    Dunman clear his throat.
    
    "I apologize that I cannot recount the story of Bastion's Point to you, for I must return to my duties. However, if you head to the Twisted Tankard Tavern, the tavern keeper Oakenshield can certainly give you all the information you need. In her younger days she was a bard of some renown. Still is if you get on her good side."
    
    Dunman winks and casts a curious smile, quickly followed with the straightening of his body and another clear of his throat.
    
    -> AnymoreBP
    
    === Adventure ===
    Dunman Nods.
    
    "Adventure you say?" Dunman's brow scowls as he contemplates your prowess.
    
    "I do not concern myself with rumors and hearsay, but you can certainly find plenty of that at the Twisted Tankard Tavern."
    
    "It's just down at the end of this stone bridge to the right. Can't miss it."
    
    Dunman extends his thumb and points it behind him over his back shoulder.
    
    -> Anymore
    
    === Marketplace ===
    Dunman Nods.
    
    "Aye, the Marketplace."
    
    Dunman turns and points behind him.
    
    "Continue your way behind me and head to the right just past the Twisted Tankard Tavern. Look for the Clock Tower and pass beyond that to the heart of the village proper and the Crafting Pavilion.
    
    The main Marketplace surrounds the Pavilion, however vendors sell their wares throughout the entire village."
    -> Anymore
    
    === Anymore ==
    Dunman shifts casually, Will that be all?
    
    + Aye, Thank you good Sir
    -> Ending
    + If I could ask you something else...
    -> ConvoStart
    
    
    === Ending ===
    "OK then, be on your way and conduct yourself accordingly, Avatar."
    
    -> END
    
    
     
    Last edited: Nov 14, 2019
  2. craftymethod

    craftymethod Avatar

    Messages:
    1,133
    Likes Received:
    2,001
    Trophy Points:
    113
  3. Aartemis

    Aartemis Avatar

    Messages:
    1,377
    Likes Received:
    3,806
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Cleveland, Ohio
    As SOTA begins to place in-game hooks, I can see the endless possibilities as well. Take for example a locked door or chest that can only be opened by the NPC. Likewise, an item "placed" in the NPC's Inventory that will only be given if the player reaches a certain point in the NPC's Dialog. The advanced INK dialog commands are really extensive. Story Based puzzles are made for a system like INK. When you tie that into game, you've created story based blockers for the quests and player content. Its so powerful. I know we wont get there overnight but what i'm seeing is certainly exciting! I can't wait to start scripting my quest, town and dungeon NPC's!
     
  4. Helverian

    Helverian Avatar

    Messages:
    73
    Likes Received:
    54
    Trophy Points:
    8
    I am only want to know how they save the state of a ink story and i also want to know if we can combine scripts for a story that needs many npcs...
     
    Paladin Michael and craftymethod like this.
  5. craftymethod

    craftymethod Avatar

    Messages:
    1,133
    Likes Received:
    2,001
    Trophy Points:
    113
    I wonder if there is a possibility for a custom dialogue answers to allow for existing text triggers. Ways to hide options or some kind of listen or wait for perhaps.
     
    Aartemis likes this.
  6. Aartemis

    Aartemis Avatar

    Messages:
    1,377
    Likes Received:
    3,806
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Cleveland, Ohio
    Yes, this will be interesting to see. Obviously using the give an item so the second NPC can see it and act on it is one way, but then they would really need to allow you to create unique QUEST items. I see this as probably the first implementation. I don't know if we are going to be able to combine INK with the Shroud text parser. INK doesn't seem to allow a free form text entry so something as easy as asking the "Women in the Woods" about "Carrots" without giving in your face the Carrot choice doesn't seem possible at first glance. Perhaps you can load multiple INK scripts on an NPC and invoke them on keyword?
     
    Helverian likes this.
  7. Aartemis

    Aartemis Avatar

    Messages:
    1,377
    Likes Received:
    3,806
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Cleveland, Ohio
    The key to rich player created content will be the combination of this power scripting and game hooks like locked doors, one way doors, secrets and other things that can't just be stumbled through. A quest isn't a quest without a blocker and other then a hard to kill monster room, player dungeons really have no way to stop players from just running through to the end. As these other tools get placed in the game, we should get a much more granular control over where that player can go until they solve part a or part b of the dungeon/quest.
     
    Helverian and craftymethod like this.
  8. Aartemis

    Aartemis Avatar

    Messages:
    1,377
    Likes Received:
    3,806
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Cleveland, Ohio
    Delving a bit deeper, you can use alternatives to mix up the conversation a bit so it doesn't get so repetitive and rigid:

    Code:
    === Anymore ==
    Dunman {~Nods|Shifts Casually|Stands at Attention|Scratches his chin}, Will that be all?
    
    + Aye, Thank you good Sir 
    -> Ending
    + If I could ask you something else...
    -> ConvoStart
    
    
    While the ~ chooses a random response from the list, the & denotes a cycle of responses that loop and a ! creates a once-only pass through then displays nothing.

    He told me a joke. {!I laughed politely.|I smiled.|I grimaced.|I promised myself to not react again.}

    Combined with a counter, this could be used to imply growing frustration with repeated questions and finally refusing to reply at all. This is an amazing bit of flexibility without detailed and repetitive coding.
     
  9. craftymethod

    craftymethod Avatar

    Messages:
    1,133
    Likes Received:
    2,001
    Trophy Points:
    113
    Where can you find all the commands Inky can handle?

    I wonder if we will be able to determine 1st encounter to play an intro knot, some flavor and story before setting into a "main menu" of sorts.
     
  10. Aartemis

    Aartemis Avatar

    Messages:
    1,377
    Likes Received:
    3,806
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Cleveland, Ohio
    The detailed USER GUIDE for ink is available HERE.

    A lot will rest upon the implementation. I heard Chris say much of the work and storage will be done on the client, so I have no clue how variables or flags would work outside the NPC instance when its locally run. Much of the limitation will be defined in how the NPC script can interact with the SOTA world outside its current instance bounds.
     
    Sol Stormlin, Jaesun and Helverian like this.
  11. Aartemis

    Aartemis Avatar

    Messages:
    1,377
    Likes Received:
    3,806
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Cleveland, Ohio
    I am starting to think about stateless quests that can still be blockers. The biggest issue I see is a a form of failure so someone cannot just choose Option 1, Option 2, Option 3 OH! Door open! Teleport to the Entrance, Make them fight again, IDK. Has to be something. That's the downfall with a multiple choice scripting system.
     
    Sol Stormlin likes this.
  12. Sketch_

    Sketch_ Avatar

    Messages:
    345
    Likes Received:
    618
    Trophy Points:
    43
    Gender:
    Male
    Yeah - *encounters NPC, sees highlighted text options, clicks until the door opens*
     
  13. Anpu

    Anpu Avatar

    Messages:
    7,944
    Likes Received:
    9,015
    Trophy Points:
    153
    Location:
    Hemut
    If there’s a function to check for the presence of a specific item, you can use that as a sort of save game to check the players progress.
     
    Daigoji Gai likes this.
  14. Aartemis

    Aartemis Avatar

    Messages:
    1,377
    Likes Received:
    3,806
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Cleveland, Ohio
    I am hoping that at minimum the functionality to create a QUEST Item and then have the NPC Request (and receive) that item is implemented. While I would like to see more options, at list with this standard quest functionality we can change state thru sessions or across boundaries: towns, other npc's, etc.

    I'm hoping I'm not minimizing the process, but a player should be able to create, a no value, not usable item that can have any form from the assets we have, and acceptable name terms. That item should then be able to be placed anywhere (find quests), given by NPC (deliver) or whatnot.
     
    Jaesun and craftymethod like this.
  15. Rowell

    Rowell Avatar

    Messages:
    612
    Likes Received:
    1,281
    Trophy Points:
    105
    Gender:
    Female
    Location:
    Brittany Fields
    I hope they're going to add some NPC slots in Dungeons (like they allow NPC's in basements). That way, I can have fallen adventurer to give quests in the dungeon, or lost adventurer to have the player find and lead out of the dungeon type quests. And maybe a merchant near the dungeon entrance to buy your found goods and sell supplies.
     
    Aartemis and craftymethod like this.
  16. Daigoji Gai

    Daigoji Gai Avatar

    Messages:
    484
    Likes Received:
    978
    Trophy Points:
    55
    Gender:
    Male
    Location:
    NYC & CT
    This is really darn fantastic.
     
    Aartemis likes this.
  17. Daxxe Diggler

    Daxxe Diggler Avatar

    Messages:
    2,692
    Likes Received:
    5,711
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Virtue Oasis - Hidden Vale
    I was checking out the INKY program myself the past couple days and just trying to get a feel for how it works. I also had concerns that the "multiple choice" format could lead to someone just clicking through every option without actually reading anything to get to the "end".

    Then it hit me! You don't actually have to make it so that the player picks the one correct answer and the riddle is solved. You can simply just have the NPC gives clues or hints about what is needed to move on via the conversation thread, and then have the player find the "key" object based on the clues the NPC gives you. Perhaps the simplest way to do that part is to hide a public access container with the "key" in it... maybe put a chest in the bottom of a pool or put it in a desk drawer in the office or put it in a secret compartment in a specific book in the library... etc.

    The "key" could just be a written note that says you found the key or something similar until we are able to create actual items. Or maybe the "key" is a rusty spoon or anything else that you could creatively link to the storyline.

    Then, the player would have to return back to the NPC and turn in the "key" that they found to unlock the door or treasure or simply offer up directions on which NPC to speak to next (or which item they are looking for next).

    Or, maybe the task is not to find something and bring it back... perhaps the task is to pull a correct lever somewhere in the dungeon that unlocks a door to the next stage?

    As long as Chris is able to hook in the requirement of having a specified item in inventory or interacting with a specific object in order to proceed... the possibilities are endless!

    This ability would/could also allow for multiple NPC involvement because we could have each one give the player a "reward" (or just give you clues on where to find a "key") that the next NPC would need to see in inventory before talking to you about the next stage of the quest. This would even let us link up dungeons from different players that coordinate together to get something from one dungeon and then bring it to the next. Maybe the "final room" that you have to unlock in one person's dungeon only contains a portal to another person's dungeon? Or better yet, have 2 different portals in the final room and have clues hidden throughout the dungeon that help you make the "right" choice of portal!

    To sum up my point... progression doesn't need to be controlled by clicking all the keywords in the dialogue until you find the right one... if we use the NPC's dialogue (through INKY) to direct the player on what they need to do or find to "unlock" the progression instead. In fact, I'd imagine that you could script the NPC dialogue to NOT allow a player to go back and make another conversation choice in some situations (ie. script it so that if they choose response x then no longer respond to choices y or z). Might be a good idea to warn people if your NPC doesn't have time to answer all of your questions though. ;)
     
    Jaesun, Aartemis and craftymethod like this.
  18. Aartemis

    Aartemis Avatar

    Messages:
    1,377
    Likes Received:
    3,806
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Cleveland, Ohio
    Correct!

    I was thinking about how it can bridge the gap between in-game content and NPC Dialog. For things like puzzles, you can do things like hide answers or hints within player made books, and then rather then leaving them on an IN YOUR FACE pedestal like we have to do now - we can connect to them via conversation.

    "Lord Dunther was an eccentric man whose thoughts were as puzzling as his decor, however he did keep a journal in his office - perhaps it might shed some light... if you could find it." Then, putting the book inside the small desk in the office, would not be such a stretch for a player to find once they have the NPC clue. Then further reading the book to find the next needed clue.

    While I am sure this will bring snarls from some players who will say "What! I actually have to READ something instead of just putting down 10 Rings of Fire? This is dumb!" I think there will be a great many players who do appreciate the good old puzzle quests.

    However this does go hand in hand with dungeon blockers like locked doors, secret doors, all those sort of things. But consider this: Certainly a secret dungeon door is easy to find to those of us that know what to look for but what if it was hidden behind the 3rd of 6 bookshelf's full of books? Magically the PUBLIC Flag can be used to allow players to move that single bookcase and find the secret entrance that would normally have never been seen. This would probably be too hard of a puzzle on its own, but combined with multiple clues - now we have something really cool!

    Make a note: Might need a RESET DECOR on Reload flag for the dungeons. :)
     
    Daxxe Diggler likes this.
  19. craftymethod

    craftymethod Avatar

    Messages:
    1,133
    Likes Received:
    2,001
    Trophy Points:
    113
    Something that might be easiest to implement is an item in game that would be considered an "intranet" of global town criers.

    it seems you can load inky files, I wonder if we can all write some stuff for each of our towns like a description and places to see and visit, even player quests and compartmentalise that and when we run the device, we can choose from a list or be shown one of these randomly.
     
  20. Beaumaris

    Beaumaris Avatar

    Messages:
    4,289
    Likes Received:
    7,415
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Caladruin
    Ink seems quite powerful. I just wonder if Catnip has the bandwidth to police the player-created content to keep it reasonably rated.
     
Thread Status:
Not open for further replies.