Changes

592 bytes removed ,  03:30, 28 November 2022
Line 129: Line 129:  
* Add entries to Data\animationDescriptions (if you want custom animations in their schedule)
 
* Add entries to Data\animationDescriptions (if you want custom animations in their schedule)
   −
All of the above can be done with IAssetLoaders/IAssetEditors or Content Patcher. Finally, spawn the NPC with a SMAPI mod. The different constructors are:
+
All of the above can be done with IAssetLoaders/IAssetEditors or Content Patcher. If you did all of this correctly, the game will spawn the NPC in for you. (If you didn't, it swallows the error)
 
  −
<syntaxhighlight lang='c#'>
  −
public NPC(AnimatedSprite sprite, Vector2 position, int facingDir, string name, LocalizedContentManager content = null);
  −
public NPC(AnimatedSprite sprite, Vector2 position, string defaultMap, int facingDir, string name, Dictionary<int, int[]> schedule, Texture2D portrait, bool eventActor);
  −
public NPC(AnimatedSprite sprite, Vector2 position, string defaultMap, int facingDirection, string name, bool datable, Dictionary<int, int[]> schedule, Texture2D portrait);
  −
</syntaxhighlight>
  −
 
  −
For spawning:
  −
 
  −
<syntaxhighlight lang='c#'>
  −
Game1.getLocationFromName("Town").addCharacter(npc);
  −
</syntaxhighlight>
      
==User-interface (UI)==
 
==User-interface (UI)==
528

edits