
Hi all, over the last couple of weeks, I've pushed out some updates to Default and Experimental Mod (API) Servers. Bug Fixes: The CustFX object can now be removed with the use of .remove() in the same way as Graphic and other objects. let obj = findObj({type: 'custFx', name: 'snowballs'})[0];
obj?.remove(); New Features Support for Character Parties Character objects now have the `inParty` property which lets Mod API Scripts toggle characters that should be considered part of the party, as well as search for party members. You can manipulate this boolean property on character objects using .get() and .set() as expected, and use findObjs() to filter based on it. Note: While this property only has a VTT effect in Jumpgate, but you can still get, set, and filter on it in Legacy. This allows Mod API scripts to take advantage of it while on Legacy, and not need to detect which platform they are on with their code. let party = findObjs({type:'character',inParty:true}); let bobTheSlayer = findObjs({type:'character',name:"Bob the Slayer"})[0];
bobTheSlayer?.set('inParty',true); Support for Bar4 on Jumpgate On Jumpgate, tokens can now have a 4th token bar, and now Mod API Scripts have access it! There are two parts to this, first you can now set the number of bars the game is using on the Campaign object using the tokenBubbleMax property. This can be set to either 3 (the default) or 4. This will change the display of tokens in the VTT for all users. Second, all Graphic objects now have the supporting properties: bar4_value , bar4_max , bar4_link , and bar4_num_permissions ., showplayers_bar4 , playersedit_bar4 . These all behave the same as their numerically lower equivalents. Campaign().set('tokenBubbleMax',4); token.set({
bar4_value: 3,
bar4_max: 7
}); Enhanced Tag Support for findObjs() Tag support was added to findObjs() recently, however it was very rigid, requiring all tags to be in the same order and the exact same set of tags in order to match. To address this, we've added a new option to specify the type of matching to perform, as well as adjusted the matching to be order independent and case insensitive. This means if you are looking for ["Foo","Bar"] , you will find matching objects even if their tags happen to be ["bar",FOO"]. The tagMatch option can have 3 possible values: all -- This is the default, it means an object is matched only if it has all of the supplied tags. If you're looking for ["Foo","Bar"] , and an object only has ["Foo"] , it will not be a match. However, if it has ["Foo", "Bar", "Baz", "Qux"] , it will still be a match because it has all of the required tags. let badGuys = findObjs({tags:['npc','evil']},{tagMatch: 'all'}); let badGuys = findObjs({tags:['npc','evil']}); any -- This means as long as an object has any of the requested tags, it will still match. If you are looking for ["Foo","Bar"] , and an object has ["Bar"] , it is a match. let frontLiners = findObjs({tags:['fighter','barbarian','paladin']},{tagMatch: 'any'}); only -- This is the most restrictive match and requires the object to have exactly the tags you are looking for, no more, no less. If you are asking for ["Foo","Bar"] , it won't match if it only has ["Foo"] or if it also has ["Qux"] . let mundaneSwords = findObjs({tags:['weapon','melee']},{tagMatch: 'only'}); Additionally, you can use either arrays or JSON strings when specifying tags to match. let frontLiners = findObjs({tags:"['fighter','barbarian','paladin']}",{tagMatch: 'any'}); let frontLiners = findObjs({tags:['fighter','barbarian','paladin']},{tagMatch: 'any'}); Thats all for now, appologies for the delay in getting the notice up about these changes. Please let me know if you experience any issues with the API, or have any questions about the above!