Open Benjamin-Dobell opened 4 years ago
Just looking into this some more, and amended the above with some corrections.
Perhaps Berserk's intention is that the "user friendly names" for spawnObject()
are supposed to be deprecated?
However, objects like "Pink Pawn" can't be spawned with a resource name alone, because the corresponding resource ("PlayerPawn") must have its colour set to pink (by default it's white). That means without documenting the above friendly names it's impossible to spawn a pink pawn using spawnObject()
. Instead you must use spawnObjectJSON()
and specify the ColorDiffuse
and MaterialIndex = 7
.
Basically, we should probably either document the friendly names (as they can be useful, as above), or we should mark spawnObject()
as deprecated, because users may rightfully be confused about how to spawn a Pink Pawn etc.
Essentially, without this friendly name list, spawnObject()
is fairly useless.
In addition to resource names,
spawnObject()
accepts user friendly names as well:Where as
spawnObjectJSON()
takes aname
within the JSON i.e.object.name
. The following list was obtained by spawning the above objects, however this list is non-exhaustive:Currently the Spawn Objects documentation has the latter only. This may be confusing for users who wish to consume the simpler (albeit more constrained)
spawnObject()
API.You may have noticed two things about the above lists:
spawnObject()
"user friendly names" than there arespawnObjectJSON()
names. This is because some "user friendly names" map to the same resource, but have had additional configuration changes made such that they look different.The mappings between between "resource names" and "user friendly names" (as per point 1 above) are available here.
Ideally we should add something to API docs to explain all this.