Jump to content

Recommended Posts

I'm making a character mod and I want to make her a special form when it's a full moon.

My character takes care of these ghosts called The Lost. The Lost are beings who died twice. They live in constant agony and rely on my character to take care of them. I'm thinking of putting them into my mod but maybe not, I don't want people to play a character who's always getting bugged by these little ghost things all the time. During a full moon, The Lost gains full power. I want the lost to haunt my character when it's a full moon turning her into a monster. I want the monster to have:
ATK: 55
SPEED: 3
Ability to break rocks

It's a mechanic based off of Woodie.. Thing is...…. I have no Idea how to do this. I have the idea in my head and how it will work, but idk how to do it. I'm not experienced with code AT ALL. I don't know anything about it. 
I want to make it even if it means copying some of Woodie's code. It just seems like a cool idea.
If anyone can help me or give me some tips THANK YOU SO MUCH!

If im correct you just want a little boost for your character at fullmoon. Here what i use for my char.

this one is for character appereance change you can pass this if you don't want to change your characters look.

local ischaractername_normal = true
local ischaractername_fullmoon = false

local function character_normal(inst)

inst.AnimState:SetBuild("charactername")

local ischaractername_normal = true
local ischaractername_fullmoon = false

end

local function character_fullmoon(inst)

inst.AnimState:SetBuild("charactername_fullmoon") -- the file you want to use for look change.

local ischaractername_normal = false
local ischaractername_fullmoon = true

end
local function FullmoonBoost(inst)
  if TheWorld.state.isnight then
    if TheWorld.state.moonphase == "full" then
      inst.components.locomotor.walkspeed = 3
      inst.components.locomotor.runspeed = 3 -- you can change numbers as you like
      
      character_fulmoon(inst)
    end
   end
end

local function TurnToNormal(inst)
  if TheWorld.state.isnight or TheWorld.state.isday or TheWorld.state.isdusk then --- im not sure about dusk
    if not TheWorld.state.moonphase == "full" then
      
            inst.components.locomotor.walkspeed = 3
      		inst.components.locomotor.runspeed = 3 -- normal vaules
      
      character_normal(inst)
    end
    end
 end

im not sure about "if not" part would work or not if it does not. use it like the night/day one. lemme know if there is any problem

  • Like 1
On 11/13/2021 at 11:20 AM, AkaiNight said:

If im correct you just want a little boost for your character at fullmoon. Here what i use for my char.

this one is for character appereance change you can pass this if you don't want to change your characters look.


local ischaractername_normal = true
local ischaractername_fullmoon = false

local function character_normal(inst)

inst.AnimState:SetBuild("charactername")

local ischaractername_normal = true
local ischaractername_fullmoon = false

end

local function character_fullmoon(inst)

inst.AnimState:SetBuild("charactername_fullmoon") -- the file you want to use for look change.

local ischaractername_normal = false
local ischaractername_fullmoon = true

end

local function FullmoonBoost(inst)
  if TheWorld.state.isnight then
    if TheWorld.state.moonphase == "full" then
      inst.components.locomotor.walkspeed = 3
      inst.components.locomotor.runspeed = 3 -- you can change numbers as you like
      
      character_fulmoon(inst)
    end
   end
end

local function TurnToNormal(inst)
  if TheWorld.state.isnight or TheWorld.state.isday or TheWorld.state.isdusk then --- im not sure about dusk
    if not TheWorld.state.moonphase == "full" then
      
            inst.components.locomotor.walkspeed = 3
      		inst.components.locomotor.runspeed = 3 -- normal vaules
      
      character_normal(inst)
    end
    end
 end

im not sure about "if not" part would work or not if it does not. use it like the night/day one. lemme know if there is any problem

Sooo... since I'm trying to do a similar thing, where would I put this code in? I have no knowledge of lua either...

somewhere in your character.lua be sure that its not under master_postinit or something like it. and put this

	inst:WatchWorldState("isday", FullmoonBoost)
	inst:WatchWorldState("isnight", FullmoonBoost)
	inst:WatchWorldState("moonphase", FullmoonBoost)

under master_postinit. If you couldn't figure it send me your mod file

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
×
  • Create New...