Forum Discussion
9 years ago
Edit: On second thought, I may not need the injection to objects after all. More on this later, depending on where it goes.
So I thought I was gonna grasp it, but there's something I'm missing the mark on here, no matter how I try to implement it. I'm having one of those days where I feel like a toddler attempting calculus.
You mention the importance of the is_valid function as an example.
What I'm missing the mark on is, how to actually check objects for the tag. There's at least one step I'm missing or misunderstanding in here somewhere.
It seems like logically, the approach you're inferring in how the function is designed is that the function is made to be able to look at every object in the game, sees if it has the appropriate tag, and then if it does, you do some kind of "append super affordance" setup.
I guess it gets the game objects from this part?
But no, wait, that doesn't make sense. That's just validating it, right? I mean, the function parameter "script_object" implies feeding something into the function. But I don't see what you feed into it. Presumably game objects, which then get their tag checked. But how?
Or maybe I'm completely misunderstanding this and the game objects don't need to be directly referenced at all. It just seems like logically, at some stage, it has to take input for a game object id, check what that game object's tags are, see if it matches, and then add the affordance to it if it matches the tag. But this seems really inefficient to me if it has to check every object in the game, so maybe I'm on the wrong tack.
So I thought I was gonna grasp it, but there's something I'm missing the mark on here, no matter how I try to implement it. I'm having one of those days where I feel like a toddler attempting calculus.
You mention the importance of the is_valid function as an example.
What I'm missing the mark on is, how to actually check objects for the tag. There's at least one step I'm missing or misunderstanding in here somewhere.
It seems like logically, the approach you're inferring in how the function is designed is that the function is made to be able to look at every object in the game, sees if it has the appropriate tag, and then if it does, you do some kind of "append super affordance" setup.
I guess it gets the game objects from this part?
if not TurboTypesUtil.Objects.is_game_object(script_object):
But no, wait, that doesn't make sense. That's just validating it, right? I mean, the function parameter "script_object" implies feeding something into the function. But I don't see what you feed into it. Presumably game objects, which then get their tag checked. But how?
Or maybe I'm completely misunderstanding this and the game objects don't need to be directly referenced at all. It just seems like logically, at some stage, it has to take input for a game object id, check what that game object's tags are, see if it matches, and then add the affordance to it if it matches the tag. But this seems really inefficient to me if it has to check every object in the game, so maybe I'm on the wrong tack.