Or if you'll need multiple versions of the same actor, change the game attribute to an actor attribute, and then each actor can reference it's own starting point, if that's what's needed.
Thank you, that's a great start. What about a reference to the Actor like an attribute that could hold Actor itself...so that I could something like this:
I understand what you mean @drtyrell, you want to reference the actor itself, not it's coordinates. The method you posted of storing a reference to an actor inside a variable doesn't work in Gamesalad as it does in many programming languages, although it would be handy.
I think off the top of my head I'd have a global attribute to count how may actors have been spawned. Inside each actor set the first behaviour to change self.id to global.count, and then increment global.count by 1.
That would give each instance it's own id number, which could be used to reference it by. It's still tricky though as actors can't reference each other's attributes unless they're unlocked on the same scene, so you'd probably have to keep a lot of the logic inside each actor itself, referencing it's own id number. So instead of an external actor being able to call a specific instance id, you'd have duplicate logic inside each actor checking it's own id.
That's off the top of my head, but that's old school Gamesalad thinking, there might actually be a better method using tables to store the ids instead so that they can be referenced from anywhere.
Okay, I think you two have answered my question. I have a book on GameSalad for iOS and haven't seen a single instance of what I'm talking about. The attribute types don't seem to include a type of Actor, which would solve the problem instantly.
I want to create some generic methods of transitioning between scenes by spawning rects on top, interpolating the alpha to 1 from 0 then switching scenes. Without things being dynamic, the Change Scene value is hard coded, and not able to reference a global attribute.
My friends are using single scenes and recommending I don't change, but without traditional mechanism this seems massively tedious.
Answers
On your spawned actor
Change game.attribute.spawn point to self.position.x
Change game.attribute.spawn point to self.position.y
game.actor.attribute = self
I understand what you mean @drtyrell, you want to reference the actor itself, not it's coordinates. The method you posted of storing a reference to an actor inside a variable doesn't work in Gamesalad as it does in many programming languages, although it would be handy.
I think off the top of my head I'd have a global attribute to count how may actors have been spawned. Inside each actor set the first behaviour to change self.id to global.count, and then increment global.count by 1.
That would give each instance it's own id number, which could be used to reference it by. It's still tricky though as actors can't reference each other's attributes unless they're unlocked on the same scene, so you'd probably have to keep a lot of the logic inside each actor itself, referencing it's own id number. So instead of an external actor being able to call a specific instance id, you'd have duplicate logic inside each actor checking it's own id.
That's off the top of my head, but that's old school Gamesalad thinking, there might actually be a better method using tables to store the ids instead so that they can be referenced from anywhere.
I want to create some generic methods of transitioning between scenes by spawning rects on top, interpolating the alpha to 1 from 0 then switching scenes. Without things being dynamic, the Change Scene value is hard coded, and not able to reference a global attribute.
My friends are using single scenes and recommending I don't change, but without traditional mechanism this seems massively tedious.