I have spent my time creating "turn based" game in map tool coverting Mount & Blade Warband into a 2D Turn based strategy.
As I have spent 8 weeks working my donkey off to learn how to script - i have actually gotten a good prototype of the game in a almost playable state:
All except this one script:
Code: Select all
[h:TokExposed = json.sort(json.intersection(getTokenNames("json",'{layer:["TOKEN"]}'), getExposedTokenNames("json")))]
[H: tokenList=TokExposed]
[H: imgList = tokenList]
[H: Num = listCount(imgList)]
[h,COUNT(Num),CODE:
{
[h:tokenName=listGet(imgList,roll.count)]
[h,token(tokenName): image=getTokenImage()]
[h:imgList=listReplace(imgList,roll.count,tokenName+" "+image)]
}]
[h:status=input(
"Target|"+imgList+"|Select Target|LIST|SELECT=0 ICON=TRUE ICONSIZE=30")]
[h:abort(status)]
[h:targetName = listGet(tokenList,Target)]
[h:switchToken(targetName)]
If I select the first or the last Target on the list i get this:
-------------------------
First on list: The script returns: Error executing "switchToken": the token name or id "["AE_Anchor"" is unknown
Last on list: Error executing "switchToken": the token name or id "ImB_Yipman"" is unknown.
--------------------------
The rest of the targets are responding just fine.
I wish to note that the first Token returns the wrong image.
I would REALLY appreciate if someone could help me out on this one!