Place block with all attributes (settings) of other block

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
BigBang1112
Posts: 388
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Place block with all attributes (settings) of other block

Post 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! :?:
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

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

Post 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.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
BigBang1112
Posts: 388
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

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

Post by BigBang1112 »

Oh, I understand.
Thanks for answer, this will be quite wat to make how I want. :shock:
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest