Jump to content

Do scripts work even when they are off?


Sabretooth

Recommended Posts

Do (lua)scripts get loaded, even when they are off? By this  i also mean like, if you have 100 lights connected by relays (and they are turned off)

Like I have many Fast n Furious lightshows on my vehicle, but they are all locked with a switch

I noticed that my game is slower. Now that can be because of some other reason so I thought I could ask it here on the forum.

 

I want to make a ship with lots of funny things like auto sliding doors with flashing lights etc, but ive got the feeling that even they are not in use they will be loaded and slow down the game.

In Space engineers, it was like how I wanted. You could install many lights, but turning them off was better for performance.

Link to comment
Share on other sites

Scripts probably don't get loaded if the PB/control unit isn't running. There's nothing to render so no need to load it. And it only needs to load in the client that's running it. If several players are nearby, the game can't predict which one will trigger the script.

 

Elements, yes, have to render. That said, an actual light (lights the surroundings, casts shadows) is more expensive than a light that's turned off.

Link to comment
Share on other sites

8 hours ago, Sabretooth said:

Do (lua)scripts get loaded, even when they are off? By this  i also mean like, if you have 100 lights connected by relays (and they are turned off)

Like I have many Fast n Furious lightshows on my vehicle, but they are all locked with a switch

I noticed that my game is slower. Now that can be because of some other reason so I thought I could ask it here on the forum.

 

I want to make a ship with lots of funny things like auto sliding doors with flashing lights etc, but ive got the feeling that even they are not in use they will be loaded and slow down the game.

In Space engineers, it was like how I wanted. You could install many lights, but turning them off was better for performance.

 

Switches and other elements can only "change" status if player's computer is near-by calculating those changes. 

This calculation has to be triggered. Can be triggered by a proximity detector. 

 

Programing boards run on the computer of the player that activated them. If that player goes away(3-4km) the programing board stops. 

 

The only thing that can "run" endlessly without being active is html on the screens. 

Any player entering "screen rendering range" will load and render the html. 

Some SVGs and GIFs can give the impression of "running" actions. 

 

If no player is within less then 4km from the construct and as actively activated stuff in the construct, that construct will be 100% static, represented only by a static record on the DU database. 

 

Making stuff like automated industry or drone craft useless. Unless there is a controlling player nearby. 

Link to comment
Share on other sites

Ps: transmitters can be used to activate programing boards. 

So, in close proximity you could send a transmission from your ship to your base to open a gate or turn on a light.

Note:

It only works at close range(check transmiters and receivers) 

Lua code to do this is not very intuitive(but i tested this with success) 

Security issues appear because you are using a public medium that every one can read and write to. So anyone can send the same signal you are sending and activate your stuff. (maybe rdms can help) 

 

This forum should have some lua examples on how to do this. And discord has a channel to ask questions about lua. 

Link to comment
Share on other sites

So if I read your answers correctly, it is more the amount of elements that need loading than the fact that I have a blinking billboard of xs lights but its turned off.

So the billboard is heavy-loading-stuff, even when its off

 

I think now, that even when not in sight, elements load. And that would be too bad, because the inside of a ship is most of the time not seen by anybody.

The game Subnautica had a similar problem: elements always loaded in, no matter how far away you where. So a big base would slow down your pc, even when you would be far out of visible range of the objects.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...