QuestCreator - Plugin storage

Feb 12, 2018
QuestCreator - Plugin storage
  • [​IMG]

    Table of contents :

    Commands and permissions
    > Plugin storage
    Create a quest
    Basics : variables
    Basics : preconditions
    Basics : quest settings
    Basics : quest requirements
    Basics : quest rewards
    Basics : quest flow
    Basics : quest flow - tasks
    Basics : quest flow - objectives
    Developpers API

    Plugin storage


    As all of my plugins require PyrCore in order to be able to run properly, all the configuration files are stored in the PyrCore directory in the plugins folder : /plugins/PyrCore/

    In that folder you can find the general configurations for all the plugins, including QuestCreator : questcreator_config.yml

    Default file :
    Code (Text):

    #----------------------------------------------------------------------------------------------------
    # Configuration file for QuestCreator
    #----------------------------------------------------------------------------------------------------

    # Locale

    locale: questcreator_en_US.yml

    #----------------------------------------------------------------------------------------------------
    # Settings
    #----------------------------------------------------------------------------------------------------

    settings:

      # Save the current quests on plugin disable ?
      quests_save_on_disable: true
     
      # Data save interval
      data_save_interval: 180

      # Cancel quests after X inactivity minutes (set it to -1 to disable this option)
      cancel_delay: -1

      # Max active quests per player (experimental)
      # This could be confusing if this is > to 1, but it's your choice !
      max_active_quests_player: 1

      # Action bar settings
      action_bar_enable: true
      action_bar: '&a$QUEST &7| &a$OBJECTIVE &7| &a$PROGRESSION&7/&a$GOAL'
      action_bar_no_objective: '&a$QUEST'

      # Play sound when the rewards of a quest are given
      # Sounds : www.pyrrh4.be/doc/sounds/
      sound_rewards_enable: true
      sound_rewards: ORB_PICKUP
     
      # Ephemerial quests (when the player quits the server, the quest is cancelled)
      ephemerial_quests: false

    #----------------------------------------------------------------------------------------------------
    # Variables
    #----------------------------------------------------------------------------------------------------
    # This is the variables that can affect the player's quests. You can use them in all the quests
    #  for example for making multiple choices and dialogs that affect the current quest or even
    #  other quests.
    # Every variable can be assigned with everything on one line (numbers, strings, booleans or
    #  whatever). Lists aren't allowed.
    # The variables names AND values are both case sensivite.
    # Please note that those variables are NOT global, which means every value associated to a variable
    #  can be different for each player ! (example, if there is a variable called 'test', this variable
    #  can be associated to value 1 for Notch and associated to value 2 for PYRRH4)
    # Please note too that this section is useful only if you want default values. If you don't register
    #  a variable here, it won't have a default value but you still we able to use it.
    # The formatting is 'var {variable name} default {default value}'
    #----------------------------------------------------------------------------------------------------

    variables:
      - 'var example default yes'
      - 'var number default 10'

    #----------------------------------------------------------------------------------------------------
    # NPCs
    #----------------------------------------------------------------------------------------------------

    # Start quests in this order when clicking a NPC (if no active quests)

    npcs_quests:
      npc1:
        id: 1
        quests:
          - example
        # max_simultaneous : maximum amount of quests the player will be able to follow from this NPC
        max_simultaneous: 1

    # Randomly start quests (order doesn't matter) (if no active quests)

    npcs_quests_random:
      npc1:
        id: 1
        quests:
          - randomquest
        # max_simultaneous : maximum amount of random quests the player will be able to follow from this NPC
        max_simultaneous: 1

    #----------------------------------------------------------------------------------------------------
    # GUI
    #----------------------------------------------------------------------------------------------------

    gui:

      # GUI name
      name: Available quests

      # Previous page item
      previous_page_item:
        type: 262
        name: '&7Previous page'

      # Next page item
      next_page_item:
        type: 262
        name: '&7Next page'
     
    There is as well a default sample quest :
    Code (Text):
    #----------------------------------------------------------------------------------------------------
    # Quest 'example' (file name without the extension is the quest identifier)
    #----------------------------------------------------------------------------------------------------
    # |!!!| Refer to the plugin's wiki to have more details about how creating a quest. |!!!|
    # |!!!| There are some tips in this file but most explanations (including variables, preconditions, etc) are in the wiki. |!!!|
    #----------------------------------------------------------------------------------------------------

    # --------------------------------------------------
    # Quest settings
    # --------------------------------------------------

    settings:
      # name
      name: '&aExample'
      # description : can be either a single line or a list
      description: 'Just a sample quest'
      # enabled : if the quest is enabled or not
      enabled: false
      # auto_start : will the quest auto_start when the player connects
      auto_start: false
      # max_simultaneous_players : maximum players that can do this quest at the same time
      max_simultaneous_players: 1
      # max_coop_players : maximum additionnal players (don't count the guy that starts the quest) that can do the quest with him
      max_coop_players: 0
      # max_completions : maximum times the player can complete the quest
      max_completions: 1
      # cooldown : time (in minutes) the player will have to wait between completions (will be effective if max_completions is greater than 1)
      cooldown: 5
      # apply_cooldown_if_fail : if the player fails the quest (task QUEST_CANCEL), do we still apply the cooldown ?
      apply_cooldown_if_fail: true
      # show_actionbar : display the current objective name (you can customize its look in the questcreator_config.yml, settings.action_bar)
      show_actionbar: true
      # send_success_message : display the success/fail message when the player ends the quest
      send_success_message: true
      # only_in_worlds : the quest can only be started/influenced in those worlds (optional)
      only_in_worlds: []
      # permission : the player will need this permission to start the quest (optional)
      permission: questcreator.quest.example

    # --------------------------------------------------
    # GUI
    # --------------------------------------------------

    gui:
      # enabled : if the quest can be seen in the GUI /quests
      enabled: true
      # item_available : will be showed when the quest status is 'available'
      item_available:
        type: DIAMOND_SWORD
        name: '&a$NAME &a- AVAILABLE'
        lore:
          - '&7$DESCRIPTION'
          - '&7left click to follow this quest'
      # item_progress : will be showed when the quest status is 'in progress'
      item_progress:
        type: DIAMOND_SWORD
        name: '&6$NAME &6- IN PROGRESS'
        lore:
          - '&7$DESCRIPTION'
          - '&7Objective : $OBJECTIVE'
      # item_cooldown : will be showed when the quest status is 'completed' and the player hasn't reached max_completions and the cooldown is not over
      item_cooldown:
        type: DIAMOND_SWORD
        name: '&7$NAME &7- COOLDOWN'
        lore:
          - '&7$DESCRIPTION'
          - '&7You have completed this quest $COMPLETIONS time$PLURAL.'
          - '&7$COOLDOWN remaining before you can start this quest again.'
      # item_completed : will be showed when the quest status is 'completed' and the player has reached max_completions
      item_completed:
        type: DIAMOND_SWORD
        name: '&7$NAME &7- COMPLETED'
        lore:
          - '&7$DESCRIPTION'
          - '&7You have completed this quest $COMPLETIONS time$PLURAL.'

    # --------------------------------------------------
    # Requirements
    # The things that the player needs to start the quest
    # Types : ITEM, MONEY, PERMISSION, PRECONDITION
    # --------------------------------------------------

    requirements:
      1:
        type: MONEY
        money: 100.5

    # --------------------------------------------------
    # Quest flow
    # What's going to happen in this quest
    # --------------------------------------------------

    flow:

      # first objective, walk on 30 blocs
      1:
        task:
          type: PLAYER_CLEAR
      2:
        task:
          type: SEND_MESSAGE
          message: '&2[AI] &aHello, $PLAYER&a. I''m here to ensure that your motor skills are functionnals.'
      3:
        wait: 2
        task:
          type: SEND_MESSAGE
          message: '&2[AI] &aFirst of all, let''s check your ability to walk. Please, &6walk on 30 blocs&a.'
      4:
        name: 'walk on 30 blocs'
        objective:
          type: WALK
          distance: 30.0
      5:
        task:
          type: SEND_MESSAGE
          message: '&2[AI] &aGood job !'

      # then ask him if he wants to do the jump objective
      6:
        wait: 1
        task:
          type: CHOICE
          message: '&2[AI] &aDo you want to execute the jump test or are you too lazy ?'
          choices:
            1:
              - '&bOf course !'
              - var quest_example_jump set yes
            2:
              - '&bNo, I don''t.'
              - var quest_example_jump set no

      # if he denied, fail the quest. it's better to do things that cancel the quest before the rest of the things
      7:
        # the preconditions are used to
        preconditions: var quest_example_jump different yes
        task:
          type: SEND_MESSAGE
          message: '&2[AI] &aIt''s ok, I''m not even frustrated.'
      8:
        preconditions: var quest_example_jump different yes
        task:
          type: SEND_MESSAGE
          message: '&2[AI] &aYou''ll have to do it one day !'
      9:
        preconditions: var quest_example_jump different yes
        task:
          type: QUEST_CANCEL

      # if he accepted, let's start the jump objective. we don't need preconditions about the previous choice
      #  because we know that if the quest has not been cancelled at this points it's because 'quest_example_jump'
      #  was never equals to 'no'.
      10:
        task:
          type: SEND_MESSAGE
          message: '&2[AI] &aOk, let''s jump. I''ll ask you to &6jump 5 times&a.'
      11:
        name: 'jump 5 times'
        objective:
          type: JUMP
          amount: 5
      # this is just a quick tip, you can shorten the SEND_MESSAGE in one line as it's the most used one
      11:
        task: 'SEND_MESSAGE &2[AI] &aWonderful ! Now everything is in order. Well played, $PLAYER ! Here are some rewards.'

    # --------------------------------------------------
    # Rewards
    # When the player ends the quest (and only if he succeeds), he'll receive this
    # Types : COMMAND, ITEM, MONEY, VARIABLE, XP
    # --------------------------------------------------

    rewards:
      1:
        type: MONEY
        money: 15
      2:
        type: XP
        xp: 100
      3:
        type: COMMAND
        command: 'say $PLAYER completed the example quest !'
      4:
        type: ITEM
        item:
          type: STONE
          amount: 64
      5:
        type: ITEM
        item:
          type: DIAMOND
          name: '&6This is an awesome diamond, yes ?'
    You can create all your quests in /plugins/PyrCore/questcreator_quests/
    You can customize the plugin's texts (locale) in /plugins/PyrCore/locale/

    The data (user data, current paused quests, sign/npc data etc) is stored at the server root in a folder named /pyrrh4/ ; do not delete it otherwise you're gonna lose all your current data, and it's better not to modify it, at least when the server is running.
  • Loading...
  • Loading...