Paste #7369: Untitled Paste

Date: 2014/07/23 17:23:41 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# +-------------------- 
# | Using Format Scripts 
# | 
# | Format scripts allow you to create custom preset 
# | formats for the narrate and announce commands. 
# | 
# | EG, turn - narrate "hello" 
# | into: "MyNPC: hello" with coloring too. 

# +-- The Format Script --+ 
Quest: 
  # Remember to keep the name short, you're going to be typing it a lot! 
  # One possible name is just 'chat'. 

  type: format 

  # The format script is a very small script 
  # with only one line after the type 

  # This one line is 'format: <formatting here>' s
  format: <blue>Quest<&co> <gold><text>
  # <&b> = cyan text 
  # <npc.name> will become the NPC's name 
  # <&7> = white text 
  # <&co> = a :colon: (You can't directly type one in a message, as it can cause errors)
  # <&2> = green text 
  # <text> will become the message 

# +-- Elsewhere, in some other script --+ 
#- narrate format:FormatExample "Hello there!" 
# Assuming the NPC is named 'Bob', This will show to the player: 
# Bob: Hello there! 
# Except with lots of color. 

# You can also do that with announce instead of narrate 

# +-- Additional note --+ 
# Remember, you only need one format script for each style of message 
# Don't duplicate the format script in every file 
# It's better to make a script file named something like 'UtilFormats.yml' 
# And put all your favorite format scripts in there 
# any NPC script will be able to use them as well 

# ALSO, you can at any time reformat a tag using the tag '<el@element.format[<script>]>'
# EG, <npc.name.format[FormatExample]> 
NewQuest: 
  type: format 
  format: <blue>New Quest<&co> <gold><text>
QuestObj: 
  type: format 
  format: <blue>Quest Objective<&co> <gold><text>
NewQuestObj: 
  type: format 
  format: <blue>New Quest Objective<&co> <gold><text>