I am trying to lookup / create a repeating_savemod_.
According to https://wiki.roll20.net/API:Objects - I should be able to use repeating_savemod_$0_global_save_name in findObjs and createObj
However when I look up repeating_savemod_$0_global_save_name I get nothing, but when I look up attributes starting with repeating_savemod_ I see the attributes I am expecting
Code:
let char_id = "-Lja7EH4XMPypemsfO7b"
let attr = findObjs({
type: 'attribute',
characterid: char_id,
name: "repeating_savemod_$0_global_save_name",
}, {caseInsensitive: true})[0]
log("repeating_savemod_$0_global_save_name" + " => "+JSON.stringify(attr))
findObjs({ _type: 'attribute', _characterid: char_id}).forEach((t) => {
let name = t.get("name")
if (name.startsWith("repeating_savemod_"))
log(name + " => "+JSON.stringify(t))
});
Result:
"repeating_savemod_$0_global_save_name => undefined" "repeating_savemod_-Lq2RmvjiCI3kixkEAa5_global_save_roll => {\"name\":\"repeating_savemod_-Lq2RmvjiCI3kixkEAa5_global_save_roll\",\"current\":\"1d4\",\"max\":\"\",\"_id\":\"-Lq2Rmvo7iR5hEZFCv4Q\",\"_type\":\"attribute\",\"_characterid\":\"-Lja7EH4XMPypemsfO7b\"}" "repeating_savemod_-Lq2RmvjiCI3kixkEAa5_global_save_name => {\"name\":\"repeating_savemod_-Lq2RmvjiCI3kixkEAa5_global_save_name\",\"current\":\"Bless\",\"max\":\"\",\"_id\":\"-Lq2Rmvu0YRa4trDXOIw\",\"_type\":\"attribute\",\"_characterid\":\"-Lja7EH4XMPypemsfO7b\"}" "repeating_savemod_-Lq2RmvjiCI3kixkEAa5_global_save_active_flag => {\"name\":\"repeating_savemod_-Lq2RmvjiCI3kixkEAa5_global_save_active_flag\",\"current\":\"0\",\"max\":\"\",\"_id\":\"-Lq2Rmvy7WQS1f0rRbsb\",\"_type\":\"attribute\",\"_characterid\":\"-Lja7EH4XMPypemsfO7b\"}" "repeating_savemod_-Lq2RmvjiCI3kixkEAa5_options-flag => {\"name\":\"repeating_savemod_-Lq2RmvjiCI3kixkEAa5_options-flag\",\"current\":\"0\",\"max\":\"\",\"_id\":\"-Lq2RqUgeyV8vcnyVuRI\",\"_type\":\"attribute\",\"_characterid\":\"-Lja7EH4XMPypemsfO7b\"}"
Can someone spot what I am doing wrong.