Jump to content

[Character Mod] Haunter the Spooky Spectre


Recommended Posts

Haunter, the spooky spectre! This lets you play as the Pokemon Haunter in Don't Starve Together.

 

Steam workshop link

5RKctaV.png

jAev1EI.png

 

More images

Health 90
Hunger 110
Sanity 230

Incorporeal - Avoids half of incoming attack damage
Likes night, hates day
Has no body!

Haunter's incorporeal ability always halves incoming combat damage. Additionally, Haunter floats above the ground, and doesn't have any movement speed changes due to terrain.

Haunter has sanity drain during day and dusk, and sanity gain at night. Spend the night in complete darkness to supercharge sanity, but don't get spooked by the Night Monster!

Haunter has no body. This means it can't wear any item that goes on the body. No backpacks, no armor, no amulets, and no weather gear!

In "ghost" form, Haunter becomes Gastly.

I don't quite have this one done yet. I'd like to remove the footstep sound effect in an update. 

Let me know what you think!

 

I have two issues currently. The first is that movement is jumpy for the client. While the host doesn't have movement speed change due to roads or spider creep, client will speed up and get knocked backwards every 2 seconds or so. I only have 3 lines of code in haunter.lua for this:

inst:AddComponent("locomotor")inst.components.locomotor:EnableGroundSpeedMultiplier(false)inst.components.locomotor:SetTriggersCreep(false)

The second I listed up higher; I don't want the footstep sound effect when moving. I think I'm missing just a few lines of code for this one. Here's what I have in modmain.lua

local states = {	State {		name = "haunter_run_start",		tags = {"moving", "running", "canrotate"},		onenter = function(inst)			inst.components.locomotor:RunForward()			inst.AnimState:PlayAnimation("run_pre")		end,		events = {   			EventHandler("animover", function(inst)				inst.sg:GoToState("haunter_run")			end)       		},		timeline = {					}	},    State {		name = "haunter_run",		tags = {"moving", "running", "canrotate"},		onenter = function(inst) 			inst.components.locomotor:RunForward()			inst.AnimState:PlayAnimation("run_loop")		end,		timeline = {					},		events = {   			EventHandler("animover", function(inst)				inst.sg:GoToState("haunter_run")			end)  		}	},	State {		name = "haunter_run_stop",		tags = {"canrotate", "idle"},		onenter = function(inst) 			inst.Physics:Stop()			inst.AnimState:PlayAnimation("run_pst")		end,		events = {   			EventHandler("animover", function(inst) 				inst.sg:GoToState("idle") 			end),        		},	},	}AddStategraphPostInit("wilson_client", "haunter_run_start")AddStategraphPostInit("wilson_client", "haunter_run")AddStategraphPostInit("wilson_client", "haunter_run_stop")local events ={    EventHandler("locomote", function(inst)        if inst.sg:HasStateTag("busy") or inst:HasTag("busy") then            return        end        local is_moving = inst.sg:HasStateTag("moving")        local should_move = inst.components.locomotor:WantsToMoveForward()        if inst:HasTag("sleeping") then            if should_move and not inst.sg:HasStateTag("waking") then                inst.sg:GoToState("wakeup")            end        elseif not inst.entity:CanPredictMovement() then            if not inst.sg:HasStateTag("idle") then                inst.sg:GoToState("idle")            end        elseif is_moving and not should_move then			if inst.prefab == "haunter" then				inst.sg:GoToState("haunter_run_stop")			else				inst.sg:GoToState("run_stop")			end        elseif not is_moving and should_move then			if inst.prefab == "haunter" then				inst.sg:GoToState("haunter_run_start")			else				inst.sg:GoToState("run_start")			end        end    end),}
Edited by StarmanUltra
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...