If you’re here from Dev Log #12, there welcome! This is basically some code I use to make NPC’s display different dialogue. Keeping the barkeep theme, I will be using “Kaleem”.
Like other barkeeps, you can ask Kaleem for a room, which is where you save.

I already explained some of the commands in my last dev log- so I won’t be explaining them here. However- I will explain the fundamentals.
Essentially here- $roomkaleem is a variable that tells the code whether you have asked Kaleem for a room prior to talking with her. If $roomkaleem is 0, it means this is the first time you are talking to her, and will display something like this:

After asking Kaleem, you will be brought into the save room:

However, what you don’t see in this screen is the fact that it sets $roomkaleem to 1, which is basically means that you have asked her for a room at least once. Now, if you were to ask Kaleem for a room again (ie. you want to save again). she will say this:

As you can see- Kaleem greets you again after you’ve used the room. I believe this adds to character- as they actually acknowledge that you are coming back, and not just display a stock “Oh hey, you wanna save?”. It gives them a lot more character, and I think that’s the most important part. You also learn more about their personalities, and some of their mannerism’s come out. (yes- Kaleem is Canadian)
This mechanic appears throughout the game, such that let’s say you go back to a main character without their quest item, they give you dialogue. However! Unlike the barkeeps who will display the same text after you save for the 3rd, 4th, nth time, main characters will display a series of random dialogue chosen out of a pool.
It works similar to what I used for the barkeeps (and others), except I make a variable that randomizes itself, and then set’s it back to 0/1, so it can be randomized again.
Leave a Reply
You must be logged in to post a comment.