GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to Exclude Game Controls touches for certain actions?

3itg3itg Posts: 382Member, PRO
edited August 2012 in Working with GS (Mac)
In my game, I have a ships flying around and you can touch them to target them. The currently selected target shows its stats in a frame of the HUD. Selecting only one target works mostly (if there are 2 ships on top of each other, it selects both).
But I would like the player to be able to move and fire their weapons while keeping the target selected. Currently, a touch anywhere outside the actor deselects it.
I am using the crossplatform control template by GS as the basis of my controls.
I have tried making rules like:
When all conditions are false; up is pressed, down is pressed left is pressed...
do action.
But I cant seem to find the right effect.
Anyone have any suggestions?

Comments

  • 3itg3itg Posts: 382Member, PRO
    the forum spammers moved me to page 5 in under an hour... ouch
  • MotherHooseMotherHoose Posts: 2,456Member
    @3itg … try

    gameAttributes: targetX … targetY

    on Ship (protoype)
    Rule: when
    Event: touch is pressed
    -changeAttribute: game.targetX To: self.Position.X
    -changeAttribute: game.targetY To: self.Position.Y

    everytime a different ship is touched the values will change to that ship's X;Y

    … aren't the spammers such nasties!

    image MH
  • 3itg3itg Posts: 382Member, PRO
    edited August 2012
    @MotherHoose
    Thanks a lot for the suggestion. But its still plaguing me.
    I made a video as a visual aid to explain the issue.



    This is me attempting to make actors (HudControlsPressed) and place them over the controls.
    These actors just switching a boolean true / false when touched.

    I added:
    When HudControlsPressed is true: do nothing,
    otherwise, deselect.

    However the initial deselect rule is when the Target reticle receives touch outside, deselect...
    So basically it seems like my rule is being ignored, or isn't true long enough for the other actor to notice, and it still registers the as outside and deselects the target.
    Which is a pretty crappy targeting system if i do say so myself :P
This discussion has been closed.