New Library: ActionContext

Howdy ya’ll, this post is to let you all know I released a handy little library recently: ActionContext. It’s an object-oriented way of using Roblox’s ContextActionService and alleviates a good amount of boilerplate code you’d find surrounding BindAction/UnbindAction calls. Rather than re-hash the documentation, I’ll just leave a quick bit of example code here.

local honkAction = {
    ActionName = "Honk",
    Inputs = { Enum.KeyCode.H, Enum.KeyCode.ButtonY },
    Handle = function (userInputState, inputObject)
        if userInputState == Enum.UserInputState.Begin then
            sound:Play()
        end
    end,
}
local actionContext = ActionContext.new({ honkAction })
-- Entering and leaving the car:
actionContext:Enter()
actionContext:Leave()
Continue reading “New Library: ActionContext”

Your Code Sucks: Improving Your Roblox Lua Coding Habits

You might have picked up one of these terrible coding habits when learning Roblox Lua. Let’s address that, shall we?

Listen… we gotta talk. You’ve got some really bad habits when it comes to scripting on Roblox. You clearly grew a lot since your days as a novice. You’ve been around the block enough times to know when it’s time to move past old habits and grow as a developer. Now’s the time to start improving your Roblox code.

OK, maybe not all of that first paragraph is completely true, but that bit about growing as a developer might interest you a whole ton. In this post, let’s talk about what you can do to clean up your coding habits.

A word of caution: this “advice” (if we’re calling it that) isn’t for the absolute novice. If you’re really-really new, just focus on making things work first and foremost. That’s more important. For the rest of you, let’s get into it!

Continue reading “Your Code Sucks: Improving Your Roblox Lua Coding Habits”

The Binder Pattern

Let’s learn about Binders, a useful pattern that links CollectionService and OOP.

In this post, I’m featuring the Binder pattern, its uses, and reasons you should start using them in your Roblox projects.

A binder connects a CollectionService tag on Instance with an object in Lua code. When a tag is applied to an Instance, an object is constructed from a class with this Instance. During its lifetime, the object might read from various attributes on the instance to modify how it behaves. Finally, if the tag or entire Instance is removed, the object is cleaned up or destroyed accordingly.

For the purposes of this article, I’ll be using this implementation (I recommend you keep this open while reading).

Continue reading “The Binder Pattern”

Shift Lock for Roblox on Mobile Devices

Add support for mouse lock (aka shift lock) for games on Roblox’s mobile app by adding this resource to your game/experience.

I made a handy resource for Roblox developers to support “Mouse Lock” (aka “Shift Lock”) mode in their games for mobile players!

Also consider getting the Model from the Roblox website so it’s available in Studio’s toolbox and on your Roblox account!

Continue reading “Shift Lock for Roblox on Mobile Devices”

ParticleEmitter:Emit(n) Version 2 is now available!

A quality-of-life update to this particle-emission plugin from 2015 is now available: attributes, better onboarding, passive update notifications, bug fixes and more.

It’s all freshened up for the modern-day Roblox developer! This simple yet useful plugin got some love in its version 2 release.

  • Now uses the EmitCount attribute, so emitters can burst different amounts of particles
  • A new on-boarding experience and update notifications
  • …and so much more. Check out the full post, or install it right now!
Continue reading “ParticleEmitter:Emit(n) Version 2 is now available!”

Check out my new Internet face!

Felt like my Internet presence needed a fresh new look! Behold.

The image is a render of my Roblox avatar, with a white outline, blue background and a hint of a radial rainbow. I’m sporting the Vision Française glasses, the original Red Bow Tie, and my very own Ozzy’s Formal Top Hat which you can snag by using a code from my Roblox toy!

Continue reading “Check out my new Internet face!”

Here are my goals to make 2021 amazing

Apparently, I have a bit of a thing for living under a rock! The whole year of 2020 has really proven that I’m far too good at doing that. No surprise that the previous dreadful year did a number on my motivation to work on things. Although we may not be out of the woods with the pandemic yet, there’s a handful of things I’d like to cover regarding the state of my projects. In particular, here’s what I hope to accomplish in 2021 so this year turns out exceedingly excellent.

Continue reading “Here are my goals to make 2021 amazing”

Introducing: Modules

The logo for Modules
A fancy logo for Modules I came up with

It’s my pleasure to announce Modules, a simple dependency loader for Roblox!

Modules comes with goodies, too: Event , Maid  and StateMachine  classes just to name a few. These patterns are so commonplace in Roblox development today, they felt right at home to be included.

With Modules, you can require strings instead of ModuleScripts. This greatly simplifies your scripts’ dependencies and streamlines creation of client and server code.

local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Modules"))
local MyModule = require("MyNamespace:MyModule")

Download: Model on Roblox.com, GitHub releases
Links:
Documentation, Repository on GitHub

Continue reading “Introducing: Modules”

Fix: RBXL files don’t open Roblox Studio properly

Hey all, I fixed this issue the other day. It took a little know-how, so I figured I’d write about it here in case anyone else ran into this. Hello to anyone from Google or the great beyond.

The Problem: Opening RBXL files in Windows Explorer starts Roblox Studio, but fails to actually open the RBXL file. (May also happen with RBXLX files, the XML counterpart to the binary RBXL files)

Continue reading “Fix: RBXL files don’t open Roblox Studio properly”