How to spawn objects in Neighborhood? #3930
Unanswered
sjmarotta
asked this question in
Support Q&A
Replies: 1 comment
-
|
I've opened #3940 which adds an API to list all the assets. Would be great if you could try it out and see if it helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to be able to spawn objects via RPC at runtime during a run of Neighborhood 1.5 using the Python API. Does anyone have an example of how to to this? I am calling
simSpawnObject, but I have no way to know what to put forasset_name. Looking through the code, it seems to search theasset_mapfor the name provided, and that seems to link to the Asset Registry file. But that's a binary file, and while there's some text, I don't know what, if any, of the text strings in that file correspond to asset names.In the Python client, I'm making the following call:
(where
pos.z_valis a known value of typefloat)And I'm getting the following error message:
I can only guess as to what that means. I know that I'm not giving it an asset name that it recognizes, so that's my best guess. Isi there a better way for me to peek inside the Neighborhood asset database so I can know what to feed to that parameter?
EDIT: I got it to work, eventually, through sheer luck. The
AssetRegistry.binfile had a section toward the end that seemed to contain objects. You can see that I tried putting the long name,/Game/ModularNeighborhoodPack/Assets/Outdoor_Props/Car_01.Car_01, but I was still having errors. I replaced that with simplyCar_01and it works like a champ.HOWEVER!! I don't love having to open up the database file and hunt for strings like a barbarian. If there's a better way to know what my object options are, I'd love to know about it.
Beta Was this translation helpful? Give feedback.
All reactions