I have a bunch of activators in a cell called iio_act_trap_enliftDR and iio_act_trap_enliftRG. I need to filter of these strings which means I need to use xGetBaseID which works a treat for NPCs but I can't get the string compare to work for activators. See code below:
setx targetref to xFirstItemwhilex ( targetref ) ;Check the type because we want activators setx temp to targetref ->xRefType if ( temp != 1230259009 ) ; it's an activator set componentOk to 1 endif ;Found an activator ifx (componentOk) set componentOk to 0 ;Check type of reference setx prospectid to targetref->xGetBaseID setx refname to targetref->xGetName set temp to 100 ;setting to 1 doesn;t seem to work setx temp to xStringCompare prospectid "iio_act_trap_enliftDR" Messagebox, "prospectid : %.1f targetref: %.1f temp : %.1f",prospectid ,targetref , temp if ( temp == 0 ) ; it's the door Messagebox, "FOUND DOOR" set checkDistance to REF_DOOR endif set temp to 100 ;setting to 1 doesn't seem to work setx temp to xStringCompare prospectid "iio_act_trap_enliftRG" if ( temp == 0 ) ; it's the register Messagebox, "FOUND REGISTER" set checkDistance to REF_REGISTER endif ;setx temp to xStringCompare prospectid "iio_act_trap_enliftMK" ;if ( temp == 0 ) ; it's the marker ;set constrefmarker to targetref ;endif set temp to 100 ;setting to 1 doesn't seem to work setx temp to xStringCompare prospectid "Enemy Lift Register" if ( temp == 0 ) ; it's the register Messagebox, "FOUND ENEMY LIFT REGISTER" set checkDistance to REF_REGISTER endif endif ;componentOk setx targetref to xNextRef targetref endwhileMessagebox, "constrefdoor: %.1f -- constrefregister: %.1f ", constrefdoor , constrefregisterendif ;STATE_INITIALIZE