Validating a custom game type map

Talk about the map editor here

Moderator: English Moderator

Post Reply
wDaan
Posts: 10
Joined: 25 May 2013, 19:20

Validating a custom game type map

Post by wDaan »

Hey everyone,

I am trying to get the following custom map code to validate. As of now all it should check is if there is one spawn labelled 'Spawn' with order '0'. Whatever I try the editor keeps telling me 'map cannot be validated' as if somehow the script is faulty. Note that even though anchors shouldn't be editable (option set in main method) they are, leading me to believe something in my script is wrong indeed.

Code: Select all

#RequireContext CSmMapType
#Include "Libs/Nadeo/Anchor.Script.txt" as Anchor
#Const Version "2013-05-25

#Include "TextLib" as TL

// Initialize the anchors

Void InitAnchors() {
	foreach (Data in AnchorData) {
		Data.Tag = Data.DefaultTag;
		if (Data.DefaultTag == "Spawn") {
			Data.Order = Data.DefaultOrder;
		}
	}
}

// Check map validity
Void UpdateValidability() {
	InitAnchors();
	Anchor::UpdateAnchorCounts();
	
	if (!Anchor::HasAtLeastOneAnchor("Spawn", 0, TL::Compose(_("Place at least one spawn."))) {
		return;
	}
	
	ValidationStatus = CMapType::ValidationStatus::Validated;
}

main() {
	InitAnchors();
	UpdateValidability();
	CustomEditAnchorData = False;
	while (True) {
		yield;
		ManialinkText = "";
		foreach (Event in PendingEvents) {
			if (Events.Type == CPluginEvent::Type::MapModified) {
				UpdateValidability();
			}
		}
	}
}
It appears really straightforward from the examples but yet I can't get it to work. Any help would be appreciated.
Last edited by wDaan on 25 May 2013, 19:39, edited 1 time in total.
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Validating a custom game type map

Post by steeffeen »

Code: Select all

#Const Version "2013-05-25
isn't there a " missing?
try pressing Ctrl+G to see the log, there you will see an error that the script isn't running properly
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    wDaan
    Posts: 10
    Joined: 25 May 2013, 19:20

    Re: Validating a custom game type map

    Post by wDaan »

    Thanks for your reply. Feel really retarded for missing that one but I was debugging by hand. This log is very useful and will probably help me solve the problems. Thanks.


    EDIT: the issue at hand is fixed. Problems were just a couple of small errors which were easily fixed through the compiler log.
    Post Reply

    Return to “Map Editor”

    Who is online

    Users browsing this forum: No registered users and 2 guests