Writing a Pakrat replacement

Discussion in 'Mapping Questions & Discussion' started by Terr, Sep 16, 2009.

  1. Stormcaller3801

    Stormcaller3801 L5: Dapper Member

    Messages:
    249
    Positive Ratings:
    28
    I'm continuously running into this error:

    Valve Software - bspzip.exe (May 19 2009)
    Error opening C:\Program Files\Steam\steamapps\stormcaller3801\team fortress 2\tf\maps\koth_getting_medieval_b2a.bsp! (Check for write enable)


    Here's a full dump of the contents of the text area, in case that helps at all:

    The file's there, nothing else is accessing it, and it isn't set to be read-only. And it's certainly not corrupt, as I'm doing this shortly after building cubemaps.
     
  2. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    Interesting: That error's coming from BSPZIP.

    It looks like BSPZIP does not support editing the file "in place". Your new file needs to be different from the original file.
     
  3. Stormcaller3801

    Stormcaller3801 L5: Dapper Member

    Messages:
    249
    Positive Ratings:
    28
  4. Nineaxis

    aa Nineaxis Quack Doctor

    Messages:
    1,767
    Positive Ratings:
    1,409
    Skyboxes don't seem to pack correctly.
     
  5. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    Nineaxis: Any details?

    ___________________

    Well, I'm still alive. Been busy-but-not-as-much-as-I-ought-to-be sending out resumes 'n stuff.

    I've decided to dive into some of the C++ code in the SDK now to try to access the GCFs the "right way", and I feel really silly: I was assuming the source code I really wanted wasn't there in the SDK, but it turns out I need to do that "Create A Mod" SDK menu item to get the sources.

    I anticipate a lot of kicking myself for having spent weeks reverse-engineered something the hard way (and conducting shot-in-the-dark koders.com and google searches for keywords) because I didn't realize I could find such a plethora of topical made-by-valve source code so easily. :facepalm:

    Well, learning experience, amirite? :closedeyes:
     
  6. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,521
    Good to hear you're making progress, as usual. Keep up the good work and I'm willing to run a few test compiles/packings if needed!
     
  7. psihomir

    psihomir L4: Comfortable Member

    Messages:
    192
    Positive Ratings:
    32
    Terr, I haven't been able to go through the entire thread, so I'm not sure if this is covered (we'll I do see Nineaxis's post above), but anyway I used this to pack some stuff into a map of mine last night and it missed one model (included others fine), some prop textures, as well as the skybox textures.

    The custom model was in models/props_enclave/

    Here's the log:

     
  8. megawac

    megawac L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    29
    Is there any way to pack HUD textures (control point sprites) with this... I just tried and noone else could see them unfortunately.
     
  9. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    psihomir: What kind of way was the missing model being used? Regarding model-materials, it looks like the only "custom" models it saw were two from the swamp pack, signpost001.mdl and buttress_tree_small_ref.mdl, and found one material for each of them.

    megawac: IIRC that was implemented in that version... Can you PM me the debug output? It's in a separate file as detailed in the README.txt.

    I have to admit that I'm at a place where I'm having problems remembering the differences between the version-that-was-released versus the-version-that-isn't-ready-for-release.
     
    Last edited: Feb 2, 2010
  10. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    psihomir: If you want to post or PM the detailed debug log (which is a separate file, not shown in the GUI) I'll try to figure out what it is/isn't doing with your skybox and props.

    megawac: Got your PM. Interesting.

    Regarding the HUD elements, it looks as if it scanned your custom material, but the texture defined matches one that's already in the game.

    In case it is what you were trying to do, PackBSP will not process any material/texture/etc. which happens to have the exact same name as one which ships with TF2. IIRC that's because it can cause nasty side-effects for end-users, like a custom hud for map A which then continues to be used on map B.
    Code:
    20:33:53,719 INFO  [CmdlineRun] OKAY	{PackableNodeImpl:MATERIAL materials/mytextures/hud/icon_obj_blu_my.vmt}
    20:33:53,821 INFO  [CmdlineRun] ARCHIVED	{PackableNodeImpl:TEXTURE materials/sprites\obj_icons/icon_obj_blu.vtf}
     
    • Thanks Thanks x 1
  11. megawac

    megawac L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    29
    Good eye... I made the vmt point to the wrong file thanks. :O
     
  12. Kataan

    Kataan L1: Registered

    Messages:
    9
    Positive Ratings:
    0
    People are too GUI-greedy, a command line isnt hard to use.
     
  13. Spammish

    Spammish L3: Member

    Messages:
    117
    Positive Ratings:
    34
  14. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    It's easy to make the wiki :p

    I'm just trying to add more test-cases for the FGD handling stuff, since I've got a bunch of the HL2-parsing stuff in it's own library which I somedayâ„¢ I want to release. In addition to reading the file, it needs to apply all the little inheritance/import rules in the right way.
     
  15. Freyja

    aa Freyja It hurt itself in it's confusion!

    Messages:
    2,894
    Positive Ratings:
    5,239
    When I used this yesterday it worked half-great. it packed all my model textures and particles, which was awesome, but it missed my custom ice texture. It was just a wireframe in game.
    I put the output from PackBSP through pakrat and pakrat picked up the missing textures fine.
     
  16. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    Could you PM/post the detailed debug log (separate file created in the directory on each run) and what VMT or VTF was missing?
     
  17. Freyja

    aa Freyja It hurt itself in it's confusion!

    Messages:
    2,894
    Positive Ratings:
    5,239
    Okay. When I'll do that this afternoon
     
  18. Freyja

    aa Freyja It hurt itself in it's confusion!

    Messages:
    2,894
    Positive Ratings:
    5,239
    Alright. I scrolled through the log and this caught my eye.

    Code:
    16:21:17,472 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-2427_94_-120
    16:21:17,473 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_1112_480_-136
    16:21:17,474 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/winter/ice_002_1325_-866_-142
    16:21:17,474 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_3347_416_-182
    16:21:17,475 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-3652_-127_-120
    16:21:17,475 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_2816_-1519_-56
    16:21:17,476 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_1325_-866_-142
    16:21:17,476 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/winter/ice_002_-1496_-1440_-136
    16:21:17,476 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_2043_-1054_-120
    16:21:17,477 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-256_-824_-142
    16:21:17,477 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/winter/ice_002_1112_480_-136
    16:21:17,479 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-3200_559_-56
    16:21:17,479 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-3731_-1376_-182
    16:21:17,479 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/iceground001_-1709_-93_-142
    16:21:17,480 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/iceground001_-128_-136_-142
    16:21:17,480 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/winter/ice_002_-128_-136_-142
    16:21:17,480 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/winter/ice_002_-256_-824_-142
    16:21:17,480 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/winter/ice_002_-1709_-93_-142
    16:21:17,481 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/iceground001_1325_-866_-142
    16:21:17,481 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-128_-136_-142
    16:21:17,481 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-1709_-93_-142
    16:21:17,481 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_3268_-832_-120
    16:21:17,482 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-1496_-1440_-136
    16:21:17,482 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_2176_136_8
    16:21:17,482 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-2560_-1096_8
    16:21:17,483 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/iceground001_-256_-824_-142
    16:21:17,483 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_-3036_-384_-176
    16:21:17,483 DEBUG [Crawler] Skipping material, it's probably a cubemap: materials/maps/ctf_cloudburst_a12a/nature/snow_full001_2652_-575_-176
    I'm guessing thats the source of the problem.
    If you need it, here's the full log:

    http://dl.dropbox.com/u/2347130/cloudburst/packbsp_debug.log
     
  19. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,546
    All cubemap materials start with a "c" in their name, followed by the coords. I dunno how or where you are running this check but you should add that rule in.

    I also noticed this in the log, you've got it looking for the the wrong extension on there.
    16:21:46,996 WARN [CmdlineRun] Expected asset not found: {PackableNodeImpl:MISC materials/vgui/maps/menu_photos_ctf_cloudburst_a12a.vmf}
     
    Last edited: Feb 18, 2010
  20. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    D'oh. Yes, I indeed made quite a few blunders in that piece of code. I was probably looking at the wrong files at the time.