Barotrauma

Barotrauma

Lua Component
18 kommentarer
Matheus 27. sep. 2023 kl. 7:06 
Since this one is obsolete, please also consider using MicroLua
zomgtehderpy  [ophavsmand] 1. apr. 2023 kl. 22:13 
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  [ophavsmand] 29. mar. 2023 kl. 12:27 
@Derpino I am pretty sure indexes go from 1 to 8, not 0 to 7.
Derpino 13. mar. 2023 kl. 11:54 
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 kl. 6:12 
I don't know how useful this will be, but I'm still having memory leaks with this in MP.
zomgtehderpy  [ophavsmand] 21. okt. 2022 kl. 6:43 
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. okt. 2022 kl. 12:09 
Has anyone tested this in MP (as the author says they have not)?
|SPQR| Vetinarix 5. aug. 2022 kl. 19:03 
Excellent news - cheers.
Will let you know if it's not :)
zomgtehderpy  [ophavsmand] 4. aug. 2022 kl. 0:30 
@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 kl. 23:57 
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 kl. 23:35 
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  [ophavsmand] 25. juni 2022 kl. 2:22 
"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. juni 2022 kl. 0:30 
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. juni 2022 kl. 23:50 
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. juni 2022 kl. 23:25 
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. juni 2022 kl. 4:21 
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. maj 2022 kl. 15:57 
me griefing with lua component
SydWad 23. maj 2022 kl. 15:54 
This is a bad idea