Jump to content

Recommended Posts

I have a barebones template, and then :

 

local function WatchPhase(inst, phase)if phase == "summer" then        inst.AnimState:SetBuild("speksum")    endif phase == "winter" then        inst.AnimState:SetBuild("spekwin")    endif phase == "spring" then        inst.AnimState:SetBuild("spekspr")    endif phase == "autumn" then        inst.AnimState:SetBuild("spek")    endend

And followed by :

local function master_postinit(inst)    inst:ListenForEvent("phase",WatchPhase,TheWorld)

Simply put, character appearance should change with season, it's not.

 

I made the change, and it still doesn't appear to be making a difference.

 

Any other thoughts?

 

Based on Woodie's code it should only be the following:

local function WatchPhase( inst, phase )    if phase == "summer" then        inst.AnimState:SetBuild("speksum")    elseif phase == "winter" then        inst.AnimState:SetBuild("spekwin")    elseif phase == "spring" then        inst.AnimState:SetBuild("spekspr")    else        inst.AnimState:SetBuild("spek")    endendlocal master_postinit( inst )    inst:WatchWorldState("phase", WatchPhase )    WatchPhase( inst, TheWorld.state.phase )end

@Nyogtha, sorry about that, phase is the current phase of the day not phase of the year.

 

You're wanting to watch 'season' not 'phase':

local function WatchSeason( inst, season )    if season == "summer" then        inst.AnimState:SetBuild("speksum")    elseif season == "winter" then        inst.AnimState:SetBuild("spekwin")    elseif season == "spring" then        inst.AnimState:SetBuild("spekspr")    else        inst.AnimState:SetBuild("spek")    endendlocal function master_postinit(inst)    inst:WatchWorldState("season", WatchSeason )    WatchSeason( inst, TheWorld.state.season )end

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...