Vision and Camera Control

edited January 2015 in General

As title says, I got two questions regarding vision and camera.

1) I want to allow players to increase camera view higher than default value in Dota 2. Would it be as easy as adding one line to lua script, or do I need some special arrangement? Another thing I'd like to do is locking camera to certain location for the duration of spell. Couple months ago I saw some custom game with camera lock button so it seems doable, can't find it though.

2) I got some terrains going in my map, but terrain on flat ground doesn't seem to be obstructing vision. In this picture, you can see that the house on the left side of hero is not hindering vision at all. It is basically just a house model I imported with Skip block inside, so I guess there's more to creating terrain when it comes to sight. Do I need different kind of texture?


  • edited December 2014 Posts: 1,670

    1) Basic camera height can be changed with this:

    GameRules:GetGameModeEntity():SetCameraDistanceOverride( number )

    Default dota distance is 1134. This is shared between all players, there's no way to set different heights that I know off.

    I posted the camera lock button here, it's a very simple flash actionscript and I use it for Warchasers, as trying to lock the camera to a player needs to be send to each client console and Flash is the only way to do this.

    To set the camera position to an specific place, well... I tried many things, and I couldn't get a solution that worked properly, I think camera controls are unfinished or bugged at the moment.

    The things I tried were:

    • PlayerResource:SetCameraTarget(killerEntity:GetPlayerOwnerID(), killedUnit)

    • AddNewModifier modifier_camera_follow over some entity

    Can't remember now exactly but I think SetCameraTarget can only be done once per game or it bugs if you try to change it more than once in a row. The modifier_camera_follow method might unstick very quickly or not work at all, but try it!


    Don't know anything about textures but you could use the point_simple_obstruction entities:


    These let you block vision and fog of war, and can be dynamically enabled/disabled

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • DunDun
    edited December 2014 Posts: 123

    Thanks. I believe obstruct entity has fixed size no matter how big what belonging block is? I applied it to skip blocks from as small as 64x64 to 1k wide ones but they all seem to have same vision obstruction.

  • your models look fancy!

  • Posts: 13

    Hey Dun, if you still need a way to obstruct vision with your models, you can use ent_fow_blocker_node and outline the houses with it (press Ctrl+Q and place nodes around the house on the outer squares). This will provide the effect you desire :)