Arrays?

TangoDownStudiosTangoDownStudios Member Posts: 46
edited November -1 in Working with GS (Mac)
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?

Comments

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    No, not yet but I believe GS are working on it, when we actually get it depends on how high it is up on their list.

    Ace
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Sorry, I don't have any advice for your second question, but I can tell you GameSalad does not have arrays at this time.
  • TangoDownStudiosTangoDownStudios Member Posts: 46
    Aww, thats a shame. Thank you for such a speedy response all!
  • old_kipperold_kipper Member Posts: 1,420
    I am not sure but I think I have a similar problem. I have a number of instances of an actor that collide but I want to one actor to recognise a change in state of the other so it can react in a different ways (attach or bounce). Possible or should I kill the old actor when it's state changes, spawn a new form of actor to the first, so when the second instance comes along it will can abide by a defined rule set based on a new form of actor?
  • BramHoddssdBramHoddssd Member Posts: 414
    i'm sorry for this noobish question. But what are arrays? Are they some sort of list that can hold lots of information?
  • BramHoddssdBramHoddssd Member Posts: 414
    ...not are they on the list. Are THEY a list???
  • AppsRacKAppsRacK Member Posts: 346
    Yes they are a list. Array is like a container of object that is arrange chronologically which you can access anytime and change(depending if its mutable or non mutable). It's quite important if you want to get or check information on certain object on a group of objects. In GS there is a work around to do this but its messy and its gonna be all hard-coded i think.
  • MotherHooseMotherHoose Member Posts: 2,456
    Arrays no... but control of other Actors in scene YES...

    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
  • AsymptoteellAsymptoteell Member Posts: 1,362
    oh my god, motherhoose! You just saved us all!
  • MotherHooseMotherHoose Member Posts: 2,456
    ah I was just quoting myself from the end of my other post...

    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
  • AsymptoteellAsymptoteell Member Posts: 1,362
    I never knew you could do that! Why do so many people constrain actors' values to game attributes to make actors follow other actors?
  • old_kipperold_kipper Member Posts: 1,420
    Many Thanks MH. Your advice is invaluable.

    Asymptotell- you have now got me asking the same question and I'll have to explore the dis/advantages for both...

    big cheers kipper
  • calvin9403calvin9403 Member Posts: 3,186
    No, but I want it a lot too
    GS chat room here:http://gsgame.epiggames.com/chat
  • RHRH Member Posts: 1,079
    TangoDownStudios said: Like how you would make a an old retro 'Snake' game.

    http://gamesalad.com/forums/topic.php?id=18199 ;)

    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.
  • FranzKellerFranzKeller Member Posts: 517
    WOW! THank you MH. I think I get it

    But does that work with multiple instances of various actors?
  • RHRH Member Posts: 1,079
    FranzKeller said:
    WOW! THank you MH. I think I get it

    But does that work with multiple instances of various actors?

    It's the same as editing an actor except you can access the specific attributes of instances of an actor in the scene.
    It's basically a
  • MotherHooseMotherHoose Member Posts: 2,456
    @Franzkeller...Yes... works with all instance of everything in the scene

    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.
    Asymptoteell said:
    I never knew you could do that! Why do so many people constrain actors' values to game attributes to make actors follow other actors?

    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.
  • simo103simo103 Member, PRO Posts: 1,331
    MotherHoose said:
    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...

    tap Enter and you can edit name...

    man MH your just full of GradeA help today :D Thanks a ton. I've been trying to change layer names for ever .. just thought I had a project glitch because I double click them to edit the name and nothing happened. Also having the ability to effect another Actor in scene without a Global is golden. Thanks.
Sign In or Register to comment.