I think its time to give prototypes access scene attributes ..

POMPOM Member Posts: 2,599
edited December 2011 in Working with GS (Mac)
Like the title says , its about time you guys give us access to scene attributes from a prototype actor .
Trying to calculate "VectorToAngle" or "Magnitude" is getting very exhausting on scrollable scenes, cause if the camera is at 1000 , the touch values are still registered as if the touch is inside the 320x480 area . then the we need to add the scene origin to get the correct value of the touch with the offset.
Opening prototypes to instances or constraining the scene origin values to game.attributes in order to have access is a nasty way of doing things , and often cause performance to halt .
Please give us access to scene attributes from prototypes and make our lives easier :D

Thanks
Roy.

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    +1
  • mu-kowAPPSmu-kowAPPS Member Posts: 233
    +1
  • MotherHooseMotherHoose Member Posts: 2,456
    prototype actors are game elements (i.e. global … applicable through-out the game)
    scene attributes are scene elements (i.e. local … applicable within the scene)

    game attributes can not change scene attributes … but, scene attributes can change game attributes

    okay we can work with/around this:

    1. in sceneAttributes: + an Index attribute scene#
    2. in gameAttributes: + an Index attribute scene#

    in your Prototype actor
    create Rules:
    when game.scene# = 1
    do this and that

    etc.

    3. in your scene prototype Control Actor: changeAttribute: game.scene# To: 0
    (leave at 0 for now change to Current scene.scene# in instances)

    some basic rules with condition of the actor are doable this way
    I use it to changeAttribute: self.image in my generic background actor

    Vector to angle and magnitude without parameters go in fine
    but, yuck, you are still going to have to get/set those X,Ys in instance

    MH
  • POMPOM Member Posts: 2,599
    @MotherHoose
    " Vector to angle and magnitude without parameters go in fine
    but, yuck, you are still going to have to get/set those X,Ys in instance "

    Yep , exactly !
    Any word from the GS team about this?

    Roy.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I see a positives a Negatives with this. I think stuff like Camera Attributes Maybe but I can see opening this door as really causing problems with new users projects. I know I know. We should not be limited due to people not knowing how to use the tool. but who knows what under the hood issues bad code with scene attribute in prototypes will cause.

    Now, That being said….

    Heres a Workaround I use.
    This will only work if the rules and behaviors are going to be exactly the same throughout each prototype you are doing this to.

    Unlock and instance and create your rules/behaviors with the scene attributes Put all of it into a group and be sure to name the Group something unique.
    NOw drag that group over to your custom behaviors.
    you can now have access to those attributes by dropping the custom behavior in the prototype. Dont be alarmed that it may give warnings about the attribute and the fields will be empty while editing the prototype but once it is in a scene you can open it and see the fields are properly filled out.

    Good Luck
  • ozboybrianozboybrian PRO Posts: 2,102
    Having access to any part of the game with a prototype will out way any con I think so...
    + 9999999 from me!
Sign In or Register to comment.