This is the IssuesAreMinor devlog because I’m bored and way too ambitious.
Day 1:
What I’ve done:
I’m mostly starting with game mechanics to make sure that everything works before it looks good. Despite that, I wanted to make sure that avatars were blocky, so I added this simple script into StarterCharacterScripts:
for i = 1, 5, 1 do
local unblockified = script.Parent:WaitForChild("CharacterMesh")
unblockified:Destroy()
wait()
end
script:Destroy()
This is the current foundation of weapons in my game:
Trigger:
-- Services
local cas = game:GetService("ContextActionService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local chara = player.Character or player.CharacterAdded:Wait() -- Chara from Innertail?! :0 :O :o
local humanoid = chara:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local itemList = require(game.ReplicatedStorage.BaseWeaponProperties)
local ACTION_BASIC_ATTACK = "Basic Attack"
-- Equipped/swinging or not
local tool = script.Parent
local finishSwing = false
local comboCount = 1
local function handleAction(actionName, inputState, _inputObject)
if script.CooldownValue.Value == 0 then
if actionName == ACTION_BASIC_ATTACK and inputState == Enum.UserInputState.Begin then
if finishSwing == false then
print(comboCount)
local swingAnim = Instance.new("Animation")
if comboCount == 1 then
swingAnim.AnimationId = "rbxassetid://18652765616"
elseif comboCount == 2 then
swingAnim.AnimationId = "rbxassetid://18652917464"
end
local animTrack = animator:LoadAnimation(swingAnim)
animTrack:Play()
finishSwing = true
task.wait(itemList.Data.BasicSword.baseAttackDuration)
finishSwing = false
comboCount += 1
if comboCount > itemList.Data.BasicSword.comboLength then
comboCount = 1
end
-- final checks
local checked = false
if comboCount == 1 and checked == false then
while script.CooldownValue.Value < itemList.Data.BasicSword.baseCooldown do
script.CooldownValue.TimerTick:FireServer()
wait(.1)
end
script.CooldownValue.TimerTick:FireServer()
end
end
end
end
end
tool.Equipped:Connect(function()
cas:BindAction(ACTION_BASIC_ATTACK, handleAction, false, Enum.UserInputType.MouseButton1)
end)
tool.Unequipped:Connect(function()
cas:UnbindAction(ACTION_BASIC_ATTACK)
end)
It binds an action to left click, plays an animation when I use the action, makes a combo, and adds a cooldown at the end of a combo.
Timer:
local cd = script.Parent
local ticks = cd.TimerTick
local itemList = require(game.ReplicatedStorage.BaseWeaponProperties)
local function increase()
print("Fired")
if cd.Value < itemList.Data.BasicSword.baseCooldown then
cd.Value += .1
elseif cd.Value >= itemList.Data.BasicSword.baseCooldown then
cd.Value = 0
end
end
ticks.OnServerEvent:Connect(increase)
It increases CooldownValue’s value by .1 every time it runs and sets it to zero if it overflows. Since it registers as slightly lower when you run it, causing it to not reset, I make the code fire it an extra time so that it always resets.
BaseWeaponProperties:
local Weapons = {}
Weapons.Data = {
["BasicSword"] = {
["baseDamage"] = 10,
["comboLength"] = 2,
["baseAttackDuration"] = .8,
["baseCooldown"] = 1,
["statusApplied"] = nil,
["UniqueAttacksUsed"] = nil
},
}
return Weapons
A table of all the weapon properties, pretty self-explanatory.
What I plan on doing / Help that I need:
-
Implement a combo cancel (help needed): Every other attack is the combo finisher, which isn’t intended. A combo is supposed to cancel when you take too long to continue it, so if anyone knows how I could reasonably fix it, that would be appreciated.
-
Make attacks do damage, knockback, stuns, and not allow for movement (not started yet): I decided to make my combat sort of like Deepwoken’s in terms of weapons, but it’ll be easier because I’m not going to make a game that I’ll suck at (skill issue moment). The main reason for the decision was because of running attacks since I would need to redo some animation. I can just make the player move a little forward in whatever direction they’re facing instead of moving freely with more Deepwoken style M1 combat.
-
Work on lore: This is private for now, but I might reveal some to people who help me with my code.
I should not be posting my entire source code publicly but if anyone is stealing my shitty code then they’re more stupid than I am.