Having trouble with extension blocks using 'anything' type. [QUESTION]

ShivaFang

  • Posts: 248
Not yet sure if this is a bug, or if I'm not doing something right.  I'd think if it was a bug someone would have noticed it by now since it's a pretty major part of the extension system - and I didn't see it when poking through the assigned and unassigned bugs sections, so I'm guessing the latter.

I have this in my blocks.xml file (among other blocks, but these are the ones that are causing the issue)
Code: [Select]
<block tag="listWrap" spec="List Wrap %0" code="ShivaInterface.listWrap(~)" type="normal" color="gray" returns="list">
<fields>
<anything order="0"></anything>
</fields>
</block>
<block tag="listUnwrap" spec="List Unwrap %0" code="ShivaInterface.listUnwrap(~)" type="normal" color="gray" returns="anything">
<fields>
<list order="0"></list>
</fields>
</block>

The code these reference looks like this;

Code: [Select]
public static inline function listWrap(v0:Dynamic):Array<Dynamic> {
var Arra:Array<Dynamic> = new Array<Dynamic>();
Arra.push(Type.getClassName(Type.getClass(v0)).split(".").pop());
Arra.push(v0);
return Arra;
}

public static inline function listUnwrap(v0:Array<Dynamic>):Dynamic {
return v0[1];
}

When I open my game, these two blocks don't show up (but the other block in the same blocks.xml file does - so it's not a formatting error, or a missing close tag or something).

The error that shows up in my log;
Code: [Select]
[ERR] java.lang.IllegalArgumentException: No enum const class stencyl.sw.editors.snippet.designer.Definition$Type.ANYTHING
Now 'anything' does show up as a type in the help information that's commented out, so I would expect it to work.  I'm trying to make it so that when my classed objects are used stencyl-side they are passed around as Lists (so I can store them in an attribute, since there's no such thing as an 'anything' attribute).

« Last Edit: March 24, 2014, 11:14:46 am by Jon »
Justin "ShivaFang" White
Aquamentos Games - The origin of challenging Strategy and Role-Playing Flash gaming!
Visit our Developer Blog and Google+ Page!

ShivaFang

  • Posts: 248
Just wrote another block and tested it with 'text' and it works, but as soon as I change any of them to 'anything' the block won't load (Weather it's in the 'returns' or in the 'field' areas).  So I'm now leaning to this being a sencyl-side bug (which is really annoying and going to set my plans back a bit =Z)

I'm going to leave the post here for now, in case there's something I'm missing, but if not I'll repost in the bugs section.

Code: [Select]
<block tag="get" spec="Bonus: mod %0 modtype %1 bonustype %2 bonuslayer %3" code="CalcVarInterface.newBonusVar(~,~,~,~)" type="normal" color="gray" returns="text">
<fields>
<text order="0"></text>
<text order="1"></text>
<text order="2"></text>
<text order="3"></text>
</fields>
</block>
Justin "ShivaFang" White
Aquamentos Games - The origin of challenging Strategy and Role-Playing Flash gaming!
Visit our Developer Blog and Google+ Page!