OK, naturally as soon as I ask for help, I come up with a workaround. So, if anyone else is doing something similar, hopefully this will be helpful.
I made a function called SpawnCharacter, which creates instances of characters based on a CharacterType string parameter, and returns either the UID of the new character, or zero if a new character wasn't created. The logic of the function goes like so:
- Declare a lastSpawnedCharacter_UID local number variable.
- Pick the last created Character object, and set lastSpawnedCharacter_UID to Character.UID.
- Create Object (by name) using CharacterType.
- Pick the last created Character again.
- Compare the UID of the last created character to the value in lastSpawnedCharacter_UID.
- If the values are different, return the UID of the last created character.
- If the values are the same, return 0.