Retrieve spectator cameras coordinates from BSP?

Discussion in 'Mapping Questions & Discussion' started by teamwork.tf, Nov 7, 2017.

  1. teamwork.tf

    teamwork.tf L1: Registered

    Messages:
    20
    Positive Ratings:
    31
    Hi, me again with a BSP file question! I've been looking into ways of exporting maps to either 3D formats, or just plain creating a better repository with accurate images, as the current sets seems to be a bit messy (outside for the TF2Maps repository).

    Anyway, thanks to some helpful tutorials from TF2Maps, I learned about the existence of vbspinfo.exe, a utility which can provide the bounds of a map, given a BSP map. This is very useful with automation of screenshots, as I can use these coordinates to determine an accurate cl_leveloverview scale. So I can create (relatively okay-ish) automated level overview screenshots.

    However, is there a utility or way to retrieve what the coordinates of spectator cameras are in BSP's? I could not find any resources.

    Also vbspinfo.exe does not seem to work on every map. Something about a Lump error? Can this be resolved in an automated manner (e.g. not decompiling to vtm, open in hammer and re-save)?
     
  2. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    793
    Positive Ratings:
    235
    Open the map in TF2 and join spectator. Then type 'getpos' in the console. It will feed you the exact location and angle you're facing.
     
  3. henke37

    aa henke37

    Messages:
    1,945
    Positive Ratings:
    461
    Or just peek at the entdata lump. It's the list of all the entities placed by the map and then some. You should have no issue finding the instances of the info_observer_point entity class and by extension the position, angle and FOV for each of them.

    As for the lump error, it's likely that the map has per lump compression. Older tools don't expect that and don't know how to decompress the lumps. You should be able to losslessly decompress lumps using the bspzip command. Note that I say should. I don't trust the implementation to be bug free.
     
    • Thanks Thanks x 1
  4. teamwork.tf

    teamwork.tf L1: Registered

    Messages:
    20
    Positive Ratings:
    31
    Thanks for the tips! I'm now writing a script which retrieves the spectator camera's by decompiling the bsp's with BspSource to VMF, which seem to contain the info_observer_points.

    Once it's worked out I will publish it for anyone to use as they wish.
     
  5. henke37

    aa henke37

    Messages:
    1,945
    Positive Ratings:
    461
    Decompiling is a lot of work compared to just reading the entdata lump. Decompiling is also far from an accurate affair.
     
    • Agree Agree x 1
  6. teamwork.tf

    teamwork.tf L1: Registered

    Messages:
    20
    Positive Ratings:
    31
    In that case I will try out extracting the entdata lump from the bsp instead. Thanks for the tip!
     
  7. Exactol

    aa Exactol Certified Hammer Hacker

    Messages:
    401
    Positive Ratings:
    472
    I've extracted data from bsps before, feel free to send a message if you need any help.