CreatePerson
From Spheriki
Creates a new person.
Contents |
[edit]
Usage
CreatePerson(name, spriteset_filename, destroy_with_map);
- name string. The name to be given to the new person.
- spriteset_filename string. The path to the Sphere spriteset file for the person.
- destroy_with_map boolean. If
true, the person will be unloaded if the map changes.
[edit]
Examples
CreatePerson("aegis", "aegis.rss", false);
AttachInput("aegis");
AttachCamera("aegis");
MapEngine("field.rmp", 60);
This is the same example from MapEngine(). Note the first line. It means, "Create a new person named 'aegis', using the spriteset 'aegis.rss'. When the map changes, don't destroy this person."
[edit]
Notes
- This function is traditionally used to create people that persist between maps (i.e.
destroy_with_map= false), but it makes map-bound people at runtime possible too.
- For people who appear mostly in the same map, consider laying down persons using the Sphere IDE's map editor instead.
- If the mapengine is running, the created person is created on top of the entry point. If this is a problem, you can resize the map, place the entrypoint on that new part of the map, then downsize the map back.
[edit]
See also
- Sphere Spriteset object
- Every other person function in the Functions page.

