Katalina549 Posted December 27, 2015 Share Posted December 27, 2015 I decided to play a little RoG today after playing way too much shipwrecked, and lo and behold! Somehow SW is screwing with RoG a little. Koalaphants no longer run away when I approach them, either while awake or sleeping. This does take some of the difficulty out of killing them, but I'm actually against that. That's what made them a fun challenge, worth all that tasty meat. Does this have something to do with whales? Apologies if this has been addressed already. I think I remember someone else complaining about it, but I couldn't find the post with the search function. Thanks again, Capy and Klei, for making a wonderful game and for listening to your players and being prompt with fixes! Link to comment Share on other sites More sharing options...
Talavaj Posted December 27, 2015 Share Posted December 27, 2015 It makes it impossible to farm easy manure tho, not that it matters really.As far as killing, it does make the first few Koalefants less annoying I suppose. A couple of weeks in you should be able to always have an Ice Staff anyway. Link to comment Share on other sites More sharing options...
hyiltiz Posted December 29, 2015 Share Posted December 29, 2015 How could one DLC interfere with another? Playing RoG, Shipwrecked files are not even loaded. Link to comment Share on other sites More sharing options...
Katalina549 Posted December 29, 2015 Author Share Posted December 29, 2015 How could one DLC interfere with another? Playing RoG, Shipwrecked files are not even loaded. I have no idea how it happened, I only know that now that I have SW, koalaphants will just stand there and let me hit them. Even if I run directly into them, they don't run away. Link to comment Share on other sites More sharing options...
TemporaryMan Posted December 29, 2015 Share Posted December 29, 2015 Yeah, I've seen this too. Got a koalefant too close to my tooth traps and I can't chase it away. Link to comment Share on other sites More sharing options...
TMJJack Posted December 29, 2015 Share Posted December 29, 2015 Yeah, I've had the same issue. Well, it hasn't really been an issue: saves me a few boomerangs, but it's good to make this known. Link to comment Share on other sites More sharing options...
GuyPerfect Posted December 29, 2015 Share Posted December 29, 2015 How could one DLC interfere with another? Playing RoG, Shipwrecked files are not even loaded.A fair amount of Shipwrecked was actually applied to the base game. Even if you uninstall any DLCs, Koalefants will stay put when approached, so this is a bug in Don't Starve that happened to coincide with Shipwrecked--possibly the latest update. The culprit is in scripts/behaviours/runaway.lua, line 59. It's part of an if-elseif-else block with the following contents: if type(self.hunterparams) == "string" then self.hunter = FindEntity(self.inst, self.see_dist, nil, {self.hunterparams}, {'notarget'} ) elseif type(self.hunterparams) == "function" then self.hunter = self.hunterparams(self.inst) else self.hunter = FindEntity(self.inst, self.see_dist, self.hunterparams) endNormally this wouldn't be too helpful, but we have the Don't Starve Together version of this script to compare with: if type(self.hunterparams) == "string" then self.hunter = FindEntity(self.inst, self.see_dist, nil, {self.hunterparams}, {'notarget'} ) else self.hunter = FindEntity(self.inst, self.see_dist, self.hunterparams) endSee that extra "elseif" clause in there? That's what's causing the problem. If you comment out lines 59 and 60, Koalefants run away again. So what's that doing, exactly? scripts/brains/koalefantbrain.lua passes a function called ShouldRunAway to its brain constructor, which in this file is the "self.hunterparams" field. The old way of checking nearby entities would pass this function into FindEntity, which ran it on the list of nearby entities to determine whether it qualified. The new way, with that elseif in there, explicitly checks for a function and uses it to directly determine who it is it should be running away from. Thing is, ShouldRunAway doesn't return an entity like the RunAway bahavior expects, but rather returns true or false because it was designed to work as a parameter to FindEntity. It's always being called with the Koalefant itself as the entity to check, which of course means it always returns false because it's very difficult to run away from oneself. I don't know why that elseif clause was added to runaway.lua, but I don't recommend commenting it out because it will probably break something else. I have some errands to run, but when I get back, I'll post a quick hack for koalefantbrain.lua that should at least fix this particular problem in the short-term. Link to comment Share on other sites More sharing options...
GuyPerfect Posted December 29, 2015 Share Posted December 29, 2015 Okay, I have a fix for the Koalefant's fearlessness now.Within scripts/brains/koalefantbrain.lua, you'll find this on line 28: local function ShouldRunAway(guy) return guy:HasTag("character") and not guy:HasTag("notarget")endOnce again, the reason this breaks is because scripts/behaviors/runaway.lua was changed in such a way that it executes this function expecting an entity as the return value, whereas it's currently returning a boolean. Instead, we can work around the problem by having this function do what the old version of runaway.lua did, only locally. This should prevent whatever else this was implemented for from breaking. Replace the function in koalefantbrain.lua with the following:local function ShouldRunAway(inst) return FindEntity(inst, RUN_AWAY_DIST, function(guy) return guy:HasTag("character") and not guy:HasTag("notarget") end)endNow Koalefants will again avoid the player. Link to comment Share on other sites More sharing options...
Katalina549 Posted December 30, 2015 Author Share Posted December 30, 2015 Okay, I have a fix for the Koalefant's fearlessness now. Wow! Thanks for all the useful info! Unfortunately I am not confident enough in my coding ability to make these changes myself, but hopefully your info will help someone else with the same problem! I'll just keep killing koalaphants in cold blood until the devs patch it. Link to comment Share on other sites More sharing options...
Flare2V Posted December 30, 2015 Share Posted December 30, 2015 BUG or GAME MECHANIC? Link to comment Share on other sites More sharing options...
rezecib Posted December 30, 2015 Share Posted December 30, 2015 A more minor bug than this, I also noticed that the world generation strings that are appropriate for Shipwrecked also got applied to non-Shipwrecked world generation screens (e.g. generating vast oceans). Link to comment Share on other sites More sharing options...
przemolsz Posted December 30, 2015 Share Posted December 30, 2015 BUG or GAME MECHANIC?Definitely a bug. Link to comment Share on other sites More sharing options...
hyiltiz Posted December 31, 2015 Share Posted December 31, 2015 Nice catch! And ever nicer patch! Link to comment Share on other sites More sharing options...
jeffhartley3925 Posted January 6, 2016 Share Posted January 6, 2016 Isn't it possible that this change in behavior is purposeful? It may not be a bug. It may be balancing. Link to comment Share on other sites More sharing options...
GuyPerfect Posted January 6, 2016 Share Posted January 6, 2016 Isn't it possible that this change in behavior is purposeful? No. No, it isn't. Re-read yonder post for information on what happened. Link to comment Share on other sites More sharing options...
GuyPerfect Posted January 9, 2016 Share Posted January 9, 2016 I was grep'ing my way through the files and found that Floaty Boaty Knight has this same bug, so I decided a more general fix was in order. Patching RunAway so that it detects whether its hunterparams fields returns a boolean on execute, then wrapping around it with a function that calls FindEntity, will fix this problem in a broader sense. scripts/behaviours/runaway.lua, bottom of the file:-- Run-once wrapper method to intercept misconfigured hunterparams functionslocal Visit = RunAway.Visitfunction RunAway:Visit() -- Check whether hunterparams() returns a boolean local hp = self.hunterparams if type(hp) == "function" and type(hp(self.inst)) == "boolean" then -- Wrapper function to make hunterparams() return an entity self.hunterparams = function() return FindEntity(self.inst, self.see_dist, hp) end end -- Restore original Visit method self.Visit = Visit self:Visit()end Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.