[ManiaScript] Display markers in map editor ?

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
TheBigMiike
Posts: 1256
Joined: 06 Mar 2013, 16:12
Location: Vendée | France
Contact:

[ManiaScript] Display markers in map editor ?

Post 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.
Image Image
User avatar
Nerpson
Translator
Translator
Posts: 1554
Joined: 27 Sep 2013, 18:02
Location: France
Contact:

Re: [ManiaScript] Display markers in map editor ?

Post 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. ;)
ImageImageImageImage
TheBigMiike
Posts: 1256
Joined: 06 Mar 2013, 16:12
Location: Vendée | France
Contact:

Re: [ManiaScript] Display markers in map editor ?

Post 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.
Image Image
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [ManiaScript] Display markers in map editor ?

Post 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);
			}
		}
	}
}
TheBigMiike
Posts: 1256
Joined: 06 Mar 2013, 16:12
Location: Vendée | France
Contact:

Re: [ManiaScript] Display markers in map editor ?

Post 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.
Image Image
User avatar
Nerpson
Translator
Translator
Posts: 1554
Joined: 27 Sep 2013, 18:02
Location: France
Contact:

Re: [ManiaScript] Display markers in map editor ?

Post 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.
ImageImageImageImage
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [ManiaScript] Display markers in map editor ?

Post 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
TheBigMiike
Posts: 1256
Joined: 06 Mar 2013, 16:12
Location: Vendée | France
Contact:

Re: [ManiaScript] Display markers in map editor ?

Post by TheBigMiike »

Thank you both for your help ;)
I finally used the selection.
Image Image
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 2 guests