I'm trying to find information on how to make a "server-side" mod. For example, I found that I would really like to make use of world.breakObject(), but I get a log message telling me this is a server-side only function. Clearly I am ignorant of something here, but not sure where to look to find more. Maybe I'm not typing in the right keywords in the search? I only found breakObject listed in the colonies mod discussion on these forums. Cant find much on google either. To give you an idea of why I am asking, I was playing with a teleporter mod and made my own much more limited functional mod just to start learning more. I made tech and teleporters all with my own naming scheme and I ran around my world placing them and playing with them. Now, I'm not going to release what I did to the community as there as teleporter mods much more extensive than this. I found that I could remove the tech and remove the mod, no problems. However, the telporter pads that I placed in my world no longer are visible, but DO seem to still take up space. I walk over them and raise up. I can mine the floor underneath them and still walk over the gap, etc. Now the interesting part. I would have liked to attempt the manual process of just going in an mining up all the porters I put down. The problem is that putting the mod back into the mod folder did not cause the previously invisible porters to show up again. I was able to place new ones and delete them, etc. So, I figured that I would play around a little more. I have a player backup and universe backup so it's not like I actually lost anything, but each failure is a learning experience and I want to learn from this. Since there is no way to get them to show back up, this seems like something worth tracking down and figuring out a fix for. I thought I was onto something for a little bit. I was able to objectQuery my way to finding items of my type of teleporter. Then I tried to get rid of them using breakObject(), but it didnt work. I got a log message saying it was a server side only feature. Basically, I wanted to change my mod to go from a "create a teleporter object" into a "destroy all teleporters" mod. Sort of a cleanup tool. Aside from asking the obvious question.... Is there another, better way to do this? I also want to ask, is there something I can do to make this a server side script and get it to execute? My goal is to cleanup all teleporters of my custom type from any world. I am OK with having to go down to each world and hit a key, I am even happier to just get the cleanup to run server side either globally or per world activated, etc. Thanks for any help.
I think you can just start up the server from the launcher with the mod installed. The server uses the same directories as the game itself, and should load your mod.
Yeah, I am able to run the server and connect to it from the client on the same machine. Same result though.
hmm, I'm bumping this cause I'm still stuck. Anyone got any suggestions on how to call world.breakObject() for an object? Or, any other way to enumerate items of a certain type and delete them? I know how to enumerate objects of a certain type using world.objectQuery(), just dont know how to cause them to be deleted. I run the server so I have complete access. I'm just trying to do a cleanup of the old tech so any cludge/shortcut/quick hack to help me do this is perfectly acceptable.
well, I did a little more digging and found this: http://community.playstarbound.com/...many-of-my-vanilla-items-are-invisible.71989/ Looks like it's a common problem. Seems like missing objects leave their collision boxes around. a manual, but workable fix is to build an object in its place like dirt and then mine it back up. I just tested and validated that this works. From a purely intellectual perspective I would still like to know how to cause things to get executed server side (assuming I own the server and can put scripts there that the client can interact with. in my example, upon entering a new world I was trying to use a tech that would search and delete all objects of a certain type, but the tech is running client side and the breakObject() says it needs to be run server side.
Perhaps you could substitute their scripts for one that makes them break every tick? My knowledge of server/client programming is rudimentary, so I can't directly answer your question. But this is how I understand the relationship between the two: client side is information that does not need to be shared between players for multiplayer to function. Easy examples would be your audio settings, resolution, assets (the assets themselves, not their names or paths), zoom level, etc. That information is not sent to the remote machine, and that data is manipulated and stored entirely on your client machine. Thus, server side must be the data that has to be exchanged - your coords, health, hitbox, def/dps, etc.