I don't have AGS to test right now but I think this is the ags3 issue that you can't use attributes in the same script where you declare them. I just remember that it gave me a mystical error message.
This is fixed in ags4 with the new compiler.
If it's this, you would need to call geti_AttributeName(I).
This is fixed in ags4 with the new compiler.
If it's this, you would need to call geti_AttributeName(I).