Skip to Content

BYOB method of object and tell object blocks

« Bugs, Troubleshooting, Suggestions
1 reply [Last post]

I am experiencing a problem where the "method of object" block does not work because I am using a variable whose type is apparently only identified at run-time.  If I drop this variable into the object section, the local methods of that object are no longer available.  As an alternative, If I use the "tell object" block from the tools it mostly works; however, it generates turds for all local methods and data members of the specified remote object that is accessed in the c-block area...(I also end up in a bad state over time and have to blow it all away and recreate the unused methods and data members to get everything working properly...Here is an image of an example:

The of block works fine if I only have one sprite but fails if I am dependent upon a variable.  And the automatic creation of all local methods and data members of the remote object which are specified in the c-section of "tell object" is a real pain...(a maintenance nightmare as well)...It is interesting to note that even though the local copies are created, the correct remote methods get identified and called at run-time....mostly....

Is there an official way to deal with this?  I am sure I can find a work around, but I was hoping there was a silver bullet to solve this...


 I guess I should add that this problem only occurs because I am trying to encapsulate the code local to the respective objects (sprites) by creating local methods.  If everything is global you will not see this issue.  I can certainly create methods that use a naming convention like 'sprite_method' which will help the user to call the method from the correct object, but that is really a poor solution.

Again the problem only exists when calling a local method of a remote object, where you use a variable to store the remote object reference...