Don't Starve Together

Don't Starve Together

Geometric Placement
asgerrr 3 May, 2024 @ 7:59am
Crash when attempting to place a sprinkler (Island Adventures - Hamlet)
The mod has code to replace the place test function of the Hamlet sprinkler with a more efficient one, presumably left over from the solo DS version of the mod. This would normally not be a problem, but I happen to be working on porting Hamlet as part of Island Adventures, and this custom place test causes my game to crash. All that would need to be done to fix this is to remove the sprinklerPlaceTestFn function in modmain.lua alongside the code that uses it in PlacerPostInit.

[00:10:21]: [string "../mods/workshop-351325790/modmain.lua"]:1141: attempt to call method 'IsWater' (a nil value)
LUA ERROR stack traceback:
../mods/workshop-351325790/modmain.lua:1141 in (field) placeTestFn (Lua) <1134-1158>
inst = 119157 - sprinkler_placer (valid:true)
pt = (893.00, 0.00, 226.00)
map = Map (0x7fad25bdf9d0)
cx = 550
cy = 383
center_tile = 273
../mods/workshop-351325790/modmain.lua:506 in (method) TestPoint (Lua) <504-507>
self =
cursor_quantity_visible = true
targetPos = (893.00, 0.00, 226.00)
disabled = false
build_grid_positions = table: 0x7fadc41511c0
cursor_visible = true
lastpt = (893.00, 0.00, 226.00)
rowbounds = table: 0x7fadc54a6cc0
recipe = table: 0x7fad5f821910
hide_inv_icon = true
linked = table: 0x7fad47729d60
refresh_queue = table: 0x7fadc4151210
onground = true
testfn = function - scripts/components/playercontroller.lua:1306
OnUpdate = function - ../mods/workshop-2302837868/modmain.lua:221
gridinst = 119174 - buildgridplacer (valid:true)
offset = 1
BOAT_MUST_TAGS = table: 0x7fadc6ebb580
inst = 119157 - sprinkler_placer (valid:true)
col_offset = (0.50, 0.00, 0.00)
builder = 100052 - wilson (valid:true)
build_grid = table: 0x7fadc4151170
placertype = buildgridplacer
tileinst = 119633 - gridplacer (valid:true)
origin_offset = (0.00, 0.00, 0.00)
placeTestFn = function - ../mods/workshop-351325790/modmain.lua:1134
row_offset = (0.00, 0.00, 0.50)
grid_size = 10
can_build = true
radius = 1
geometry = table: 0x7fad5fe75900
ToLatticeCoords = function - ../mods/workshop-351325790/modmain.lua:391
inst = 119157 - sprinkler_placer (valid:true)
pt = (893.00, 0.00, 226.00)
../mods/workshop-351325790/modmain.lua:945 in (upvalue) PlacerOnUpdate (Lua) <699-1129>
self =
cursor_quantity_visible = true
targetPos = (893.00, 0.00, 226.00)
disabled = false
build_grid_positions = table: 0x7fadc41511c0
cursor_visible = true
lastpt = (893.00, 0.00, 226.00)
rowbounds = table: 0x7fadc54a6cc0
recipe = table: 0x7fad5f821910
hide_inv_icon = true
linked = table: 0x7fad47729d60
refresh_queue = table: 0x7fadc4151210
onground = true
testfn = function - scripts/components/playercontroller.lua:1306
OnUpdate = function - ../mods/workshop-2302837868/modmain.lua:221
gridinst = 119174 - buildgridplacer (valid:true)
offset = 1
BOAT_MUST_TAGS = table: 0x7fadc6ebb580
inst = 119157 - sprinkler_placer (valid:true)
col_offset = (0.50, 0.00, 0.00)
builder = 100052 - wilson (valid:true)
build_grid = table: 0x7fadc4151170
placertype = buildgridplacer
tileinst = 119633 - gridplacer (valid:true)
origin_offset = (0.00, 0.00, 0.00)
placeTestFn = function - ../mods/workshop-351325790/modmain.lua:1134
row_offset = (0.00, 0.00, 0.50)
grid_size = 10
can_build = true
radius = 1
geometry = table: 0x7fad5fe75900
ToLatticeCoords = function - ../mods/workshop-351325790/modmain.lua:391
dt = 0.016720337793231
body_start = 586.337306
TheWorld = 100043 - world (valid:true)
ctrl_disable = false
disabled_place_test = false
pt = (893.00, 0.00, 226.00)
ThePlayer = 100052 - wilson (valid:true)
../mods/workshop-2873533916/modmain.lua:232 in (upvalue) original_OnUpdate (Lua) <230-233>
self =
cursor_quantity_visible = true
targetPos = (893.00, 0.00, 226.00)
disabled = false
build_grid_positions = table: 0x7fadc41511c0
cursor_visible = true
lastpt = (893.00, 0.00, 226.00)
rowbounds = table: 0x7fadc54a6cc0
recipe = table: 0x7fad5f821910
hide_inv_icon = true
linked = table: 0x7fad47729d60
refresh_queue = table: 0x7fadc4151210
onground = true
testfn = function - scripts/components/playercontroller.lua:1306
OnUpdate = function - ../mods/workshop-2302837868/modmain.lu
[00:10:21]: [string "../mods/workshop-351325790/modmain.lua"]:1141: attempt to call method 'IsWater' (a nil value)
LUA ERROR stack traceback:
../mods/workshop-351325790/modmain.lua:1141 in (field) placeTestFn (Lua) <1134-1158>
../mods/workshop-351325790/modmain.lua:506 in (method) TestPoint (Lua) <504-507>
../mods/workshop-351325790/modmain.lua:945 in (upvalue) PlacerOnUpdate (Lua) <699-1129>
../mods/workshop-2873533916/modmain.lua:232 in (upvalue) original_OnUpdate (Lua) <230-233>
../mods/workshop-2302837868/modmain.lua:222 in (method) OnUpdate (Lua) <221-232>
scripts/components/placer.lua:213 in (method) OnWallUpdate (Lua) <212-214>
scripts/update.lua:58 in () ? (Lua) <33-138>