In-Game Chat System (Gadget)

Wow, another guide on chat systems, what other way is this guy going to make it?

Well, I am making another guide on this that’s for sure, but this one will solve the problem we all have been facing. Free chat.

Introduction

Free chat is where you can manually type in letters to create your own sentences. This is different from Quick Chat, where you can only use predetermined messages for communication. There are already some solutions, such as the keyboard guides, but they limit actions such as running and evading. This means you can’t risk chatting if you have an enemy on your tail. My system, should be (slightly) efficient and also allow you to talk while typing.

Anyways, since the image purge, I decided that along with code images, I’ll also add a pre-formatted code just to be safe. I would encourage others to add this just as a fail-safe to their guides. But you don’t have to follow, this is just my suggestion.

The System

So, what is the idea that I have?

GADGET COMMUNICATION

You all know about the lifecycle, and how there’s a tiny event that listens when we fire a gadget. What if we had letters, give them a number value, and update a property based on how many times we fire? Basically, if I wanted to type the letter A which has been given a number value of 1. I’d fire the gadget, have the counter updated, and I would input A. With a series of other letters, we can make sentences!

Materials

Life-cycle
3x Overlay (set all to button)
Counter
3x Triggers
Properties
Notification/Pop-up
Gadget


Naming the Properties

Ok, so just stating properties in materials isn’t very helpful. I was inspired by Slim to immediately name all the properties so here goes.

  • currentTextTyping:
    This is to be updated by the counter, and will be used for identifying letters. This is a number property.
  • sentenceCreation:
    This is where we will input the letters to create our sentence. This is a text property.
  • letters:
    This just holds all the letters of the alphabet. We’ll use our currentTextTyping to find the index value of the letter we want and then input it into the display. This is a text property.

The System

This system is actually very easy. The hardest part is the block code, and there is only like 10 or 12 blocks in it. That said, let’s start.


Overlays

You will need a whopping of 2 overlays. Make sure they are placed in different areas. Have one named Input Next Letter? and another say enter?. Set both their scopes to player. Have the Enter Overlay broadcast on Enter when clicked. Have the other overlay wired to a trigger. Button Clicked → Activated Trigger. We’ll get back to the trigger later.


Counter

Grab a counter and a life-cycle. Have the life-cycle listen to the event of when a gadget is fired. When the event is fulfilled, have it broadcast on increaseCounter. Likewise, have the counter be incremented on increaseCounter. Make sure the counter updates the currentTextTyping property. Also have the counter reset on nextLetter


Block Code And Notfication

Ok, remember that trigger you wired with the overlay?
Here’s some Blockcode.

And here’s the pre-formatted version.

Set Property: sentenceCreation
Value: create text with: in text [get property: letters] get letter#
                       [get property: currentTextTyping]
Broadcast Message On Channel: "nextLetter"

Now who am I without explaining my code? [1] Basically, we use the currentTextTyping property as the index value to find our letter in the letters property. For example, if we wanted to type the number a, which has an index of 1. We’d blast 1 time updating the currentTextTyping property and use that to update the letter a into the sentenceCreation. We also save this with the precious so that more letters can be added over time. We then broadcast on nextLetter, which resets the counter so we can start with a new letter.

Now grab a notification or a pop-up and add block-code that activates on the channel enter and add this block-code.

Pre-formatted version:

Send Notificatiion:
Title: create text with: Item 1- Triggering Player's Name
                         Item 2- " wrote"
Content: Get Property: sentenceCreation

Don’t panic if you don’t see the ‘create text with’. That is a mistake and a waste of block space. It still works. Basically, this will just grab your sentence and notify everyone.


Backspace

Grab an overlay and wire it to a trigger. The only thing you have to do to the overlay is have it’s text set to Backspace. Have this in the trigger code.

The pre-formatted text is this.

Set Property: "sentenceCreation"
Value: in Text: Get PRoperty: "sentenceCreation
                get substring from first letter
                to letter#: [length of-Get Property-"sentenceCreation" (-1)]

Basically, we’re grabbing the length of the sentenceCreation and removing it’s last letter. So if I have the word DOG, this will grab the property and set it to the same except the last letter, hence DO. Anyways, here’s your backspace button.
Are We Finished?

Absolutely not, there is still more to add such as

  • Inputting Numbers
  • Clearing the sentenceCreation property when we hit enter, which is pretty easy as with the notification we can set the property to a space after sending the notification.
  • Probably more that I’ll think of later.

Will this be Extremely Impactful?

I think it might be helpful, but not extremely new. The keyboard guides work perfectly well, so I don’t see how this will change free-chat. I say this because this does have a downside, for example, memory. And I’m not talking about storage memory, I’m talking about YOUR memory. If you can immediately identify which letter is 1st, 2nd, 3rd and so on in the alphabet, it should be easy for you to do this. However, this might be a slower approach to those who need to count their fingers if the letter I is the 9th letter of the alphabet. I had to count my fingers to tell you that.. Anyways, I still hope this might be helpful. Stay curious, and King of Dragons logging out!

Difficulty
  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
0 voters

  1. Ok, the pre-formatted is different from the image, this is because I don’t have the motivation to add a new screenshot as of now, so I just changed the pre-format for now. ↩︎

11 Likes

that a lot of words, must mean it a good guide
edit: guide was very simga and good, i wonder if my ELA teacher will count this as my daily reading

5 Likes

Wow thanks for the guide! I haven’t seen a lot of guides like this

3 Likes

awesome sus
this could be very useful in one of my gimkit games!

WHAT.
Wow, Toothless.
I’ve tried to do this tens of thousands of times.
It is slightly inefficient, but it is good.
Question: How much memory does this take, and is it worth it to put it in your map?

I think somewhere around 1% memory
but it could be lower

1 Like

Wow, that’s crazy.

I’m actually going to change it a bit. I have a theory that if it works, I can remove those 26 properties.

1 Like

Neat system!
However, couldn’t you use one property with the whole alphabet and then use the
get letter # [ ] from text [ ] block?


On my end we liked each other’s posts in perfect sync :skull:

2 Likes

That’s exactly what I was thinking!

2 Likes

Ok, I’ve updated the pre-format text but not the screenshot. But now the property problem has been eradicated. This takes only 3 properties to work now I think.

Edit: Backspace button has been added!

1 Like

Great guide Toothless!

1 Like