Page 1 of 2

EditorPlugins scripting issues

Posted: 08 Jun 2016, 16:02
by Florenzius
Hey,

I need help too. Idk what's wrong. It's the right format...

It doesn't brings an error, but it's not showed in my editor...

Code: Select all

#RequireContext CEditorPlugin

Text CreateManialink()
{
	declare Integer MaxBlocksCount for ManialinkPage;
	declare Ident[Integer] BlockModelIds for ManialinkPage;
	declare Text[Integer] BlockModelNames for ManialinkPage;
	//Working
	declare MLText = """
	<quad posn="-138 20.5 1" sizen="9 9" bgcolor="FFFA" style="Icons64x64_1" substyle="ArrowDisabled" rot="-3"/>
	<quad posn="-58 24.8 1" sizen="9 9" bgcolor="FFFA" style="Icons64x64_1" substyle="ArrowNext" rot="-3"/>
	<label posn="-115 19 0" sizen="44 5" text="THE PERFECT MAP" rot="-3"/>
	<label posn="-129.5 -23 0" sizen="66 4" text="Pluginversion 0.1.1 by $069ԍτx$fff»$i$069f$ffflorǝи$069ɀ$fffιus" rot="-3" tex		tsize="1"/>
	<label posn="-132 9 0" sizen="80 5" text="Welcome to your new mapping-coach!" rot="-3" textsize="3" autonewline="1"/>
	<label posn="-130 -18 0" sizen="80 5" text="Good luck and have fun! :)" rot="-3" textsize="3" autonewline="1"/><label posn		="-131 1 0" sizen="81 17" text="In this short guide you will learn some cool tricks for perfect maps. In <number> sites yo		u'll get the best tricks and some example pictures and maps to test!" rot="-3" textsize="2" autonewline="1"/>
	<quad posn="-141 23 0" sizen="95 14" bgcolor="FFFA" style="Bgs1InRace" substyle="BgTitle3_4" rot="-3"/>
	<quad posn="-141 23 0" sizen="95 14" bgcolor="FFFA" style="Bgs1InRace" substyle="BgTitle3_4" rot="-3"/>
	<quad posn="-138.5 18 -1" sizen="90.5 78" bgcolor="FFFA" style="Bgs1InRace" substyle="BgGradTop" rot="-3"/>	""";
	return MLText;
}

main() {
	// Without multiples layers :
	ManialinkText = CreateManialink();
	// With 
	declare Layer1 <=> UILayerCreate();
	Layer1.ManialinkPage = CreateManialink();
}

//Test
//If you can help me, you can choose between kek and pasta
Who can help me gets a kek ;)

Thanks :D :thx:

Re: EditorPlugin doens´t show my manialink [fixed]

Posted: 08 Jun 2016, 17:15
by maxi031
ManiaDesign wrote:Hey,

I need help too. Idk what's wrong. It's the right format...

It doesn't brings an error, but it's not showed in my editor...
Your plugin is fine, you have some typos in manialink that is why you do not get any compiler error.
Pay attention next time to manialink strings, it is very easy to make little typo that will cancel whole manialink.
Next time if your plugin compiles but does not displays manialink look for typos in your manialink string.

Here is your code fixed:

Code: Select all

#RequireContext CEditorPlugin

