Can you Change Attribute: Tags?

DrGlickertDrGlickert Member Posts: 1,135
edited November -1 in Working with GS (Mac)
I realize that my problem right now is collisions. And, my problem with collisions is not the actor's fault (as much as I want to blame them), it's a programming/behavior problem. The collisions are being based off my "Tag" settings on the blocks.

So, can I change attribute: tags?

I'd like to "untag" the block as a collidable object (a tag) and change it to an uncollidable object (also a tag).

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    sure, just hit the home button, choose the 'actors' tab instead of 'scenes' and you'll see all your tags on the left.

    Then click the tag with the rogue colliding object, and just delete that actor.

    Backup your game first though, eh?

    QS :D

    Edit - sorry - missed the second part - at the top of the tags list is where all your actors are. Just drag the block into 'not collidable' tag and you should be fine.

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • DrGlickertDrGlickert Member Posts: 1,135
    QS - I know how to do that part. :-)

    I mean, within the game itself. I know how to manually change tags. But I want the game to do it. For example. I have two actors; actor 1 and actor 2 (which collide with each other). Actor 1 gets shot. I want actor 1 to not collide (which is easy, I can just change the collisions on actor 1). I want actor 2 to not collide with actor 1 after actor 1 gets shot.

    I'm "recycling" actors because my game is heavy on the spawns/destroys. So when actor 1 gets shot, I set Alpha to 0, set collisions off, then move it out of the screen (to return again later).

    If GS would just find a way to dump memory after a spawn/destroy this wouldn't be an issue.
  • DrGlickertDrGlickert Member Posts: 1,135
    Anyone?
  • DrGlickertDrGlickert Member Posts: 1,135
    Does anyone know how to do this? Remove tags via a "Change Attribute" behavior, or any other behavior for that matter...
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    DrGlickert said:
    Does anyone know how to do this? Remove tags via a "Change Attribute" behavior, or any other behavior for that matter...

    Ive never done it myself, but yes you can change the tags with a change attribute behavior. The tag is in the actors self attributes.
  • DrGlickertDrGlickert Member Posts: 1,135
    JohnPapiomitis said:
    Ive never done it myself, but yes you can change the tags with a change attribute behavior. The tag is in the actors self attributes.

    How do you do it specifically? I don't understand how to remove an actor from a tag. I want to "untag" the actor. What needs to go into the expression area to remove the tag from the actor?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Tags are text attributes. So by changing its attribute tag to none,0 or anything then the tag its originally set to, theoretically it shouldnt be taggged anymore.
  • DrGlickertDrGlickert Member Posts: 1,135
    This didn't fix my collision problems. However, the tags are being changed. I don't know why it's not working. If GS could just figure out how to release memory after destory/spawns I'd be able to create an incredible game...
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    So what exactly is your problem, when the alphas 0 its still colliding?

    Also if you have a collosion in both the first actor adn the 2nd actor that recylcles, even if you turn the collosion off on one the will still collide because theres collision in the other.

    So you would have to be turning the collosion off on BOTH actors if your collides are set up like that, which im thinking they are becasue your using tags
  • DrGlickertDrGlickert Member Posts: 1,135
    Well, here's what I have set up. Actor 1 and Actor 2 and then a "shot." I want the shot to hit Actor 1 or 2 and then turn all collisions off on the actor that's hit, but not on the actor that's not hit.

    I understand that the collisions will still be on, so I have the collisions based on the tag of the actor. So my theory is that if actor 1 is shot and the tag changes to nothing then it won't collide with actor 2. But it still does. Even when alpha is 0 they still collide.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    So you want the actor to be shot, alpha to turn to 0 collosion off, and still be onscreen?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    why not just have when actor overlaps or collides with actor shot, change position y to 500 or something
  • KingLordKingLord Member Posts: 2
    I ran into exactly the same problem, and as far as I can tell it's a "bug." At least what I would call a bug. Basically you can change the Tag of an actor with the Change Attribute action, but a running game does not respect this change.

    My best guess is that we aren't changing the Tag on the actor prototype, and GS goes off the prototype for Tag information and not off the instance of the actor in the running game.

    If anyone has gotten this to work then I too would love to know as it would solve a big problem for me in one of my games.
Sign In or Register to comment.