Forums » Questions and answers »
Objects not appearing in park
Added by Edward London 7 months ago
I have confirmed that in my plugin, I am receiving the messages and they are being processed. So here are a couple of possibilities I am hoping you can help me eliminate or confirm:
1) I sent you some code before about how I was creating a positional element from a Vector3. You sent me a different implementation. I had already compiled my code, so I did not change it. Could this, even possibly, be causing the objects to not be appearing?
2) I noticed that in my plugin before converting to the latest VastPark API, "Material.enableTextures" was set to "true". Material no longer has an enableTextures attribute, so I commented it out. Is there something else I need to replace it with?
3) I received a warning that
"_ParkEngine.NetworkClient.BroadcastMessage( nm );" is obsolete and I should use GetChannel instead. Do you have an example of a message broadcast using GetChannel?
I can certainly move the code from Load() to Start() and reference the method using a trigger, as you described, but did something change since the last version that would cause that to be necessary now, when it worked this way before?
I hope you understand, that I am by no means questioning you, I just like to understand what causes issues, so I can better understand them moving forward.
I can't thank you enough for the help you have provided.
All the best,
Ed
Replies (3)
RE: Objects not appearing in park
-
Added by Craig Presti 7 months ago
Edward London wrote:
I have confirmed that in my plugin, I am receiving the messages and they are being processed. So here are a couple of possibilities I am hoping you can help me eliminate or confirm:
1) I sent you some code before about how I was creating a positional element from a Vector3. You sent me a different implementation. I had already compiled my code, so I did not change it. Could this, even possibly, be causing the objects to not be appearing?
Yes it's possible, I'm not 100% sure how you're representing the elements in the scene, are you using primitives? Drawing lines? Something else?
2) I noticed that in my plugin before converting to the latest VastPark API, "Material.enableTextures" was set to "true". Material no longer has an enableTextures attribute, so I commented it out. Is there something else I need to replace it with?
The attribute has been removed from the IMML spec as it wasn't often used. You can just remove it.
3) I received a warning that "_ParkEngine.NetworkClient.BroadcastMessage( nm );" is obsolete and I should use GetChannel instead. Do you have an example of a message broadcast using GetChannel?
When you use the NetworkClient Send/Broadcast events directly, it is shared with the framework's messaging and can have a negative effect on the overall network performance if you are sending and receiving a lot of data.
Channel based messaging is shown here: http://vastpark.org/projects/vp/wiki/How_to_Send_Network_Messages
I can certainly move the code from Load() to Start() and reference the method using a trigger, as you described, but did something change since the last version that would cause that to be necessary now, when it worked this way before?
Nothing has changed, it's just good practice to avoid blocking events in the Load method as it will cause environments using the plugin to load slower. Leaving the code as you have it is unlikely to cause your current problem.
I hope you understand, that I am by no means questioning you, I just like to understand what causes issues, so I can better understand them moving forward.
I can't thank you enough for the help you have provided.
All the best,
Ed
No prob :)
RE: Objects not appearing in park
-
Added by Edward London 7 months ago
I examined it further and the positionto2d does not apply to regular objects, it is only being used for menus and tool tips. I have also verified that my messages are behaving as expected and I am receiving the information I should need to build my objects. However, to answer the question, we appear to be using primitives, boxes and spheres.
I would love to set up the debugger, but we never found a way for me to enable nuGet in Visual Studio Express and it was my understanding that it would be required in order to link the debugger to the player, is that correct? ( I do not see an "Attach to process" option under my Debug menu)
I have put in several print lines to help me debug and have a few questions, but they involve proprietary source code, so I will be sending them in a private message.
Thanks again,
Ed
RE: Objects not appearing in park
-
Added by Edward London 7 months ago
Based on the excerpt, here is the response I received, which was very helpful:
Instead of:
p.SetParkEngine(_ParkEngine);
p.Load();
_ParkEngine.RenderEngine.Update( p );
You should do this:
_ParkEngine.Context.Add(p);
Internally the element is loaded and fed into the appropriate engines.
We now see our primitive object in the park! :)
Many Thanks,
Ed
(1-3/3)