• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Coding Tutorial] An easy way to create rotating NPCs

  • 11
    Posts
    6
    Years
    This tutorial has been made with Essentials v19.1. While the chances of the functions we'll be working with being modified with v20 or future versions are very low, I'll keep an eye on it. If I ever notice any modification, I'll try to get this tutorial up to date as soon as possible

    I don't ask for any credits, because what I do is basically just taking an already existing function and creating new ones based on it.

    Introduction :
    What is a rotating NPC ? Basically, this term is associated with NPCs that stay on the same tile, but randomly change the direction they are facing. In the mainline games, this behaviour is pretty often adopted by trainers who can suddendly look at where the player is, and then engaging a battle.

    This is exactly what I'm gonna teach you to do in this tutorial.


    Getting started :
    Spoiler:


    Randomly facing 2 directions :
    Spoiler:


    Randomly facing 3 directions :
    Spoiler:


    Assigning a function to an NPC :
    Spoiler:


    That's all for this tutorial! If something isn't clear, or if you want more explainations, please feel free to ask anything on this thread, and I'll try to respond as fast as possible.
    Also, I'm sorry if you spotted some mistakes. As a resident of Baguette-Land, English is not my native language, and I can make some oopsies sometimes, but I try to be as understandable as possible.
    Thank you for following this tutorial!

    ChromusSama
     
    Last edited:
    Back
    Top