- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Camera Utilities


By DNx
Created: 2016/07/17 02:45:17 UTC-07:00 (8 years and 161 days ago)
Edited: 2016/07/30 21:35:57 UTC-07:00 (8 years and 147 days ago)
Likes: 0

Staff pick as of: 2017/01/16 09:38:45 UTC-08:00 (7 years and 342 days ago)
Denizen Version: 0.9.8
Script Version: 0.01
Description:

same like http://mcmonkey.org/denizen/repo/entry/79
WITHOUT PIG SOUNDS!!
Usage:
# Used to force player's camera to a location
- run CameraUtil def:attach|<l@location> as:<p@player>
# Used to free player from the forced camera
- run CameraUtil def:detach as:<p@player>




Download script | View raw script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
7700

CameraUtil_Version:
  type: version
  track: true
  name"Camera Utilities"
  id: 102
  description"Player's Camera utilities."
  version: 0.02

CameraUtil:
  type: task
  debug: false
  speed: 0t
  definitions: action|location
  script:
  - if <def[action]> == attach {
    - inject locally path:detach
    - inject locally path:create
    - teleport <def[location]>
    - wait 1t
    - inject locally path:attach
    - queue clear
    }
  - if <def[action]> == detach {
    - inject locally path:detach
    }
  create:
  - spawn e@CameraUtil_Entity <def[location]> save:x
  - define attach_to <entry[x].spawned_entities.first>
  - flag <player> camerautil_attached_to:<def[attach_to]>
  attach:
  - define to <player.flag[camerautil_attached_to].as_entity||null>
  - if <def[to]> != null {
    - flag <player> camerautil_lastgamemode:<player.gamemode>
    - adjust <player> gamemode:spectator
    - async {
      - while <player.has_flag[camerautil_attached_to]> {
        - adjust <player> spectate:<def[to]>
        - wait 10t
        }
      }
    }
  detach:
  - if <player.has_flag[camerautil_attached_to]> {
    - if <player.has_flag[camerautil_lastgamemode]> {
      - adjust <player> gamemode:<player.flag[camerautil_lastgamemode]>
      - flag <player> camerautil_lastgamemode:!
      }
    - define as <player.flag[camerautil_attached_to]>
    - flag <player> camerautil_attached_to:!
    - adjust <player> spectate:<player>
    - remove <def[as]>
    }

CameraUtil_Listener:
  type: world
  debug: false
  events:
    on system time hourly:
    - if <s@CameraUtil_Version.yaml_key[track]> {
      - webget "http://morphanone.space/webizen.aspx/tracker?script=<s@CameraUtil_Version.yaml_key[id]>&version=<s@CameraUtil_Version.yaml_key[version]>"
      }
    on player quits:
    - inject s@CameraUtil path:detach
    on world unload:
    - foreach <context.world.entities.filter[scriptname.is[==].to[CameraUtil_Entity]]> {
      - remove <def[value]>
      }

CameraUtil_Entity:
  type: entity
  debug: false
  entity_type: e@armor_stand
  gravity: false
  visible: false
  invulnerable: true






View History