help for making npc?

Discussion in 'Released Mods' started by >:SYNTAX, Dec 7, 2012.

  1. >:SYNTAX Mouse

    Im up to the stage in modding Terraria where i want to get into the .cs scripts side of things so i thaught the easiest thing to do would be would to make a NPC i have a good idea of what i want and im following the tutorial on the Tconfig wiki and its help full but i want my NPC to spawn the same as the guide with out any needs, so what i'm asking is there anyway to make a NPC spawn straight off when you start the game?
  2. smokesjackson Snow Flinx

  3. >:SYNTAX Mouse

    that was the tutorial that i was looking at it dosent give any other examplaes of how an npc can spawn but thanks for trying
  4. Classikly Frankenstein

    There's a section on town spawning right there.
  5. Shockah Grandson of the Wizard

    "the easiest thing" - you got it all backwards. It's the HARDEST THING, imo. Other than some other crazy ideas. The easiest are custom items.
  6. SonicR Bone Serpent

    The only way I can think of to get a custom NPC to spawn exactly to the conditons you want is to substitute the guide for your custom NPC. That requires advanced coding, though.

    You can get an NPC to spawn immediately when a house is available, though. Try using this:
    Code:
    public static bool TownSpawn() {
    return true;
    }
  7. >:SYNTAX Mouse


    i tried that and in my world i have 2 houses available both are suitable and its been a few hours and he still has not arrived.

    i have even tried starting a new world and that has still not worked.

    when i first tried reversing the script on the wiki so that if hard mode is enabled he will not spawn and if its not enabled he will spawn and he spawned immediately (died and never came back) (my game is not yet in hard mode)
  8. SonicR Bone Serpent

    Hmm, try this:

    Code:
    public static bool TownSpawn() {
        if(Main.dayTime)
              return true;
        else
              return false;
    }
     
    
  9. >:SYNTAX Mouse

    yea still no luck, the mod runs fine its just the npc never shows up.
  10. Classikly Frankenstein

    Both codes he gave you should work fine.
  11. >:SYNTAX Mouse


    they both make sense but i cant tell why he wont show up,

    i will get one of my friends to test the mod out and see if it happens for them.
  12. Classikly Frankenstein

    They don't just make sense, they're correct.
  13. FreyModder Giant Worm

    Can someone write a code that will spawn NPC only at night?
  14. Wigglesniff World Feeder

    Could you upload your mod with the NPC?
  15. >:SYNTAX Mouse

    i have sort of skipped doing the npc antill a later time but do you know how to make custom ores spawn in a custome world because atm im not having much luck.
  16. Wigglesniff World Feeder

Share This Page