Game
Hensen Hopper
3 months ago

Alright! Got that message system put together!


The message hub script itself looks a lot more complicated than it actually is. I'll explain how it works:

image.png

To put it to words, any script can send a message to the message hub by calling Messages.Send to be saved for the remainder of the frame in a C# List. All a List is, by the way, is a script in the C# standard library that enhances arrays by allowing you to add/remove items from an array during runtime, they're useful in cases where you do not know how big an array will need to be.

Since Lists are typically a lot larger than an array of their count (among a few other reasons I made this decision) rather than having the list be the primary source from which messages are read, at the end of the frame, all messages stored in the list are copied to an array of "recieved" messages that may be read during the next frame update via the value returned by Messages. Read (sorry for the space, Game Jolt was auto-link-ifying that for some reason) and the list is deleted and a brand new one created for the next frame.

This is a lot better for my quest system than what I had before because now, rather than messages being sent directly to the quest manager (which I disliked as it creates a dependency between potentially many scripts and the quest manager), any script can just send messages into the wind and that information may or may not be utilized by other scripts. The only weakness this system has is other scripts aren't technically reading messages sent during the same frame but the ones sent during the PREVIOUS frame (because the list is copied over in the LateUpdate method). Granted, for the purposes of the quest manager, this doesn't particularly matter.

image.png

The quest manager itself is relatively unchanged, I simply replaced the ReportAction method with the code shown in the screenshot above. On Start we create a dictionary mapping whatever messages are relavent to todays quests to integers in order to keep track locally of how many times a quest-relevant message has been recieved by the message hub, this information is updated once per frame.

This is a much cleaner way to handle the quest event reporting than the previous approach because now, rather than every enemy script sending messages directly to the quest manager, whenever a soldier enemy is defeated, a message reading "defeated_soldier" is sent to the message hub and it, of course, matters not to the message hub whether this information is utlized because it does it's thing either way.

Whenever there IS a quest manager in the scene, this message will, of course, mean something as the quest manager will read the messages from the message hub and use this information for it's purposes. Say the user has a quest to defeat a certain number of soldiers, then this message will be checked by the quest manager and the value paired to it there is incremented every time the message is found in the array returned by Messages. Read.



0 comments

Loading...

Next up

Oh yeah, also, I updated that algorithm for dash handling I shared yesterday so I can set the dash duration via the inspector window!

I made some updates to the hints system! Now it reads from the message hub to determine when to show hints and the hint texts now come from the lang system I wrote yesterday. This simplified my the hints handling algorithm A LOT from what it used to be!

AAAAAAA! The spider is coming along!!! I'm actually quite proud of the way this turned out! I'm planning to take a break for a bit but I am ALSO gonna add some more idle movements to the spider and then apply some drop shadows and it'll look a ton better.

Doki Doki Literature Club is celebrating Monika's birthday and the 8th anniversary of DDLC with exclusive stickers, avatar frames and backgrounds on Game Jolt! 

Head over to the shop to collect yours 👉 https://gamejolt.com/#shop

Been working on the artwork for the spider enemy!!! This is a preview of what it'll look like in-game. I am gonna remove all of these drop shadows as I usually apply those to the spritesheets themselves once I've drawn the animations.

Mae Borowski is the main character of Night in the Woods! It's an adventure game that tells the story of her return to her hometown of Possum Springs. She was confirmed as canonically pan in a social media post by the game's creator Scott Benson.

Okay so I've effectively phased out the profile selection menu, or, well, TECHNICALLY not. The profiles system is still there, it's just invisible now. There is only one profile that's either created or loaded on game start. No more profile choosing.

Officially gotten started with the spider!!!!!!!!

The Knightling launches on August 28! Wishlist it now so you don't miss out: https://bit.ly/KnightlingSteam

To celebrate the game's impending release, we've added The Knightling Pack and The Knightling Community Pack back to the Shop!

Merry Christmas everyone!!!

Oh yeah, this is all I have properly added in the latest build haha.