Transparent Rendinst

I am looking for a way to create transparent rendinsts. I have tried creating new ones bases on _preview rendinsts but they disappear. Adding semi_transparent_render to a rendinst entity doesn’t work.

1 Like

Need to create preview entity with network_fortification_preview and then set previewTeam. You also can edit time in destroyInactiveTimeOut.

For edit rendinst you need change ri_preview__name.

Using entities.blk you can make it visible even if you not use engineer tools (need to remove onlyForEngineer tag). And/or remove time totally.

Entities.blk code.
network_fortification_visible_preview{
  _use:t="replicating"
  _use:t="semi_transparent_render"
  _use:t="shred_outside_battle_area"
  _use:t="fortification_builder_info"
  _use:t="fortification_ai_target"
  previewTeam:i=-1
  buildingCost:r=0.0
  maxCostReturnedOnDestructionMul:r=1.0
  costReturnedOnDestructionMul:r=1.0
  selectedPlacingColor:p3=0.2, 0.2, 0.2
  enemyPlacingColor:p3=0.2, 0.0, 0.2
  previewColor:p3=0.1, 0.1, 0.1
  visibleDistance:r=100.0
  actionTimerColor:p3=0.0, 255.0, 0.0
  _replicated:t="building_builder__timeToBuild"
  buildingRadius:r=0.0
  buildingCenterOffset:p3=0.0, 0.0, 0.0
  buildTypeId:i=0
  buildingCostructedAtTime:r=0.0
  building_builder__maxTimeToBuild:r=10.0
  building_builder__timeToBuild:r=5.0
  building_builder__distanceVerifyThreshold:r=1.5
  grid_obj__gridType:t="vehicles"
  grid_obj__fixedTmScale:r=1.0

  "builder_server_preview:tag"{
  }

  _group{
    _tags:t="server"
    obstacle__initialStillTimeout:r=0.0
  }

  grid_obj{
  }

  "blockTerraform:tag"{
  }
}

Well… And yeah… It will not have collsion.

Here is rendinst preview entities code (these entities already in game).
base_builder_preview{
  _use:t="semi_transparent_render"
  nextCheckGridObjectsTime:r=0.0
  preview_render__enabled:b=yes
  buildingCost:r=1.0
  checkGridObjectsTimeInterval:r=0.3
  transform:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [0.0, 0.0, 0.0]]
  avaliableAngles:p2=-30.0, 30.0
  buildingDistance:r=3.0
  avaliableColor:p3=0.0, 0.2, 0.0
  blockedColor:p3=0.5, 0.0, 0.0
  warningColor:p3=1.0, 0.55, 0.03
  additionalHeight:r=0.0
  buildingBoxMin:p3=0.0, 0.0, 0.0
  buildingBoxMax:p3=0.0, 0.0, 0.0
  buildingNorm:p3=0.0, 0.0, 0.0
  additionalBuildingTemplate:t="base_fortification_build"
  buildingSoundTag:t="fortification"
  yawRotationSpeed:r=90.0
  additionalYawRotation:r=0.0
  _tracked:t="additionalYawRotation"
  building_inclination_angle__gridWidth:i=2
  building_inclination_angle__terraformedAvailableAnglesMult:r=2.0
  building_inclination_angle__modifiedHeightEpsilon:r=0.1
  building_inclination_angle__maxAllowedHeightDelta:r=1.0

  "build_attach__riexHandle:u64"{
    value:i64=-1
    _tags:t="server"
  }

  "builderGunEid:eid"{
  }

  "builder_preview:tag"{
  }

  "building__canDismantle:tag"{
  }
}

base_rendinst_builder_preview{
  _use:t="base_builder_preview"
  semi_transparent__resIdx:i=-1
  ri_preview__name:t="sandbags_wall_medium_rounded_a"

  riPreviewResPreload{
  }
}

sandbags_wall_2_preview{
  _use:t="base_rendinst_builder_preview"
  instantiateTemplate:t="sandbags_wall_2"
  ri_preview__name:t="sandbags_wall_medium_rounded_a_mission_object"
  savePreviewTeam:b=yes
  buildingSoundTag:t="fortification"
  building_builder__maxTimeToBuild:r=3.0
  building_menu__text:t="building_tool/sandbags"
  building_menu__image:t="building_wall"
}

You can clean code a bit.

2 Likes