Here's the code:
Code: Select all
[h:'<!-- ------------------------------------ addBevel() ------------------------------------------------- -->']
[h:dungeon = getLibProperty("DB3.dungeon","lib:DB3Test")]
[h:Field = getLibProperty("DB3.tField","lib:DB3Test")]
[h,foreach(tile, Field), CODE:{
<!-- create x and y coord of current Centre -->
[coord = json.get(dungeon, roll.count)]
[varsFromStrProp(json.toStrProp(coord))]
<!-- turn tile into separate variables -->
[varsFromStrProp(replace(
tile,
"t(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)",
"E=\$1;NE=\$2;N=\$3;NW=\$4;W=\$5;SW=\$6;S=\$7;SE=\$8;"
))]
<!-- EAST EDGE CHECK -->
[test="t"+SE+E+NE]
[switch(test), CODE:
case "t000":{
<!-- EV -->
[copyToken("bevelEV",1,"",json.set(coord,"useDistance",0))]
};
case "t001":{
<!-- EV CO(S) -->
[copyToken("bevelEV",1,"",json.set(coord,"useDistance",0))]
[copyToken("bevelCO",1,"",json.set(coord,"useDistance",0,facing,-90))]
};
case "t010":{
<!-- EV CO(N) -->
[copyToken("bevelEV",1,"",json.set(coord,"useDistance",0))]
[copyToken("bevelCO",1,"",json.set(coord, "y", json.get(coord,"y")-1,"useDistance",0,facing,0))]
};
case "t011":{
<!-- EV CO CO -->
[copyToken("bevelEV",1,"",json.set(coord,"useDistance",0))]
[copyToken("bevelCO",1,"",json.set(coord, ,"useDistance",0,facing,-90))]
[copyToken("bevelCO",1,"",json.set(coord, "y", json.get(coord,"y")-1,"useDistance",0,facing,0))]
};
default{<!-- ignore -->}
]
<!-- NORTH EAST CORNER CHECK --><!-- IC ONLY -->
[h,if(NE+N+NW == 0): copyToken("bevelCO",1,"",json.set(coord, ,"useDistance",0,facing,??))]
<!-- OTHER SIDES TO BE DONE LATER AFTER THOROUGHT TESTING -->
[r:"t"+N+NW+W]
[r:"t"+NW+W+SW]
[r:"t"+W+SW+S]
[r:"t"+SW+S+SE]
[r:"t"+S+SE+E]
}]
what the hell am I missing?Code: Select all
2016-05-21 16:36:04,286 [client.MapToolLineParser:1265] DEBUG - '<!-- ------------------------------------ addBevel() ------------------------------------------------- -->' 2016-05-21 16:36:04,288 [client.MapToolLineParser:1265] DEBUG - dungeon = getLibProperty("DB3.dungeon","lib:DB3Test") 2016-05-21 16:36:04,288 [client.MapToolLineParser:1265] DEBUG - Field = getLibProperty("DB3.tField","lib:DB3Test") 2016-05-21 16:36:04,288 [client.MapToolLineParser:1265] DEBUG - Field 2016-05-21 16:36:04,303 [client.MapToolLineParser:1265] DEBUG - coord = json.get(dungeon, roll.count) 2016-05-21 16:36:04,377 [client.MapToolLineParser:1265] DEBUG - varsFromStrProp(json.toStrProp(coord)) 2016-05-21 16:36:04,393 [client.MapToolLineParser:1265] DEBUG - varsFromStrProp(replace( tile, "t(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)", "E=\$1;NE=\$2;N=\$3;NW=\$4;W=\$5;SW=\$6;S=\$7;SE=\$8;" )) 2016-05-21 16:36:04,393 [client.MapToolLineParser:1265] DEBUG - test="t"+SE+E+NE 2016-05-21 16:36:04,393 [client.MapToolLineParser:1265] DEBUG - test 2016-05-21 16:36:04,408 [client.MapToolLineParser:1265] DEBUG - [copyToken("bevelEV",1,"",json.set(coord,"useDistance",0))] 2016-05-21 16:36:04,408 [client.MapToolLineParser:1280] DEBUG - net.rptools.parser.ParserException: line 1:25: unexpected char: '['