Obj on same tile

From SimsWiki
Revision as of 17:26, 27 October 2009 by MogHughson (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a flavour of the Set to Next (0x001F) primitive.

This particular enumeration works a little differently from the others.

With most 'Set to Next' enumerations, we can keep calling 'Set to Next' in a loop until it returns false and we know that we have been returned each of the things that match the criteria we are using. With this one however, it is not able to return false to tell you that you have seen everything. It will loop round forever (but for the "Too Many iterations" error which will save you). This means you should remember the starting point before calling this flavour of 'Set to Next' and after each return True, check to see whether you have got back to your starting point and if so act accordingly, as if it had returned False.

I believe the reason for the above is due to the fact that there is only one variable used for this flavour of 'Set to Next' instead of two. You would imagine that you need a variable to contain

  • the thing that you want to find other things on the same tile as
  • the place to store the returned thing that has been found on the same tile.

However, there is only one variable, so it gets updated each time to the newly found thing and thus the starting point is forgotten.

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox