Nyogtha Posted November 28, 2015 Share Posted November 28, 2015 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") endendAnd followed by :local function master_postinit(inst) inst:ListenForEvent("phase",WatchPhase,TheWorld)Simply put, character appearance should change with season, it's not. Link to comment https://forums.kleientertainment.com/forums/topic/59518-broken-code-seasonal-appearance-change-not-functioning/ Share on other sites More sharing options...
Kzisor Posted November 28, 2015 Share Posted November 28, 2015 @Nyogtha, ListenForEvent should be WatchWorldState. Link to comment https://forums.kleientertainment.com/forums/topic/59518-broken-code-seasonal-appearance-change-not-functioning/#findComment-689265 Share on other sites More sharing options...
Nyogtha Posted November 29, 2015 Author Share Posted November 29, 2015 @Nyogtha, ListenForEvent should be WatchWorldState. I made the change, and it still doesn't appear to be making a difference. Any other thoughts? Link to comment https://forums.kleientertainment.com/forums/topic/59518-broken-code-seasonal-appearance-change-not-functioning/#findComment-689320 Share on other sites More sharing options...
Kzisor Posted November 29, 2015 Share Posted November 29, 2015 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 Link to comment https://forums.kleientertainment.com/forums/topic/59518-broken-code-seasonal-appearance-change-not-functioning/#findComment-689337 Share on other sites More sharing options...
Nyogtha Posted November 29, 2015 Author Share Posted November 29, 2015 Hate to ask it, but could you take a look at the character? I just feel like I'm bashing my head against a wall here. Spekkle.zip Link to comment https://forums.kleientertainment.com/forums/topic/59518-broken-code-seasonal-appearance-change-not-functioning/#findComment-689449 Share on other sites More sharing options...
Kzisor Posted November 29, 2015 Share Posted November 29, 2015 @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 Link to comment https://forums.kleientertainment.com/forums/topic/59518-broken-code-seasonal-appearance-change-not-functioning/#findComment-689497 Share on other sites More sharing options...
Nyogtha Posted November 29, 2015 Author Share Posted November 29, 2015 Thank you Kzisor, you're a saint! <3 Finally got it working! Link to comment https://forums.kleientertainment.com/forums/topic/59518-broken-code-seasonal-appearance-change-not-functioning/#findComment-689533 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now