• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Need help with custom C# NetPackage for quest objective

khzmusik

Hunter
Hey, all. I'm hoping someone with a lot of C# skills can help me with this.

In C#, I'm creating a custom quest objective to go to a POI. It is designed to be a drop-in replacement for ObjectiveRandomPOIGoto, except that it accepts additional properties: included POI tags, excluded POI tags, and a distance (range or max distance) from the quest giver.

This is all working in single-player, but now I want it to work in multi-player. And, in multi-player, this is my understanding of how it should work.

1. The method to find a POI is called on a client. Don't do it, and instead send a NetPackage to the server for it to find the POI.

2. The server receives the NetPackage, and the NetPackage itself does the job of finding the POI. It should use the same logic as the Objective would in single-player.

3. Once the POI is found, the server sends another NetPackage back to the clients with the POI information.

4. The clients receive the NetPackage, and "finalize" the objective (set the POI position and size).

I am pretty sure that's accurate, but I want to get another set of eyes on it.

One question is about step 3. I assume that, as long as the client is sent the POI position and size, that it doesn't need to be the same (custom) NetPackage type that the client sent to the server; that instead a vanilla NetPackageQuestGotoPoint type would do (this is what the vanilla ObjectiveRandomPOIGoto uses).

Also: All the vanilla NetPackage classes have a GetLength method, and I can't tell what that is supposed to represent. Some return 8, others return 32, still others return a different length depending upon the count of some internal list or other.

If  you're reading this and can't answer, then would it be possible to help me test? I don't have any way to test a multiplayer game by myself.

 
Back
Top