Barotrauma

Barotrauma

Lua Component
18 Comments
Matheus 27 Sep, 2023 @ 7:06am 
Since this one is obsolete, please also consider using MicroLua
zomgtehderpy  [author] 1 Apr, 2023 @ 10:13pm 
with the release of a Better Lua Component , this one should be considered a proof-of-concept and not used unless you are a masochist.
zomgtehderpy  [author] 29 Mar, 2023 @ 12:27pm 
@Derpino I am pretty sure indexes go from 1 to 8, not 0 to 7.
Derpino 13 Mar, 2023 @ 11:54am 
I can't get this mod to work for some reason with even with a super simple script "out[0]=9001".

I have lua for barotrauma installed and get some other dependent mods to work...:steamsad:
Maddremor 7 Jan, 2023 @ 6:12am 
I don't know how useful this will be, but I'm still having memory leaks with this in MP.
zomgtehderpy  [author] 21 Oct, 2022 @ 6:43am 
4096 is a soft cap and can be increased exactly as you said. i remember reading somewhere that too much data in memory component might negatively affect game performance, so there's that. minimizing code could be a slightly better idea.
testing for mp should be pretty simple: first 3 lines from sample code, push button, text display, couple of wires; start a round, click the button, end the round, start the next one (output should retain), all the while checking for consistency among all clients. i coudve test it myself but i hab no frens :c
NeckRopeMancer 20 Oct, 2022 @ 12:09pm 
Has anyone tested this in MP (as the author says they have not)?
|SPQR| Vetinarix 5 Aug, 2022 @ 7:03pm 
Excellent news - cheers.
Will let you know if it's not :)
zomgtehderpy  [author] 4 Aug, 2022 @ 12:30am 
@Vetinarix incompatibility is highly unlikely.
all potential leaks should be fixed now with brand new storage method and other fixes.
please update your designs and check for errors.
|SPQR| Vetinarix 2 Aug, 2022 @ 11:57pm 
Worth pointing out, it may have been the math I was doing in the lua component itself, although admittedly it wasn't too complex.
|SPQR| Vetinarix 2 Aug, 2022 @ 11:35pm 
Hey,
I've noticed a memory leak occurring when running this mod both locally and on server, and the leak effects player clients connected to the server as well.

I am running the lua component mod with other mods, but have iterated through variations of the pack until I determined that the lua component mod is the cause of the leak.

At first I thought it might be a compatibility issue with other mods...
(list of mods I'm running: https://pastebin.com/81MPRbfw)

But I've also tested running Baro with ONLY lua component, and the memory leak is still present.
When lua component is removed, the memory leak is no longer present.

Not sure how to trace the issue further unfortunately, but hoping you're able to reproduce and resolve it :)
zomgtehderpy  [author] 25 Jun, 2022 @ 2:22am 
"error pcall in" means there's something wrong happened when actually executing your code, may as well be indexing a nil value.
i[k] should be "" (empty string) when no signal received on k.
if you would share your design i can test it and see what could be done for better error handling.

just realized it wasn't the best idea to hardcode inputs as "i" as it's too easy to accidentally overwrite it.
anyways this mod needs and will soon get a rewrite (unfortunately breaking old setups at least partially)
Katte 25 Jun, 2022 @ 12:30am 
Could you make it so that requesting a value from an input pin that isnt receiving a signal defaults to null and not an error?
Katte 24 Jun, 2022 @ 11:50pm 
ah so it would appear i am stupid and didnt properly install the lua mod.

I have another issue though: linking a text display to certain of my LUA modules outputs "error pcall in" and im not sure what that means
Katte 24 Jun, 2022 @ 11:25pm 
This mod appears to be broken, i have a terminal hooked up to a lua component on input pin 1 and a text display on output pin 1. the component is running the code o[1]=i[1]. instead of making whatever i type appear on the text display, nothin happens at all
Ramazan23 4 Jun, 2022 @ 4:21am 
5 components reactor controller in Lua (link to original)

o[1]=i[1]/i[2];o[2]=o[1]/(i[3]/75)

o[1]=turbineoutput o[2]=fussiorate
i[1]=load i[2]=maxpower/100 i[3]=fuel_out

Thank you for this mod!
Dailyyy 23 May, 2022 @ 3:57pm 
me griefing with lua component
SydWad 23 May, 2022 @ 3:54pm 
This is a bad idea