Modding Help Getting fluid pressure from the clientside- how should I go about this?

Discussion in 'Starbound Modding' started by Fayabella, Mar 22, 2024.

  1. Fayabella

    Fayabella Space Hobo

    Hello! So, I'm working on adding a little feature that makes pressurized fluids give you the pressure debuff from FU Gas Giant planets. It's meant to be a sort of addon to [this mod] by Bardez which adds pressure sensors and displays. However, I've run into an issue...

    So, I hook into the player's primaryscriptsources, this way I can access the player's bounding box coordinates as they continue to move around, and hopefully also eventually give the player a status effect. But the issue comes when I use the
    world.liquidAt() function that Bardez uses in their fluid pressure sensor object-- after some testing (and blindly poking around in the source code), I've found that since their script is run via an object, I *believe* it is server-side? and therefore returns a LiquidStore (which includes the pressure value.) But when i use that exact same function in the player update script, it gives me a LiquidLevel (only the fluid height, and not how many units of fluid are stored in the tile)

    So basically, I somehow need to... either 1. find a way to run only that function server-side, and get the data back, then continue... or 2. make the entire thing server side and somehow detect every player in a world and check each of them and then apply effects on them after...

    Does anyone have any suggestions, tips, or pointers on what I can/should do here? I am rather new to starbound modding and uh, as you can probably tell, i'm a bit lost and don't fully know how everything works yet, especially when it comes to clientside versus serverside stuff.
     

Share This Page