is it possible to change an actor's tag in game?

pinata14pinata14 Member Posts: 150
edited May 2012 in Working with GS (Mac)
ive tried using the {change attribute} [self.tags] to [New Tag(same as the tag name)] but then other actors dont collide with it when they are set to {collide with actor with tag}[New Tag] any idea how to make this work?

Answers

  • pinata14pinata14 Member Posts: 150
    hmm :/ thanks @tshirtbooth. Gamesalad is so limiting when it comes to identifying different actors (specifically instances) hope we get those tables soon! it wont fix everything but it will help i hope ;)
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Here's a trick that works for some instance identification issues (not all but some)

    create game.ActorCount (integer)
    create self.MyID (integer) in the actor that you need to keep track

    in the prototype for the actor have these two behaviors right at the top of the actor's rules:

    change attribute game.ActorCount to game.ActorCount + 1
    change attribute self.MyID to game.ActorCount

    This will give each instance in the scene a unique number. There are a bunch of ways to use this. You could move instances into a scene by a rule like this

    if attribute game.ItsMyTurn = self.MyID
    then move to ??? , ???

    Then you could have a rule in a control actor that does this:
    Timer every 5 seconds
    change attribute game.ItsMyTurn to game.ItsMyTurn + 1

    Just an example. I find my self using this all the time. Hope it helps!
  • pinata14pinata14 Member Posts: 150
    @scitunes unfortunately there is no efficient way to use this to have other actor's instances react with the different instance's attributes ie. position
Sign In or Register to comment.