I downloaded and installed the b90 beta build. For some reason, the initiative macros I got working in b89 do not work in the b90 build. Here's my macro for npc initiative:
Code: Select all
[h: i = getInitiativeRound()]
[h: removeAllFromInitiative()]
[h, if (i >0): setInitiativeRound(i+1); setInitiativeRound(1)]
[h, code:{
[jsonNPC = getNPC("json")]
[jsonInit = '[]']
}]
[h, foreach(id, jsonNPC), code:{
[jsonInsert = json.set('{}', "id", id, "init", d10)]
[jsonInit = json.append(jsonInit, jsonInsert)]
}]
[h: jsonInit = json.sort(jsonInit, "ascending", "init")]
[h, foreach(item, jsonInit), code:{
[current = json.get(item, "id")]
[value = json.get(item, "init")]
[switchToken(current)]
[addToInitiative()]
[setInitiative(value)]
}]
Code: Select all
net.rptools.parser.ParserException: Unknown JSON type "init" in function "json.sort"