M1dnight's Ultimate Guide to Building Effective NPCs

Introduction

Hello once again, Gimkit. It’s been a while, to say the least. I haven’t been on the guides since November! Crazy to think time flies by so fast. I’ve mostly been working on myself and projects like Beansite (https://beansite.vercel.app).

This was a project idea I actually had back in November, but never got around to making it. Here is a list of the features I want to include:

  • Dialog Progression (like if you talk to him twice he will say something different)
  • Randomized Dialog
  • Actions

Let’s get started!

Making the NPC

There aren’t many ways of designing an NPC in gimkit. I would have loved to use gims, so I tried sentries, but they would attack you. I tried disabling them, but that hides them entirely.

I settled on using props since it just works. For my example, I made a comically large ladybug with a cone hat. His name is Jimmy, just for the example.
image
While you’re at it, place down a button with any message you want. Mine is "Interact with Jimmy", but yours can be anything.

The Coding

This is a little more advanced, so I will be using block code. For those who don’t know what Block Code is, is like scratch on gimkit. You can add blocks to add functionality to modals and triggers.

Properties

Get started by placing a new property. It will be a number property named dialog#1. I named it this because it indicates it’s for dialog, shows that it’s for a number, and specifies the NPC # (which is 1 for Jimmy).

The Modal

Place down a new popup. You can find these in the devices category by searching for them. Set it to your destined style. Mine will be a modal. Make sure the title and description are blank, and you will see why later.

To add our block code, let’s go to the "Blocks" category on the left side of the screen.
We will first add a script that runs on a wire pulse, and hook up our popup to the button we placed earlier. Also, add a channel to your button, so when it is pressed, it transmits on the channel jimmy:showMessage and makes our popup open when transmitted on this. In our on wire pulse script, write this code. It will vary between people. You can tweak the chance so there is more than one dialog and add more dialog options easily. It’s modular in a way.
This is what the script looks like:


I used a greater than one at the end so when the property reaches way more than the max, it will still say the last dialog.

Extras

Actions

To add an action, we can go to the popup "Call to Actions" tab and set up a “Leave Conversation” and action button. Due to gimkits limitations, we can’t change this with block code, but we can still make useful buttons. For example, my first call to action is a stop-talking button. It just sends a channel that the popup hides the popup on. The second one sends a message on the channel jimmy:giveApple. Our boy Jimmy likes apples. Now in the block code section, add a new script that runs on when that channel is pinged, and add whatever code you want. Triggering a quest works, or just a simple message. Here’s mine of Jimmy thanking you for the apple:
image

Final Results

Here’s what it should look like:
image

Conclusion

Thanks for reading this guide. It took me like an hour to write.
~M1dnight Out

6 Likes

thanks for the guild and good job adding pictures I will be sure to look at this later :slight_smile:

4 Likes

removed ideas that is only for Help topics
more pics please
please note that there are already guides on this

1 Like

awesome guide! i loooove jimmy

3 Likes

Hey @M1dnight did you know you can make the setires on your team, so they are not hostile? anyways, AWESOME GUIDE!

2 Likes

Also, LOVE JIMMY!
(i have a character named jiminy, pronuoced JI-MI-NEE)

1 Like

This guide is very different, and extremely detailed tho…

1 Like

noice, but is it possible to concatenate those blocks?

Nice guide
@M1dnight

This is a nice guide, and I adore Jimmy :lady_beetle: :heart_eyes:
This is so good and cute!
Maybe not tug tho?

2 Likes

this is awesome!! a previous comments already said this, but you can actually make sentries peaceful. stillhelpful tho, ill keep this in mind!!

1 Like

wait, how do u do that. this is literally what I wanted to do

all you have to do is enter the sentries settings, scroll to where it says sentry team, and change it to team 1

1 Like

yes, or whatever team the players are on.

1 Like

Wow, nice guide! I like the use of pictures!

BTW hi guys im back!!!

1 Like

You can put an invisible barrier slightly smaller than the sentry on it and it won’t shoot at you

1 Like

There are two ways to not have a sentry shoot you.

  1. Have them on the same team as the player
  2. Disable inventory slots
1 Like

thanks for the advice, ill make an edit tomorrow since its late at night for me