Removing invalid solids removed all point entities

Discussion in 'Mapping Questions & Discussion' started by Blinx, Jul 16, 2016.

  1. Blinx

    Blinx L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    39
    I've been having trouble trying to create a torus that doesn't result in an invalid solid that I didn't even realize that a long the way at some point, this removed all point entities and turned all brush based entities into nameless garbage.

    The maps latest VMX is also garbage since there were so many resaves, VMEX and BSPSource fail to decompile the BSP, at the same point it seems too. Any other way in trying to save my map or am I back to square one?
     
  2. Viperi

    aa Viperi not actually a snek

    Messages:
    962
    Positive Ratings:
    533
    Well if the text file is unusable (basically your backup file), then you lost it.
     
  3. Frosty Scales

    aa Frosty Scales

    Messages:
    83
    Positive Ratings:
    34
    There's a hammer bug which removes all the entity classnames, no clue what causes it but i believe it has to do with invalid solids.

    Anyways, if your bsp still has the entities, pop it open in GCFScape, go into the folder "lumps", and open lump 0 in a text editor like notepad++. Here will be all of your old entity data. If I recall correctly you can actually just copy and paste this into the vmf in a certain place (by opening the vmf in a text editor) and it'll work. If not, you can base your new entities off the old ones by recreating it using this data (which means just reading the keyvalues and adding everything in manually)
     
    • Thanks Thanks x 2
  4. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    Excellent idea, Frosty.

    I've had the same problem, but I don't remember what happened exactly. I think it happened whilst I was messing around with cone brush primitives, and I had invalid solids. I think something causes the VMF to become corrupt.

    I think I also had this problem when my autosave frequency was set to one minute. I only tried it for a short time, because I changed back to fifteen minutes very quickly when I had big problems.

    Do you have any autosaves in C:\HammerAutosave?
     
  5. Blinx

    Blinx L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    39
    I do but the first 4 are extremely early versions (like 10-15 minutes into original creation) and the latest one is the broken map.

    Trying out Frosty's suggestion, interesting idea however I can't see how the lump file data structure will fit into the VMF structure, an entity in the lump file looks like this:

    {
    "model" "*1"
    "wait" "0.2"
    "unlocked_sound" "0"
    "unlocked_sentence" "0"
    "targetname" "piano_c1"
    "speed" "0"
    "spawnflags" "1537"
    "sounds" "0"
    "rendermode" "0"
    "renderfx" "0"
    "rendercolor" "255 255 255"
    "renderamt" "255"
    "origin" "-928.04 -1488.55 -9424"
    "movedir" "0 0 0"
    "locked_sound" "0"
    "locked_sentence" "0"
    "lip" "0"
    "health" "0"
    "disablereceiveshadows" "0"
    "classname" "func_button"
    "hammerid" "34165"
    "OnPressed" "snd_c1,PlaySound,,0,-1"
    "OnPressed" "piano_leftvis,Color,32 83 227,0,-1"
    "OnPressed" "piano_leftvis,Color,255 255 255,0.25,-1"
    }

    whereas an entity in the VMF looks like this:

    entity
    {
    "id" "55496"
    "classname" ""
    "damagetoenablemotion" "0"
    "Damagetype" "0"
    "disablereceiveshadows" "0"
    "disableshadows" "0"
    "ExplodeDamage" "0"
    "explodemagnitude" "0"
    "ExplodeRadius" "0"
    "explosion" "0"
    "forcetoenablemotion" "0"
    "gibdir" "0 0 0"
    "health" "0"
    "massScale" "0"
    "material" "1"
    "nodamageforces" "0"
    "notsolid" "0"
    "origin" "193.5 13375.5 -4033"
    "PerformanceMode" "0"
    "preferredcarryangles" "0 0 0"
    "pressuredelay" "0"
    "propdata" "0"
    "renderamt" "255"
    "rendercolor" "255 255 255"
    "renderfx" "0"
    "rendermode" "0"
    "spawnflags" "9217"
    "spawnobject" "0"
    "targetname" "cahw_quotebinds"
    solid
    {
    "id" "55497"
    side
    {
    "id" "16076"
    "plane" "(67 13375 -4224) (67 13375 -3842) (320 13375 -3842)"
    "material" "MAPMATERIALS/IDIOTBOX/CAHWQUOTEBINDS"
    "uaxis" "[1 0 0 -67.4909] 0.992714"
    "vaxis" "[0 0 -1 495.924] 0.748042"
    "rotation" "0"
    "lightmapscale" "16"
    "smoothing_groups" "0"
    }
    side
    {
    "id" "16075"
    "plane" "(67 13376 -3842) (67 13376 -4224) (320 13376 -4224)"
    "material" "MAPMATERIALS/IDIOTBOX/CAHWBACK"
    "uaxis" "[-1 0 0 67.4909] 0.992714"
    "vaxis" "[0 0 -1 495.924] 0.748042"
    "rotation" "0"
    "lightmapscale" "16"
    "smoothing_groups" "0"
    }
    side
    {
    "id" "16074"
    "plane" "(67 13376 -4224) (67 13376 -3842) (67 13375 -3842)"
    "material" "SKYBOX/SKY_FAKE_WHITE"
    "uaxis" "[0 0 -1 30.609] 0.997389"
    "vaxis" "[0 1 0 -63.5] 2"
    "rotation" "0"
    "lightmapscale" "16"
    "smoothing_groups" "0"
    }
    side
    {
    "id" "16073"
    "plane" "(320 13376 -3842) (320 13376 -4224) (320 13375 -4224)"
    "material" "SKYBOX/SKY_FAKE_WHITE"
    "uaxis" "[0 0 1 -5.94202] 0.997389"
    "vaxis" "[0 1 0 -63.5] 2"
    "rotation" "0"
    "lightmapscale" "16"
    "smoothing_groups" "0"
    }
    side
    {
    "id" "16072"
    "plane" "(67 13376 -3842) (320 13376 -3842) (320 13375 -3842)"
    "material" "SKYBOX/SKY_FAKE_WHITE"
    "uaxis" "[-1 0 0 9.05545] 1.13453"
    "vaxis" "[0 1 0 -63.5] 2"
    "rotation" "0"
    "lightmapscale" "16"
    "smoothing_groups" "0"
    }
    side
    {
    "id" "16071"
    "plane" "(320 13376 -4224) (67 13376 -4224) (67 13375 -4224)"
    "material" "SKYBOX/SKY_FAKE_WHITE"
    "uaxis" "[1 0 0 -45.3413] 1.13453"
    "vaxis" "[0 1 0 -63.5] 2"
    "rotation" "0"
    "lightmapscale" "16"
    "smoothing_groups" "0"
    }
    editor
    {
    "color" "220 30 220"
    "visgroupshown" "1"
    "visgroupautoshown" "1"
    }
    }
    editor
    {
    "color" "220 30 220"
    "visgroupshown" "1"
    "visgroupautoshown" "1"
    "logicalpos" "[0 2500]"
    }
    }

    (obviously not the same entity)

    Unless I'm not seeing the right place to copy/paste the lump data into the VMF this doesn't seem plausible.
     
  6. Frosty Scales

    aa Frosty Scales

    Messages:
    83
    Positive Ratings:
    34
    Yeah, I forgot that brush entities kinda break up the structure.

    (Edit: You could maybe just copy the entity block of the vmf of a failed decompile and try that in your original; you should probably try that first.)

    You could try using notepad++ in your lump 0 file to replace { with entity\n{ . After that you would want to create a new vmf with any entity in it, and paste the lump file into that vmf, wherever it looks like it fits. (Do not include the entity called worldspawn which would be the first in the lump) Close the map and reopen it, and if it works you should have all of your point entities back within that new vmf. go into the entity report and delete anything labeled as a brush entity in the new vmf. Then copy all of your point entities, go back to your old vmf, go into the entity report and remove any of the "empty" point entities, and then hit Edit > Paste Special in hammer, and tick Start at center of original and hit OK. You should now have all of your point entities back, but I don't think there's any way to salvage any of the brush entities, you would have to re-enter the entity type for each one. (With this bug, hammer does still have the keyvalues for the brush entities so you just need to define them all as trigger_multiple, func_button, etc.)
     
    • Thanks Thanks x 1
  7. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    You could try importing the entity data lump to a newly-compiled version of your map with no entity data, either during the compile process somehow or manually using VIDE's Entity Lump Editor.
     
  8. Blinx

    Blinx L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    39
    This has worked the best so far, I've got most of my point entities back, unfortunately the point at which the decompile fails is during the gathering of point entity data it seems so I can only get about 75% of the stuff back but it's a lot better than 0, so thanks for this. Does anyone know of alternative decompiling software? I noticed the decompiled map pack has a lot of maps that BSPSource failed at decompiling for me which makes me think it used a different program.
     
  9. Frosty Scales

    aa Frosty Scales

    Messages:
    83
    Positive Ratings:
    34
    Are you sure you're using the latest version of BSPSource? If you are, try ticking Load lump files and Debug mode on the Other tab.
     
    • Thanks Thanks x 1
  10. Blinx

    Blinx L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    39
    Oh well F me, the latest version of BSPsrc successfully decompiled it and I've pretty much got my old uncorrupted map back lol, I figured it wasn't being updated and I just had to accept that a map that couldn't be decompiled by it never could be.

    I guess at the end of this I've learnt that trying to make torus' is a lost cause.

    [​IMG]