Passing Values between actors

XanthorXIIIXanthorXIII Member Posts: 8
edited November -1 in Working with GS (Mac)
Is it possible to pass values between actors without using the Game Attributes to pass the values? I'd like to have an Actor that when it Spawns another Actor sets the values on that actor.
So in this case, a Spawn Behavior that can set attributes on another actor, or just having the ability to set Attributes on another Actor.
Thanks.

Comments

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    I'm pretty sure you'd have to involve game attributes.
  • empifrikempifrik Member Posts: 16
    A strange but nice workaround is to spawn the actor with the rotation.

    The angle of rotation should be the data you want to transfer, and of course it should be between 0 and 359, and the spawned actor should change his rotation angle to 0 right after he reads it (maybe even spawn him with alpha=0, then change to 1 after correcting the angle).

    It has limitations but its a nice way to do thing quickly.

    Hope that helps.
  • XanthorXIIIXanthorXIII Member Posts: 8
    I can almost see that working but that limits the range of my values to 0 - 359 which I am not sure I would get any real results. Best I just use Game Attributes for now.
    I also may re-think my approach to this problem.
    This would be a great idea for GS 1.0.
  • TwistedMechTwistedMech Member Posts: 408
    Cross object attribute reads and arrays are really needed to get the most out if gs. Hope it's in the next release.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Any Actor Instance can read, set, and control the attributes of any other actor Instance in the Scene. An Instance can also control the Camera size and position.

    Prototype Actors cannot do this.

    Drag two instances out into the Scene, double click them to open their properties, and click the padlock to break the Prototype-Instance bond. In the Rules for this Instance, you will have access to everything in the Scene.

    My latest GS game, The Secret of Grisly Manor, was made using this technique. It only uses 12 Prototype Actors for the entire game. Although this does require some planning, you do not need a million game attributes to accomplish what you want. Actors can directly control other Actors.

    The only limitation with this is spawned Actors. Newly spawned Actors will not be known to the Instances in the Scene.
Sign In or Register to comment.