Don't Starve

Don't Starve

Replace PigGuard Torches [abandoned]
64 Comments
J.C. Menton 19 Dec, 2024 @ 3:19am 
damn... sounds hellish. i didnt know.
Kain Morgen  [author] 15 Dec, 2024 @ 3:13pm 
@J.C. Menton:
The correct way to do this Mod would be to write AddComponentPostInit functions which effect only the pig guards, whose code is a fraction of citypigbrain.lua and pigman_city.lua

I couldn't figure out how to in reasonable time, so instead my quick and dirty workaround was to Always copy the latest versions of those files, add the Same changes and replace those original files as a whole.

This means any official game update to pigs or pig cities would be rollbacked by this mod in the best case or might cause crashes worst case until I copied the latest files again, reapplied my changes and reuploaded the latest Mod version.
=> Too much hassle for me in the long run.
Especially since Hamlet was still in active development at the initial release of this Mod.
And don't get me started about incompatibilities with other mods changing pig behaviour or pig city logic.
J.C. Menton 5 Dec, 2024 @ 1:01pm 
question. how much does a code change? my only modding experience that i have is payday 2 and minecraft. i have no idea how this works at the slightest. Thats why abandoning a mod seems sureal to me. (i still respect your choice i am just curious)
Guide_The_Guide 3 Sep, 2023 @ 8:27pm 
I still love this idea, but I"ll have to learn a lot about lua files to try to mod this myself. I wish that Klei had officially done this as I think it's a brilliant idea!
Kain Morgen  [author] 27 Oct, 2020 @ 1:11pm 
@tengsiti: Please check the meaning of the word 'abandoned'.

I don't update this mod any more.
If other modders pick this mod up an update and improve it then I am ok with that.
伯乐快递 先马后寄 27 Oct, 2020 @ 4:35am 
I can't use it. it cause the game to crash.
珍珍 10 Apr, 2020 @ 3:34am 
it is useless to my DLC or it break down some times:steamsad:
TroglodyteHogwash 21 Apr, 2019 @ 6:37am 
Mabe it would be more practical to replace torches with morningglories/ nightsticks.
FreyaMaluk 10 Apr, 2019 @ 4:53pm 
@Kain Morgen if you are not supporting the mod pls add an "[Abandoned]" indication at the end of the mod's title... Maybe another modder would fix it and take care of future updates
Kain Morgen  [author] 20 Mar, 2019 @ 8:25am 
@-=bd=- : That is because this mod replaces the whole file of pigvillage, etc. with a modified older version of those files. At this time there was no tinker shop, so that is missing then. I could just get the new file and copy paste the changes, but then again every time something new is added, this mod will crash again.

I dont have the time to fix this now and probably just dont want to do so later because priorities.

There is another mod that makes pig guard torches not burn stuff called 'Pig Guard Fire Safety'. Use this instead. I mean, you wont get the amazing candlehats from pig guards, but otherwise it does mostly the same.

Or feel free, to dig into the code and fix all of the conceptual bugs yourself if you can and then upload the fix into the workshop. I would appreciate that.
-=bd=- 19 Mar, 2019 @ 7:36pm 
If you enter the tinker’s tower (the new shop added to the pig queen island) with this mod enabled, the game will crash.
fusion 25 Dec, 2018 @ 6:46am 
When i summon my dear tentacles in pigs‘s town,there lies many many many many many many many many many many many many many corkhat ,and some infinite torch。Oh no 。。I just want they always attack me or bat with their COOL AXE , not anything more。TAT
󰀐505987655󰀐 22 Dec, 2018 @ 3:33pm 
At present, this mod can not be compatible with SW, because pigs in SW and ROG will not be equipped with props. I think it is necessary to change the torch attack damage of a guard pig into a Tomahawk attack injury. So the guard pig is still equipped with the torch, but it will not ignite the building, and it can also be compatible with SW and ROG.
Kain Morgen  [author] 22 Dec, 2018 @ 10:13am 
@Hyxaru: Thank you, that is a very good find.
The code indeed generates a new candlehat every evening.
I tried to find candlehats in their inventory and equip those, if there is none found, then a new one is generated. But apparently the part trying to find the candlehat doesnt work.
Likewise I had troubles to find particular items (especially torches) and delete those from their inventory.

