I am attempting to set an attribute dynamically, but it seems like the compiler does not want to parse the combined string as a string, and instead stops when I get to "+". How do I fix this? I considered storing the string in a variable, but then realized that the setAttrs function would not look for the variable, but a (nonexistant) attribute of that name. Here is my code (keep in mind that most of it is omitted for brevity's sake; while referenced in here, it doesn't pertain to my problem at the moment): on("change:repeating_weapons:Uses", function(eventInfo) {
console.log(eventInfo.newValue)
if (eventInfo.newValue === "0"){
console.log("Broken")
let RID = eventInfo.sourceAttribute.slice(18,38) //This gets the repeating row ID of the changed attribute
getAttrs(["repeating_weapons_"+RID+"WName"], function(v){
setAttrs({
"repeating_weapons_"+RID+"_WRank": "UU", //here is where the error is
"repeating_weapons_"+RID+"_WName": "Broken " + v["repeating_weapons_"+RID+"_WName"]
});
}
}
});