Barotrauma

Barotrauma

Barotrauma Workshop
You can build your own submarines and monsters with in-game editors and share your creations with other players. Imagine and experiment.
Dynamiez 4 27 May, 2024 @ 3:37am
Question for a mod
Hey, i think i need help.
I am trying to make a mod. It is a small cabinet you can fabricate and put anywhere where you can put in one artifact. this cabinet has a set_state in and a power_in. if it is powered and set to ON, the effect of the artifact gets surrpressed (like from the artifact transport case) and it uses a small amount of power. if the switch gets to OFF, the artifacts effects dont get surpressed and i needs mno power. okay, it works all fine yet. but if i put anything else on the junction box which powers my mod cabinet, the effect from the artifact gets surpressed, no matter if it is activated or not and i dont get why.

Here is the code and 3 images. on the first you can see that the lever is off and no power is drawn (display). on the second image you can see that the lever is on, 133kw power are drawn and the artifacts effect is surpressed. on the third image i have connected a relay to the junction box. the lever is off, no power is drawn but the effect is magically surpressed...

<Item name="Toggable Artifact Box" identifier="Toggable Artifact Box" tags="locker,container,artifactcontainer,poweredcontainer" linkable="true" pickdistance="150" scale="0.5" description="A small cabinet for an artifact which effect can be toggled on and off">
<Sprite name="%ModDir%/Toggable Artifact Box.png" texture="%ModDir%/Toggable Artifact Box.png" sourcerect="0,0,128,128" depth="0.6" origin="0.5,0.5" />
<InventoryIcon name="%ModDir%/Toggable Artifact Box.png" texture="%ModDir%/Toggable Artifact Box.png" sourcerect="0,0,128,128" origin="0.5,0.5" />

<ItemContainer capacity="1" canbeselected="true" hideitems="true" ContainedStateIndicatorSlot="1">
<Containable items="alienartifact">
<StatusEffect type="OnActive" target="This" Voltage="1.0" setvalue="true" />
</Containable>
</ItemContainer>
<LightComponent lightcolor="255,255,255,0" range="10.0" powerconsumption="133" IsOn="true" castshadows="false" allowingameediting="false">
<StatusEffect type="OnActive" target="This"/>
<!-- <UseItem /> -->
<!-- </StatusEffect> -->
</LightComponent>
<Fabricate suitablefabricators="fabricator" requiredtime="5">
<RequiredSkill identifier="mechanical" level="20" />
<RequiredItem identifier="titanium" amount="3" />
<RequiredItem identifier="lead" amount="2" />
</Fabricate>
<Deconstruct time="20">
<Item identifier="titanium" amount="1" />
<Item identifier="lead" amount="1" />
</Deconstruct>
<Body width="175" height="374" density="40" />
<Holdable selectkey="Select" pickkey="Use" slots="Any,RightHand,LeftHand" msg="itemmsgdetachcrowbar" PickingTime="10.0" aimpos="35,-10" handle1="0,0" attachable="true" attachedbydefault="true" aimable="true">
<requireditem identifier="crowbar" type="Equipped" />
</Holdable>

<ConnectionPanel selectkey="Action" canbeselected="true" msg="ItemMsgRewireScrewdriver" hudpriority="10">
<GuiFrame relativesize="0.2,0.32" minsize="400,350" maxsize="480,420" anchor="Center" style="ConnectionPanel" />
<RequiredItem items="screwdriver" type="Equipped" />
<input name="power" displayname="connection.power" />
<input name="toggle" displayname="connection.togglestate" />
<input name="set_state" displayname="connection.setstate" />
<output name="state_out" displayname="connection.stateout" fallbackdisplayname="connection.signalout" />
</ConnectionPanel>
</Item>

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3255502994

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3255503083

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3255503133
Last edited by Dynamiez; 27 May, 2024 @ 3:41am
< >
Showing 1-4 of 4 comments
Buggy Boy 10 28 May, 2024 @ 12:12am 
Could not access those screenshots: 'There was a problem accessing the item. Please try again.'
Dynamiez 4 28 May, 2024 @ 5:48am 
Sorry my fault. Had put them on private. Now they should be public
Buggy Boy 10 28 May, 2024 @ 1:14pm 
I would just say that Relays do odd things with power in my experience, although that may be nothing to do with your problem, you could try connecting some other component such as a lamp instead of the Relay to see if it has the same effect.
Dynamiez 4 28 May, 2024 @ 10:28pm 
Yeah, you are right. I just noticed that as soon as you link a relay to any junction box, all junction boxes where showed as "activated" even if there is no power drain at all. I just dont get it why my mod cabinet is influenced by the state of the junction box 😅 on the other hand, i dont even know if this cabinet makes any sense at all, it is just a Feasibility study for me 😜

I thought, perhaps you could use the sky artifact as a fire extingisher. Or the thermal artifact as a ballast flora killer. Or the psychosis artifact as a troll device with button activation
< >
Showing 1-4 of 4 comments
Per page: 1530 50