Page 1 of 1

[ManiaScript] Display markers in map editor ?

Posted: 15 Jun 2016, 17:00
by TheBigMiike
Hi everybody,

I'm trying to create a plugin for ShootMania and I want to generate visual elements like markers, lines, ... but it doesn't seems to be possible in the map editor.

Does someone know how to create markers, lines,... in the track editor ?
Is it possible ?

EDIT : At least, a solution for markers would be great. If you know anything else that react like a ghost element and can be placed on a map. Don't hesitate to answer to my topic.

Re: [ManiaScript] Display markers in map editor ?

Posted: 15 Jun 2016, 17:32
by Nerpson
After a deep search in the documentation, I found nothing that allows you to display markers. The only case where markers are displayed in the map editor is when you set the anchor types, like Goals, Starts, and this thing is only available in a MapType script. :?

Otherwise, you can create something that displays some information in a manialink when you point specific blocks. ;)

Re: [ManiaScript] Display markers in map editor ?

Posted: 15 Jun 2016, 17:50
by TheBigMiike
Ty Nerpson :)

Do you know if it's possible to do something like this with ManiaScript ?
Image

If not, it's not a big deal. I'll place a block instead.

Re: [ManiaScript] Display markers in map editor ?

Posted: 15 Jun 2016, 17:58
by spaii
You could set Anchor.Tag, then all you set in this property is visible as marker in editor, this works with items too ;)
(only tested on ShootMania, 3 years ago)

This is a portion of code i wrote for that.

Hope this help.

Code: Select all

// Rename all tags/markers in DefaultTag: impossible to use Hud3dmarkers with position of anchors in editor
// Bug with MLEncode ?
Void RefreshTags()
{
	declare metadata Text[Text][]	MapQuests		for Map;
	declare metadata Text[Text][]	MapCharacters	for Map; //< Value[PropertyName][CharacterId]

	foreach(Anchor in AnchorData)
	{
		declare metadata Text		Name		for Anchor;
		declare metadata Integer	EId			for Anchor;
		declare metadata Integer	QuestId		for Anchor;
		
		Anchor.Tag = "#"^EId^": ";

		if (MapQuests.existskey(QuestId)) Anchor.Tag ^= MapQuests[QuestId]["Name"];
		else Anchor.Tag ^= None();
		
		// Add selected characters name after quest name
		declare metadata Integer[] CharacterId for Anchor;
		
		
		// if all characters associated to this anchor
		if (CharacterId.count == MapCharacters.count)
		{
			if (Anchor.DefaultTag == "Spawn") Anchor.Tag ^= " "^All();
			else Anchor.Tag ^= " "^Anyone();
		}
		else // Display Characters Name
		{
			foreach(CId in CharacterId)
			{
				Anchor.Tag ^= " $z$o$s$000" ^ CM::Name(CId);
			}
		}
	}
}

Re: [ManiaScript] Display markers in map editor ?

Posted: 15 Jun 2016, 19:24
by TheBigMiike
Ty spaii :)

I'll try your code. I'll understand it first because I don't understand how can I place (using position x, y, z) the markers.
After setting Anchor.Tag, How can I place it somewhere in the map ?

EDIT :
I tried and edited the code but I think your code is for markers over poles or spawns.

Re: [ManiaScript] Display markers in map editor ?

Posted: 15 Jun 2016, 19:36
by Nerpson
You can't define X Y Z pos for these anchors. Like I said, they're related to blocks or items.

For the selection, it's quite easy.

Use these:
Image
Click for direct doc link.

Re: [ManiaScript] Display markers in map editor ?

Posted: 15 Jun 2016, 19:58
by spaii
As Nerpson says, it's clearly not possible to place markers yourself in X Y Z position.
1. Add a goal, spawn or item (or anything else that accept AnchorData), on map.
2. Switch CEditorPlugin::PlaceMode to BlockProperty in script.
3. You will see markers you named in Anchor.Tag property

Re: [ManiaScript] Display markers in map editor ?

Posted: 15 Jun 2016, 21:11
by TheBigMiike
Thank you both for your help ;)
I finally used the selection.