Page 1 of 1

Place block with all attributes (settings) of other block

Posted: 25 Jan 2016, 23:00
by BigBang1112
I'm still thinking, if placing block with absolutly all attributes is even possible.
Like blocks placed in a map returns CBlock, that's obvious. But function PlaceBlock needs CBlockModel, which is the actual model with attributes making the visual of it only (very mostly).

As I see CBlock stores all important information like rotation or position, and the CBlockModel itself. But, how about roads?
I think that CBlock holds the "index model" (like turned road, straight road, crossroad etc.), because BlockModels[0] holds the road with short road (index 0), and BlockModels[1] is a completly diffrent block.

:!: So, how is actually possible to place a block with this "kind of index"? Because it's important for my new plugin (and also for my block replacer).

Any ideas, discuss right here! :?:

Re: Place block with all attributes (settings) of other bloc

Posted: 26 Jan 2016, 13:53
by Eole
You can't use the PlaceBlock() function to place this kind of blocks. All road-like blocks that you create by dragging the mouse in the editor can be created with the PlaceRoadBlock() function.

Code: Select all

PlaceRoadBlocks(CBlockModel BlockModel, Int3 StartCoord, Int3 EndCoord)
If you want to create a crossroad or a turn you must call the function two times, exactly like you would do with the mouse in the editor.

Re: Place block with all attributes (settings) of other bloc

Posted: 26 Jan 2016, 15:58
by BigBang1112
Oh, I understand.
Thanks for answer, this will be quite wat to make how I want. :shock: