ID:165629
 
Okay idk if this should be under the code problems or this but um, here goes I made an arena for fighting in and i have a verb for watchers to see arena without interfering, but if they are too far away from the loc i want to send the eye too it will give them a black screen. Any way I can change that or isnt it possible?
client.perspective controls the perspective of the eye. It has three settings: MOB_PERSPECTIVE, EYE_PERSPECTIVE and EDGE_PERSPECTIVE.

  • MOB_PERSPECTIVE is the default and only thing set. It calculates visibility based on the whereabouts of the mob. This is your problem; it's calculating from the mobs' point of view. If the mob is out of range, you get a black screen because no calculations have/will be(en) made.
  • EYE_PERSPECTIVE is what you want. It tells it to calculate visibility based on the whereabouts of the eye.
  • EDGE_PERSPECTIVE makes it so that the border of the map (the black areas) will never appear. If you go near the border, the eye will no longer follow the mob and stay where it is. It's an easy way of doing things.


  • What you want to do is set client.perspective=EYE_PERSPECTIVE. This makes it so that the calculations are done from the view of the eye.

    Keep in mind that if you decide to use EDGE_PERSPECTIVE, you may get problems if you constantly use EYE_PERSPECTIVE. When players get near the edge and the eye stops centering around them, any obstruction with opacity set will be calculated from the point of view of the eye. If you've got a maze with lots of opaque walls or pretty much anything remotely complex, when you move behind the wall the eye doesn't change and your mob goes invisible. This is the reason that MOB_PERSPECTIVE exists.

    You want to switch between EYE_PERSPECTIVE and MOB_PERSPECTIVE accordingly.
client.perspective=EYE_PERSPECTIVE|EDGE_PERSPECTIVE //going to view a camera, so calculate from the eye
client.eye=locate(5,5,1) //view the camera
...
client.perspective=MOB_PERSPECTIVE|EDGE_PERSPECTIVE //going to switch back to viewing the mob
client.eye=client.mob //view the mob


The suffix of |EDGE_PERSPECTIVE turns the EDGE_PERSPECTIVE setting on as well. Remove it if it's annoying.