https://steamcommunity.com/sharedfiles/filedetails/?id=3325205627
Make waterstone turn toxic sludge into water
That's it
27 messages · Page 1 of 1 (latest)
https://steamcommunity.com/sharedfiles/filedetails/?id=3325205627
Make waterstone turn toxic sludge into water
That's it
17 lines of init.lua, lmao
---@type nxml
local nxml = dofile_once("mods/BetterVuoksikivi/nxml.lua")
local vuoksikivi = "data/entities/items/pickup/waterstone.xml"
local xml = nxml.parse(ModTextFileGetContent(vuoksikivi))
local new_child = nxml.new_element("MagicConvertMaterialComponent", {
_tags="enabled_in_world,enabled_in_hand",
kill_when_finished="1",
from_material="",
from_material_tag="[radioactive]",
steps_per_frame="2",
to_material="water",
clean_stains="0",
is_circle="1",
radius="64" ,
loop="1",
})
xml:add_child(new_child)
ModTextFileSetContent(vuoksikivi, tostring(xml))
that's the whole mod
woah! nice!
bruh bringing the entire nxml into it lul thinking about it, it is way easier.. if only the api included something like nxml; but technically it makes it way more than 17 lines
i mean, Nathan would kill me if i did it through strmanip
a tiny little little gsub is not scary tho
HEH
it will break if another mod edits it
LMAO
bruh nope?.
like editing the text with nxml is different from editing the text with gsub only in that nxml is more convenient
I guess you meant that stupid gsubs will be incompatible, which is fair enough, and nxml helps avoid that
but something like "insert text before closing tag of some xml" should be fine lul
no it won't, what if its </ blah or < /blah or </blah
nxml will understand these, gsub wont
I mean if you want to cover "what if someone will change the specific closing tag format of this vanilla xml i'm editing" then you can write a pattern that handles that, so technically gsub will work
but nxml (in some form) should be included in the game regardless
I guess covering that case is prudent, cuz who knows what people will do lul
well nxml will automatically use correct xml formatting
and nolla often just.... doesn't
nah I was just memeing when I said the entire nxml
yeah nxml is obv superior, although I dislike that every mod ever ships it
although again, not like people install hundreds of mods and even then it is tiny anyway, meh
||I actually rewrote nxml in rust lul||
!!
nxml could be extracted into a dependency mod, given i don't intend to make any breaking changes (unless nxml parses some xml wrongly)
nxml will only get new functions + increases in correctness
don't think i will change the existing functions input / output