Really need direct communication between actors!

HunnenkoenigHunnenkoenig Member Posts: 1,173
edited November -1 in Working with GS (Mac)
In my game there are actors, which have shields around them.

I spawn the shield from the actor with an attribute. If attribute "shield" is true, spawn actor "shield".

Now I want it so, that when the ball hits shield, it disappears and then the ball can hit the actor again and then the actor disappears.

Because of very complex rules with many attributes I can't change the whole thing, and it also wouldn't make sense.

Now my problem is, that I can't tell the actor, when the shield was hit to make other actions and set other attributes to true or false or such.

I have many of the same actors and I would have to make them all an own game attribute to check if its shield was hit or not.

Now I can't make the shield disappear on colliding with the ball, because my actor won't receive the command to change other needed attributes, so I have to disable the shield on overlaping, but then it happens sometimes that my ball don't make contact with the actor, but only with the shield and it looks like I would have to hit the actor 3 times instead of 2 times.

I can live with it if it has to be, but I would prefer my initial plan.

That's why we really need the possibility to change attributes between actors directly.

If that mad sense to you.... :-)

Comments

  • synthesissynthesis Member Posts: 1,693
    I COMPLETELY AGREE. THIS IS MY NUMBER 1 WISH LIST ITEM.
    Otherwise...its really more procedural and not more object oriented.

    I think we will get it eventually...just not sure when.
  • BeyondtheTechBeyondtheTech Member Posts: 809
    Perhaps I'm seeing it differently, but...

    1. each player Actor can have a shield Actor.
    2. each shield Actor would constrain to the position of the player Actor.
    3. each actor has its own Actor Attribute called `Shielded,` and initially set to TRUE.
    4. when the ball Actor collides with the shield Actor, destroy the shield Actor.
    5. when the ball Actor collides with the player Actor,
    if `Shielded` Attribute is FALSE, destroy player Actor, else
    change `Shielded` Attribute to FALSE.

    Steps 4 and 5 should happen simultaneously, assuming the collision boundaries are identical.
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    @Beyondtech: Thanks. It is doable, but as I said, I have other rules with other attributes, which can't be affected if the shield is around and there is no direct communication.

    It is complex and I don't want to explain it in detail, because it is boring :-)

    My main problem was, that I would have to overhaul the whole actor.

    Now I tricked a little bit and I managed it relatively simple. I wanted to edit my main post, but then you both already posted :-)

    Now I don't need direct communication so desperately any more, but It would make life easier though :-)
  • synthesissynthesis Member Posts: 1,693
    maybe try change image switching instead of multi-actors...since the shield is always on the actor.
  • synthesissynthesis Member Posts: 1,693
    BTW...Sometimes an overhaul is the best thing...always makes things simpler in the end and more efficient. I'm getting ready to start my 3rd overhaul on one of my leading role actors right now.

    KEYWORD: OPTIMIZATION!!!
  • BeyondtheTechBeyondtheTech Member Posts: 809
    Yeah, synthesis. I was also thinking about creating duplicate animations, one with a shield, and one without. That way you're saving CPU cycles by not having two separate actors for one particular purpose.
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    Yeah, I use image switching where I can, but unfortunately the shield is animated and so I can't simply switch, if I want to have the shield have a purpose.

    Maybe optimization is good, but honestly, I am already bored with this game :-)
    I want it having out on the store and start another.

    A bit later I can come back and make updates, but now all I want to finish it.
Sign In or Register to comment.