The sad thing about DST is that the existing functions are not commented/documented so often you have to guess a bit what exactly it will do and just try it.

Unfortunately I absolutely do not have the time to dig into this right now and I don't expect this to change within the next two months.
If you want to you can try to fix this issue yourself and if you find a solution I will gladly update.
Hyxaru 22 Dec, 2018 @ 9:51am 
Okay I can confirm their inventory is filles to the brim with corkhats. They can’t pick up anything else in their inventory anymore because of this. Like I drop an oinc in front of them and they hilariously juggle with it as it keeps getting edjected from their full inventory.
They seem to generate a new corkhat every day. When I started this Hamlet world, I used a skywortht to get in it from SW. Result was that the daycount was already 60+, so I think its why nobody had mentioned it before, as their worlds aren’t that old.
Hyxaru 22 Dec, 2018 @ 6:54am 
This mod has one (big) issue that I found. The pig guards seem to get a new hat every evening, which is good considering it has durability. I don’t know exactly how, but for some reason torchhats pile up infront of the guard tower. Perhaps their inventory piles up with torchhats, causing them to drop all new ones.
󰀐505987655󰀐 20 Dec, 2018 @ 10:28am 
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/stategraph.lua:360 in (method) StartAction (Lua) <347-367>
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/entityscript.lua:1106 in (method) PushBufferedAction (Lua) <1064-1111>
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/components/locomotor.lua:800 in (method) OnUpdate (Lua) <740-976>
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/update.lua:157 in () ? (Lua) <90-191>
󰀐505987655󰀐 20 Dec, 2018 @ 10:27am 
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/stategraphs/SGpig_city.lua:262 in (field) onenter (Lua) <261-265>
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/stategraph.lua:431 in (method) GoToState (Lua) <390-441>
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/../mods/workshop-1566480214/scripts/prefabs/pigman_city.lua:1050 in (field) special_action (Lua) <1049-1051>
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/actions.lua:175 in (field) fn (Lua) <173-178>
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/bufferedaction.lua:21 in (method) Do (Lua) <18-33>
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/entityscript.lua:1123 in (method) PerformBufferedAction (Lua) <1114-1134>
󰀐505987655󰀐 20 Dec, 2018 @ 10:27am 
scripts/mainfunctions.lua(936,1) LUA ERROR stack traceback:
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(936,1)
[08:16:13]: scripts/mainfunctions.lua(937,1) .../workshop-1566480214/scripts/prefabs/pigman_city.lua:109: calling 'SetPosition' on bad self (number expected, got nil)
LUA ERROR stack traceback:
=[C]:-1 in (method) SetPosition (C) <-1--1>
E:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/../mods/workshop-1566480214/scripts/prefabs/pigman_city.lua:109 in (field) separatedesk (Lua) <98-115>
爱在西元前 20 Dec, 2018 @ 6:38am 
a good mod
FreyaMaluk 12 Dec, 2018 @ 5:36pm 
@Kain Morgen i love this mod... for real .. really good job :)
however, I think candle hats as drops are OP, specially early game. Could you add some config options so they actually drop torches instead for the people who would like it a bit more balanced pls?
Kain Morgen  [author] 6 Dec, 2018 @ 3:41am 
@w000t: You could probably build the tower at daytime. Even if the guard spawns without a candlehat, it should be given a new one after about one day if it has no candlehat at a given time in the daycycle.
僕の名前 (仮) 5 Dec, 2018 @ 10:45pm 
There's bug, when I build my own tower, pig is without candle hat.
ArcyPaweł 3 Dec, 2018 @ 8:39am 
this mod make game harder:steamfacepalm:
Watershine 25 Nov, 2018 @ 11:12am 
大稽霸: Don't know where your problem is, i used it with a new world and it works good for me, didn't run into any trouble so far. 「(゚ペ)

