So basically it would look something like isFunction(%whatever.getClassName(),doThis).
It's more than that. You can check just %whatever if it has a specific function instead of explicitly checking if its class has it.
Note about the class/script support thing: Doesn't support named objects (which is dumb why shouldn't it)Here's some nice support code for method detection and object-oriented calls:Code: [Select]function SimObject::hasMethod(%this,%name){ return isFunction(%this.getName(),%name) || isFunction(%this.class,%name) || isFunction(%this.getClassName(),%name);}function SimObject::call(%this,%func,%a,%b,%c,%d,%e,%f,%g,%h,%i,%j,%k,%l,%m,%n,%o,%p,%q,%r,%s,%t,%u,%v,%w,%x,%y,%z){ if(!%this.hasMethod(%func)) { error("SimObject::call - No method '" @ %func @ "' exists for this object."); return; } for(%it=0;%it<26;%it++) { %val = "%" @ getsubstr("abcdefghijklmnopqrstuvwxyz",%it,1); %val = eval("return" SPC %val @ ";"); if(%val $= "") { break; } %args = %args $= "" ? "\"" @ expandEscape(%val) @ "\"" : %args @ ",\"" @ expandEscape(%val) @ "\""; } return eval("return " @ %this.getID() @ "." @ %func @ "(" @ %args @ ");");}Feel free to throw that in anywhere you feel it's appropriate. Should be entirely eval-safe (as in user input shouldn't be able to eval random code through it, but I didn't exactly test heavily)
function SimObject::hasMethod(%this,%name){ return isFunction(%this.getName(),%name) || isFunction(%this.class,%name) || isFunction(%this.getClassName(),%name);}function SimObject::call(%this,%func,%a,%b,%c,%d,%e,%f,%g,%h,%i,%j,%k,%l,%m,%n,%o,%p,%q,%r,%s,%t,%u,%v,%w,%x,%y,%z){ if(!%this.hasMethod(%func)) { error("SimObject::call - No method '" @ %func @ "' exists for this object."); return; } for(%it=0;%it<26;%it++) { %val = "%" @ getsubstr("abcdefghijklmnopqrstuvwxyz",%it,1); %val = eval("return" SPC %val @ ";"); if(%val $= "") { break; } %args = %args $= "" ? "\"" @ expandEscape(%val) @ "\"" : %args @ ",\"" @ expandEscape(%val) @ "\""; } return eval("return " @ %this.getID() @ "." @ %func @ "(" @ %args @ ");");}