mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
Implement first draft functions for saving and loading NPC appearance from storage.
This works by serializing and deserializing NPC AvatarAppearance to a notecard in the prim inventory and making the required baked textures permanent. By using notecards, we avoid lots of awkward, technical and user-unfriendly issues concerning retaining asset references and creating a new asset type. Notecards also allow different appearances to be swapped and manipulated easily. This also allows stored NPC appearances to work transparently with OARs/IARs since the UUID scan will pick up and store the necessary references from the notecard text. This works in my basic test but is not at all ready for user use or bug reporting yet.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
@@ -43,6 +44,23 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <returns>The UUID of the ScenePresence created.</returns>
|
||||
UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom);
|
||||
|
||||
/// <summary>
|
||||
/// Check if the agent is an NPC.
|
||||
/// </summary>
|
||||
/// <param name="agentID"></param>
|
||||
/// <param name="scene"></param>
|
||||
/// <returns>True if the agent is an NPC in the given scene. False otherwise.</returns>
|
||||
bool IsNPC(UUID agentID, Scene scene);
|
||||
|
||||
/// <summary>
|
||||
/// Set the appearance for an NPC.
|
||||
/// </summary>
|
||||
/// <param name="agentID"></param>
|
||||
/// <param name="appearance"></param>
|
||||
/// <param name="scene"></param>
|
||||
/// <returns></returns>
|
||||
bool SetNPCAppearance(UUID agentID, AvatarAppearance appearance, Scene scene);
|
||||
|
||||
/// <summary>
|
||||
/// Move an NPC to a target over time.
|
||||
/// </summary>
|
||||
@@ -59,7 +77,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <param name="text"></param>
|
||||
void Say(UUID agentID, Scene scene, string text);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Delete an NPC.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user