actor changing attribute of other actor

PrimePrime Member Posts: 8
edited January 2012 in Working with GS (Mac)
Can an actor change attribute of another actor without going thru a game attribute?

so far I notice that its either change self.xxx to game.xxx
On the pop up menu there is no other "actor" listed.
Can i replace self.xxx by anotheractor.xxx?

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    edited January 2012
    when both actors are dragged to the sceneEditor they become instances of the prototype actors …

    you open/unlock the behaviors of the actorInstance that will do the controlling
    drag in a behavior and reference the other actor with an expression
    > Current scene > layers > layer that actor is in > the actor > its attribute you want to change

    MH
  • PrimePrime Member Posts: 8
    Hi MotherHoose! Thanks for the fast response.
    Thanks for the answer! It works good! Here is another question.

    I'm having an actor spawn. Is there a way I can have that "change attribute" be done on a prototype? or on the one being spawn? because its a command that spawns it...is there a way i can have that change attribute rule in the actor being spawn?

  • MotherHooseMotherHoose Member Posts: 2,456
    alas @Prime, the answer to that is a straight out "No" … Prototypes can Not changeAttributes of other prototypes or of actors in a scene or the sceneAttributes!

    however, there are some little tricks that might work to give the effect you want.

    for example:
    you could create a game.Attribute (Index type as IMO this uses the least resources) and leave it 0
    on your prototype that is spawned have a 1st behavior:
    changeAttribute: game.Index To: 1

    on the actor you want to change:
    Rule: when
    Attribute: game.Index = 1
    --change.Attribute: self.Whatever??

    when you want this to happen with every spawning …
    on the spawner … just before the spawn behavior
    --changeAttribute: game.Index To: 0

    good luck!
    MH
Sign In or Register to comment.