AndrewScheidecker / BrickGame

A demo of Minecraft-style voxel rendering in UE4
399 stars 145 forks source link

where and when are the differents materials for bricks added in the brickgrid gridparameters? #12

Closed yoskeleton closed 9 years ago

yoskeleton commented 9 years ago

I cant find this in c++ code neither in blueprint or default values

where and when did you add thoses differents bricks materials in the gridparameters structure ?

Thanks for help

Ryvar commented 9 years ago

Click on your placed BrickGrid blueprint actor in your map, in the "BrickGrid" section, expand "Grid Parameters": "Materials" should be the first array, and by default has 25 entries.

However, which materials are actually used by the terrain generator is pure C++ and can be found in Plugins/BrickTerrainGeneration/Private/BrickTerrainGenerationLibrary.cpp - the function you want is InitRegion, particularly the big for loop at the end where terrain falls into rock/dirt/grass based on a few conditional cases.

If you're interested in expanding BrickGrid, one of the first things I'd suggest doing is moving terrain generation functionality into a dedicated actor or component class, and adding your own InitRegion function with ", BlueprintNativeEvent" after BlueprintCallable in the declaration: this gives you the ability to retain the C++ implementation but override it in Blueprint.

Noxygen commented 9 years ago

I was asking myself the same question - probably that's the reason: unbenannt-1 I'm using UE 4.8 and there is no arrow to expand the Grid parameters.

Ryvar commented 9 years ago

My bad, forgotten I'd fixed this in my local version: In Plugins\BrickGrid\Source\BrickGrid\Classes\BrickGridComponent.h find the FBrickGridParameters struct and change the UPROPERTY of all variables from EditDefaultsOnly to EditAnywhere

Noxygen commented 9 years ago

Great, thanks! ;)

AndrewScheidecker commented 9 years ago

Thanks Ryvar. I've just pushed commits that incorporate your EditAnywhere change along with the other changes necessary for UE4.8.