Paste #11887: Map Script Example

Date: 2014/12/06 22:17:24 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


MapScript:
  type: map
  debug: false
  objects:
    1_image:
      type: image
      image: http://i.imgur.com/HRXdC.gif
      width: 128
      height: 128
      visible: true
    2_image:
      type: image
      image: http://fc04.deviantart.net/fs71/f/2013/045/c/c/le_happy_face_by_luchocas-d5uwq7r.png
      width: 30
      height: 30
    3_text:
      type: text
      text: OHAI <player.name.to_uppercase>
      visible: <player.flag[cursor]>
    4_cursor:
      type: cursor
      cursor: <tern[<util.date.time.second.mod[3].is[==].to[0]>]:red_pointer||<tern[<util.date.time.second.mod[3].is[==].to[1]>]:green_pointer||blue_pointer>>
      x: <player.location.x.mod[128].add[1].round>
      y: <player.location.z.mod[128].add[1].round>
      direction: <proc[cursorDirection]>

cursorDirection:
  type: procedure
  script:
  - define yaw <player.location.yaw>
  - if <def[yaw].is[OR_MORE].than[348.75]> || <def[yaw].is[LESS].than[11.25]> determine 0
    else if <def[yaw].is[OR_MORE].than[326.25]> determine 15
    else if <def[yaw].is[OR_MORE].than[303.75]> determine 14
    else if <def[yaw].is[OR_MORE].than[281.25]> determine 13
    else if <def[yaw].is[OR_MORE].than[258.75]> determine 12
    else if <def[yaw].is[OR_MORE].than[236.25]> determine 11
    else if <def[yaw].is[OR_MORE].than[213.75]> determine 10
    else if <def[yaw].is[OR_MORE].than[191.25]> determine 9
    else if <def[yaw].is[OR_MORE].than[168.75]> determine 8
    else if <def[yaw].is[OR_MORE].than[146.25]> determine 7
    else if <def[yaw].is[OR_MORE].than[123.75]> determine 6
    else if <def[yaw].is[OR_MORE].than[101.25]> determine 5
    else if <def[yaw].is[OR_MORE].than[78.75]> determine 4
    else if <def[yaw].is[OR_MORE].than[56.25]> determine 3
    else if <def[yaw].is[OR_MORE].than[33.75]> determine 2
    else if <def[yaw].is[OR_MORE].than[11.25]> determine 1

###
### Example:
### - map new:w@world script:MapScript save:map
### - give i@map[map=<entry[map].created_map>]
###