Map Editor API: Items and ghost blocks

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
Posts: 342
Joined: 20 Jul 2015, 12:44
Location: Český Krumlov, Czech Republic

Map Editor API: Items and ghost blocks

Post by BigBang1112 » 08 Nov 2019, 14:33

So, I have spent nearly a thousand hours over the last 6 months coding in ManiaScript and finally, as Challenge is currently up and stable, I have a lot of time to write feedback about my experience.
This is just the beginning of what problems I was facing which took me an enormous amount of time to find a solution for. More posts are coming soon.

The biggest and hardest problem of all, lacking script availability for items and ghost blocks...

Speaking about my usage of Map Editor API, I used it literally entirely. I have to say it can do a lot. It was a lot of fun to use it. Challenge works pretty much only because of it. In that project, I've written a wrapper of the static code for the Manialink code (layer code), so that the instructions for modifying a track are changeable with Manialink components in real time without having to update the title pack package or something similar. I packed this wrapper into Challenge API, which contains over 100 functions, more than half of them straight taken from CMapEditorPlugin.

But, even though it doesn't seem like, modifying a track wasn't the only thing I had to wrap. Tracks can have problems. Track can be super various, some instructions have to be defined by an individual, because the map doesn't have the required information - like which finish to replace with start block - there's no definition of which finish is the main one. But that's not my main problem anyway, sometimes it's good to give people an option. Problem solving had to come to a place someday.

To the actual items and ghost blocks:

Modifying works good on Nadeo maps, but when I had come to see the custom tracks by users, oh boy, the disappointment was real. More than half of these maps used ghost blocks or items! And the Map Editor API can't even work with them! It even almost lose me motivation at one point, but I luckily found some solutions to detect items and ghost blocks:
  • Ghost blocks are still available in Blocks array
  • To detect ghost block via model, coord and direction
    • Scroll through every block on the map and see if all these 3 points meet. Also, compare by using GetBlock to see if the block is actually ghost block (as GetBlock detects only regular blocks)
  • Decoration items are not available at all, you can only detect items that are considered as anchor (Start, Checkpoint, Multilap, Finish and Dispenser or whatever that is xd)
  • To detect regular items
    • As item is (probably) considered as CItemAnchor, you only have its position available, no rotation or item identification!
    • Simply you have practically nothing to do
  • To detect waypoint (anchor) items
    • You can use the AnchorData array which still, however, can be block or item and it's a struggle to work with. But it at least gives a bit more info. Still no item rotation though...
Already just at this point, I knew that stuff won't get easier further on.
So there are two things you would expect: Removing and placing items or ghost blocks. Actually NOPE.
  • There's absolutely nothing that would make us place individual items with a script!
  • There's absolutely nothing that would make us place individual ghost blocks with a script!
    • BUT, for this one we found one solution: Macroblocks can store ghost blocks. So yes, we made a lot of single block macroblocks (not all indeed, the important ones), and to that, as macroblock can be only one variant, we had to make Ground, Air, and sometimes even Forest and Field variants. Then I had to create a system that chooses one or another macroblock depending on the place position. It took hours, just for the waypoints of each environment.
  • There's absolutely nothing that would make us remove individual ghost blocks with a script!
  • Placing ghost items is just a joke at this point I guess.
  • There's actually something that can be used to remove items. It's a function called RemoveItem. It is only able to remove anchors though and it can't remove ghost anchors.
From this in mind, in Challenge, I made up a lot of problems, solutions, and solving in my official modification scripts that it's even too much in my opinion. I still didn't manage to get it stable yet and it makes users confused and I can't do anything about it, and if I can, it's a lot of annoying work.

Also, about the latest update: Great stuff, I definitely don't want to criticize any of it, I'm so glad that Map Editor API is still alive, but I feel like there's some step back happening... CItemAnchor, the closest thing to an item, which still only handles Position - has been replaced to just Position in CAnchorData. Is CItemAnchor about to get deprecated? Deprecating a class that is the closest we've got for item script support? Items, the most used map editor element, with the least scripting features? Who is using only blocks these days?

So, to sum this mess entirely, I'll rewrite this into briefer suggestions:
  • First of all, more item information available, please, revive CItemAnchor, it's been 6 years (maybe even more) since we got items in Maniaplanet and all we can script is to, see its position?
  • Make us able to manipulate items more, place them, remove them, check by a file name, all of this like currently available for macroblocks.
  • Add something like GetBlock, but for ghost blocks. Give us an additional variable for CBlock that defines if its a ghost block, like Boolean IsGhost. 4 or 5 years since we got official ghost block support, and nothing available in scripting. :(
  • More manipulation with ghost blocks is also quite needed and I would personally heavily appreciate it. Removing and placing blocks as a ghost is enough I think. Barely any map these days doesn't use ghost blocks.
These things may be also a reason why people just don't create content for map editor scripting frequently. All ideas are more or less connected to ghost blocks or items.

Also, not really part of the API thing, but it would be awesome for macroblocks to support 64x64 block size or just that it could be more flexible. It would be appreciated not only in the TMUF remake title packs.

Thank you so much Nadeo for listening to your community, it really makes the game a beautiful content creation place. I never felt more motivated to script this much before. But, it's been a long time dreaming about scriptable items/ghost blocks.

If anyone here wanted to get the best out of scripting items and ghost blocks, glad I could help/answer you in some way. :D

Similar topics:
Last edited by BigBang1112 on 08 Nov 2019, 23:50, edited 8 times in total.
Creator and competent racer. YouTube Discord
- Nadeo Envimix (remake coming later this year)
- Videomaker (coming 2020)
- Challenge (OUT NOW)
- Compute Shadows

Posts: 973
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland

Re: Map Editor API: Items and ghost blocks

Post by reaby » 08 Nov 2019, 15:36

For what I know, community established project: Grand 2 - a multiplayer mapeditor, could also heavily benefit proper items api as well... as currently it is only possible to place blocks!

User avatar
Posts: 1348
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko

Re: Map Editor API: Items and ghost blocks

Post by adamkooo2 » 08 Nov 2019, 18:52

I really support this idea :1010

I the improvement of item and ghost-blocks api would definitely help some projects - Challenge, TM2 Island, TMOne, ...
I'm sure community really wishes this feature, as I recieved a lot of complains about how slow the building of maps using (only) items is.
Last edited by adamkooo2 on 08 Nov 2019, 19:31, edited 1 time in total.

User avatar
Posts: 95
Joined: 15 Jul 2016, 17:26
Location: Poland , Tychy

Re: Map Editor API: Items and ghost blocks

Post by CatWithScarf » 08 Nov 2019, 19:21

+1 on this.

User avatar
Posts: 2
Joined: 16 May 2019, 19:03

Re: Map Editor API: Items and ghost blocks

Post by LeGmask » 08 Nov 2019, 21:44

Hey, yes for Grand 2, I have the same problem if we can have support for ghost block and Item, it will be amazing. In fact, I disabled these features, but it bothers me to deliver a job that is not fully functional. I hope you listen to us and that this API will be fully functional. :thumbsup:


Posts: 2
Joined: 18 Jun 2019, 22:45

Re: Map Editor API: Items and ghost blocks

Post by Sigeth » 10 Nov 2019, 20:44

Just do it :1010: :thumbsup:

Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 0 guests