@Kain Morgen: I like the Mod! It's such a Quality of Life improvement. Dungeon Raiding day and night finally makes sense, no more burnt loot, no more burnt jungles, the torches were really really bugging me. Thumbs up!
Kain Morgen  [author] 25 Nov, 2018 @ 6:20am 
大稽霸: You are welcome to do it better. If you can, that is.
最萌恶龙咆哮 25 Nov, 2018 @ 12:45am 
nice!!!!!! Like it:steamhappy:
声音并不是很大 25 Nov, 2018 @ 12:12am 
66666Nice man
大稽霸 24 Nov, 2018 @ 11:14pm 
your thought was good but the mod is noob need repair
Honey Fried Tofu 24 Nov, 2018 @ 7:58pm 
Me likey
-Aino- 23 Nov, 2018 @ 11:25pm 
I support this
Lbird 23 Nov, 2018 @ 6:24pm 
@德玛西亚牌辣条 看来你也没弃坑WG啊:steamsalty:
瓜子 22 Nov, 2018 @ 9:24pm 
nice:steamhappy:
德玛西亚牌辣条 22 Nov, 2018 @ 8:51pm 
Excuse me, can I move your work to Tencent Platform(Wegame)?Because this MOD is so good.I beg your permission very much.Thanks
Dozell 22 Nov, 2018 @ 2:34pm 
this should have been in the base hamlet XD
СֳƷ 21 Nov, 2018 @ 10:06pm 
lol I LOVE IT xD
Killer Goblin 21 Nov, 2018 @ 5:41pm 
Well, I ended up starting a new world with the mod enabled, and it works as intended. I guess for now it's something just to be done with a new world, rather than added after a world has begun.

Anyway, thanks for replying.
BreadEnjoyer 21 Nov, 2018 @ 5:29pm 
Same as below, enabled the mod on an existing world, and now guards are carrying torches all the time. Disabling the mod doesnt fix this :/
Kain Morgen  [author] 21 Nov, 2018 @ 3:29pm 
I'll try to fix issues that occur if this mod is not enabled within a world all of the time. But it may take a few days as I am busy with other stuff, too. Thanks for your patience.
Killer Goblin 21 Nov, 2018 @ 9:49am 
A glitch has popped up in my game, the pig guards are now carrying torches all the time, and are without a hat of any kind at night.
哒哒 21 Nov, 2018 @ 7:57am 
优秀
射杀太刀之日 20 Nov, 2018 @ 6:54pm 
my farm would never on fire at night,thanks
BeastFriday 20 Nov, 2018 @ 11:16am 
OMG What the smart mind!
Kain Morgen  [author] 20 Nov, 2018 @ 7:23am 
Thinking about it: I always started my worlds with this mod already enabled.
If you enable this mod in an existing world, then the pig guards will already have been given a torch to their inventory, which then has to be either normalized or deleted.

Can you tell me if you enabled this mod to an older pre-existing world?
Kain Morgen  [author] 20 Nov, 2018 @ 7:05am 
@Kim Jan Woo
Thanks for the report. By Royal Guard do you mean all guards in the 2nd pig city or only special guards in the palace which may appear if you attack a villager there?

I would try to fix this (by either normalizing torches again, or by replacing their torches, too) but more input would be great so I dont have to replicate everything.
artichoke 20 Nov, 2018 @ 6:22am 
the royal guards will drop a 100% torch and it will never be run out.....
NIU 20 Nov, 2018 @ 5:06am 
ur genius~~~~~~
梧吾 20 Nov, 2018 @ 4:53am 
超越官方系列:steamhappy:
Xiaoma 20 Nov, 2018 @ 4:39am 
thank god,awsome mod,love you
Chump 19 Nov, 2018 @ 8:30pm 
这个想法有点天才啊