Arrays?
![TangoDownStudios](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Does GS support arrays? I mean will GS allow me to create say 30 instances of a custom actor and access them from another actor? Like how you would make a an old retro 'Snake' game.
How would it be possible for me to do this?
How would it be possible for me to do this?
Comments
Ace
Changing other actors' attributes in a scene
I am going to ask you to try this out
open a New project
Create 2 Actors
drag to sceneScreen...
click on one of the Actors in the scene...unlock it
Create a Rule when touch is pressed
--Change Attribute [expression] and see in the list CurrentScene>Layers>Background>both actors!
click the other actor... and see its attributes... click one and change it
Preview and make it happen!
you can even manipulate another actor's local attributes... (the ones you added to that actor)
EX: add an attribute to the Actor's List (+) make it boolean and call it Move leave unchecked
put a rule on this actor when Attribute self.Move is true changeAttribute self.Linear Velocity.Y To: -50
then in your other Actor...
Rule when touch is pressed
changeAttribute... and select the Move in your 1st actor To: true
MH
http://gamesalad.com/forums/topic.php?id=19216
got a little ticked by complaint about GS not being able to do things...
show I chomped back!
MH
Asymptotell- you have now got me asking the same question and I'll have to explore the dis/advantages for both...
big cheers kipper
GS chat room here:http://gsgame.epiggames.com/chat
You can't access another actor other than the way in which MotherHoose said although doing it that way you have to edit all the instances which is time consuming and very restrictive.
You can however use game. and self. attributes to distinguish between individual instances of an actor during gameplay and control the individual instance.
But does that work with multiple instances of various actors?
It's basically a
you should remember when you click on an instance... and unlock it ... to change its Name in its attribute pane...so you can easily find it in the list of actors in the layer...
hate having 20 'Actor 1's ... and trying to figure out what actor I am changing! ;D
if you forget ...in the Inspector ... |Game||Scene| click Scene and down arrow at 'Background'
click once on any actor in the list and you will see its handles in the Scene display pane...(that is especially helpful if you have its Alpha set to 0...)
tap Enter and you can edit name...
click twice and you can edit the behaviors of that instance. right! you just make a Rule with magnitude(self,otherActor) <
then Rotate and Interpolate Self.Position.X & Y To: otherActor.Position.X & Y or get more explicit with vector to angle or whatever...so you get the effect you need
now that you can get at these guys... you will be having them jump through hoops!
I have been pondering the RagDoll question... and joint manipulation with this...
you know Rule with things like self.Rotation; self.Position.X; self.position.Y... all with offsets...think it could be done with centered transparent actor/or the torso being the base reference for the limbs
but with my ADHD, I am not focused on it...I try to just work on what I need...
MH
EDIT: you can also access/modify other actors' local attribute you have created... and that is phenomenal... cause local attributes (variables) usually can't be manipulate except from events/triggers in that actor.