Text CreateManialink()
{
   declare Integer MaxBlocksCount for ManialinkPage;
   declare Ident[Integer] BlockModelIds for ManialinkPage;
   declare Text[Integer] BlockModelNames for ManialinkPage;
   //Working
   declare MLText = """

	<quad posn="-138 20.5 1" sizen="9 9" bgcolor="FFFA" style="Icons64x64_1" substyle="ArrowDisabled" rot="-3"/>
	<quad posn="-58 24.8 1" sizen="9 9" bgcolor="FFFA" style="Icons64x64_1" substyle="ArrowNext" rot="-3"/>
	<label posn="-115 19 0" sizen="44 5" text="THE PERFECT MAP" rot="-3"/>
	<label posn="-129.5 -23 0" sizen="66 4" text="Pluginversion 0.1.1 by $069ԍτx$fff»$i$069f$ffflorǝи$069ɀ$fffιus" rot="-3" size="1"/>
	<label posn="-132 9 0" sizen="80 5" text="Welcome to your new mapping-coach!" rot="-3" textsize="3" autonewline="1"/>
	<label posn="-130 -18 0" sizen="80 5" text="Good luck and have fun! :)" rot="-3" textsize="3" autonewline="1"/>
	<label posn="-131 1 0" sizen="81 17" text="In this short guide you will learn some cool tricks for perfect maps. In <number> sites yo      u'll get the best tricks and some example pictures and maps to test!" rot="-3" textsize="2" autonewline="1"/>
	<quad posn="-141 23 0" sizen="95 14" bgcolor="FFFA" style="Bgs1InRace" substyle="BgTitle3_4" rot="-3"/>
	<quad posn="-141 23 0" sizen="95 14" bgcolor="FFFA" style="Bgs1InRace" substyle="BgTitle3_4" rot="-3"/>
	<quad posn="-138.5 18 -1" sizen="90.5 78" bgcolor="FFFA" style="Bgs1InRace" substyle="BgGradTop" rot="-3"/>  
	""";
   return MLText;
}

main() {
   // Without multiples layers :
   ManialinkText = CreateManialink();
   // With
   declare Layer1 <=> UILayerCreate();
   Layer1.ManialinkPage = CreateManialink();
}

//Test
//If you can help me, you can choose between kek and pasta

Re: EditorPlugin doens´t show my manialink [fixed]

Posted: 08 Jun 2016, 17:17
by Florenzius
Many thanks mate :D :thx:

Re: EditorPlugin doens´t show my manialink [fixed]

Posted: 11 Jun 2016, 12:26
by Florenzius
Hm, i have a problem again. My interface-file is done completely. You can test it by activating and deactivating the frames (pages).

In the manialink section in my plugin, there's the script part. I set the id for it. (id="Next1") and in the script in the manialink I wrote that:

ay

I don't have menuButton2, but it should work anyway. (It's just as placeholder). I think the script is okay, but idk why the button doesn't work in my plugin...

Here the complete script file.

ay

The complete interface-file (but WITHOUT the script section, i only added it in the editor plugin)

ay

I hope you can understand me well and i would be happy if you can help me ;)
As in the last line, you can get cool prices!

EDIT: It doesn't work in the interface designer too :/
EDIT2: PLEASE only test the scripts, if you can help. I don't want to spoil my project!!!

Re: EditorPlugin doens´t show my manialink [fixed]

Posted: 11 Jun 2016, 14:21
by maxi031
You need to add scriptevents="1" attribute to your button quad if you want it to fire mouseclick event.

Re: EditorPlugin doens´t show my manialink [fixed]

Posted: 11 Jun 2016, 22:23
by Florenzius
Thanks, it works well.

But, (don't ask , wheter I am stupid...) i have th enext problem ^^

No compiling error, all is right, but the script is not showed. scriptevent and id worked, but after a big edit It isn't showed as interface. Activated=yes, but it's like hidden...

Please don't test it, if you can't help, it's secret...

ay

Re: EditorPlugin doens´t show my manialink [fixed]

Posted: 11 Jun 2016, 23:30
by maxi031
DUDE you are missing " after Id attribute at line 301.

Re: EditorPlugins scripting issues

Posted: 12 Jun 2016, 07:36
by Florenzius
Thanks dude for your help, I couldn't see all small letters in 600 lines of code^^ Thanks :D

Now I get the following error: "The multilined string is too long (a """ is probably missing)"

But my code is okay and no """ is missing. Here is a screenshot with my code and the error message. The "wrong" line is marked by MP.

http://i.imgur.com/2xC3s9k.jpg

I can't find any error in the other pages, it's probably just this line, but it's weird

Re: EditorPlugins scripting issues

Posted: 12 Jun 2016, 13:02
by maxi031
DUDEEE post code.

Re: EditorPlugins scripting issues

Posted: 12 Jun 2016, 13:29
by Florenzius