[messages] [Technical Support & Bugs] How do I "load" GamePieces in Java?

Magnus.Pihl magnus.pihl at gmail.com
Wed Jan 9 15:35:46 MST 2013


Hi,

 I've got a module loaded with extensions, which define a bunch of
SinglePieces.
Now I'm trying to write a Java method to instantiate specific
SinglePieces from these extensions and add them to a game board.
I've got pretty much everything figured out: I can get the correct map
from iterating over Map.getMapList(), I can add a GamePiece to that map
with map.AddPiece(gp) - I'm just missing the most important thing: The
GamePiece object.

I've managed to create a GamePiece based on an image file with
GameModule.getGameModule().createPiece(String), but I need one with
prototypes and everything, as designed in the Extension Editor. I
thought I'd be able to do this by using the ID of the SinglePiece, but
haven't got that to work.

Any guidance would be greatly appreciated,

 Magnus

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=37957#p37957


More information about the messages mailing list