Making one actor's behavior dependant on another?

j9hawksj9hawks Member Posts: 3
edited November -1 in Working with GS (Mac)
I'm just starting to work with Game Salad and was wondering if anyone could give me some insight into making the following mechanic work:

I have eight actors on screen, placed together like a puzzle of sorts. At random intervals, I want another actor to appear and require the player to select a specific one of the eight "hotspots" within a given time limit or the game ends. The player has to pick the hotspot called for, and only that one.

I've been messing around in Game Salad and searching the forums, but I can't seem to find what I need.

Any help would be greatly appreciated.

Comments

  • svnsvn Member Posts: 445
    First of all, can you clarify this a little? Are the eight actors the hotspots? And what do you mean by a called-for hotspot? We can't help if we don't know the question.
  • j9hawksj9hawks Member Posts: 3
    Here's my setup:

    In the main gaming scene there are essentially 8 actor "buttons" grouped in a mass at the center. My idea is to have another actor appear at the top of the screen. I want this actor to require that only one, specific button be selected within a time limit, or the game ends.

    So let's say my eight buttons are color coded red, blue, green, yellow, orange, purple, black, brown.
    At one point, another, separate actor will appear and say, "press the red button."
    If that button is pressed within a second or two time limit, the "caller" actor will disappear and the game progresses with another "caller" showing up and requesting a different button be activated.

    My idea is for the caller's to be random, but my main issue is how do I designate it so that the player has to press the button called for by that specific "caller" actor in order to be successful?

    I hope that clarifies.
  • jbsitedesignjbsitedesign Member Posts: 25
    just add a game attribute with a name like PressedColor. When a button is pressed it can set Game.PressedColor to whatever value you want. Then your caller can monitor Game.PressedColor to see what was pressed. I would suggest that you have the caller reset the PressedColor value to some kind of default so that the next caller to appear will not automatically assume a new button has been pressed. so inside caller some logic like:

    if (game.Pressed Color = default)
    wait longer
    elseIf (Game.Pressed Color <> default AND Game.Pressed Color = My Color)
    add points or whatever
    reset Pressed Color to default
    go away and new caller come
    else
    bad stuff happens
    reset Pressed Color to default
    go away new caller come

    hope that helps
  • j9hawksj9hawks Member Posts: 3
    Thanks for the info!
Sign In or Register to comment.