Actor picks up, then releases at certain location

ffiorentinffiorentin Member Posts: 3
edited March 2012 in Working with GS (Mac)
Hi everyone and thanks for a super forum!

Im stuck at a point in my game development. What i want to achieve is this.
The actor/player picks up an object - the object gets attached to the actor when they collide.
So far soo good. BUT, when the actor returns to "homebase" i want the attached object to get unattached and positioned at the homebase. Cant seem to find out how to do this.

Any suggestions?

Thanks
F

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    on the item:
    Rule: when
    Event: overlaps/collides with actor player
    --changeAttribute: self.Tags To: pickedUp

    Rule: when
    Attribute: self.Tags = pickedUp
    --your constrain to player behaviors (or what ever you use to keep/show attachment)

    Rule: when
    Attribute: whatever used for condition when item is in base
    --changeAttribute: self.Tags To: atBase
    --either put your behavior and rules here or create a new rule for when Tags is atBase

    @};- MH
  • ffiorentinffiorentin Member Posts: 3
    Hi MotherHoose,
    Seems like the object wont be picked up now. Should the tags "pickedUp" etc be created as attributes first and if so what type? Never worked with tags in rules before except for collisions etc.
  • MotherHooseMotherHoose Member Posts: 2,456
    edited March 2012
    here is a little demo … you only change Tags when game is running … leave them blank in prototype
    (you could instead do a changeAttribute: self.Name or even add a new attribute
    (I like to use everything I have/can … to avoid adding extras to my work )

    http://www.mediafire.com/?4f1vqw32f1yo0ot

    @};- MH
  • ffiorentinffiorentin Member Posts: 3
    Wow, thank you so much! Exactly what i needed. Have a nice weekend!

    Fiorentin
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    @ffiorentin
    You're very very welcome!
Sign In or Register to comment.