Hey, I'm writing a script to call a character ability with a number moveNo and depending on an attribute DType assign a different ability. However when I call my script when it goes to set the variable it is giving me a: Possible infinite loop detected, shutting down. It works for one of my cases perfectly fine, however for the other two cases it runs into the above error. The code below is minimised to one of the cases that gives me an error. move = function(moveNo, character){
var checkMoveType = getAttrByName(character.id, "Move"+ moveNo + "_DType");
var CharName = character.get("name");
var text = "false";
switch (checkMoveType){
case 'Physical':
log("phys1");
text = "%{"+CharName+"|Move"+moveNo+"AtkPhys}";
log("phys2");
break;
default:
log("Error");
break;
}
if (text !== "false") {
var who = 'character|' + character.id;
sendChat(who,text);
}
}, as far as the two log events, they where for testing, and in the API Output Console I'm getting just the first log message phys1 The ability that is getting called is about 738 characters long. I'm not experienced with javascript whatsoever. I'm also running this script on the Dev server if it matters. Resolved (Thanks to The Aaron) The issue was when the ability was being used it was using an attribute that didn't exist in the attributes of the character.