Ali_Akbar
(Ali_Akbar)
April 4, 2019, 8:43am
2458
uced:
Dear,
I managed to paint cells from my code.
From this:
I got this:
Which is great.
The rest is just a matter of using arrays, looping, making a UI and so on.
By the way, there is a small bug in the GameState BP of the DA starter pack, surely due to using old code. The AddPaintedCell and RemovePaintedCell don’t take a location as an input, instead they take a CellData which has to be built from the location like this:
So after fixing this i just had to find the static AddPaintCell and everything was all right, i’m going to have to save and replicate the PaintedCells array.
Now i have a last question.
The UGridDungeonToolData also contains 2 others arrays that are used in the Editor Paint Mode: Rectangles and Borders.
But i don’t see any way to use them in the UGridDungeonModelHelper.
Did you put any AddPaintedRectangle, RemovePaintedRectangle, AddPaintedBorder and RemovePaintedBorder functions somewhere else, or do i have to write my own functions and loop over the rectangles/borders to call the AddPaintedCell/RemovePaintedCell for each cell in the rectangle/border ?
Thanks and regards
@uced I didn’t end up using them, instead the tool rasterizes the rectangles and borders down to individual cells in code (loops and adds NxM unique individual cells to the PaintedCells array)
You can have a look at the tools on how they do this:
DungeonArchitectEditor\Private\Builders\Grid\EditorMode\Tools\GridDungeonEdToolRectangle.cpp [FGridDungeonEdToolRectangle::BuildDungeon]
DungeonArchitectEditor\Private\Builders\Grid\EditorMode\Tools\GridDungeonEdToolBorder.cpp [FGridDungeonEdToolBorder::BuildDungeon]