GameSalad

Howdy, Stranger!

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

A pop up window on every single layer

Hi

Hoping someone could help me out. I have a game with 200 levels(layers) and I was wondering what the best way would be to set up a button(the same button on all layers) that will display various messages on every level. It is a HINT button that should display various hints for different levels.

Any advice/help would be appreciated,

Cheers,
Shaun

Comments

  • tatiangtatiang Posts: 11,860Member, Sous Chef, PRO, Senior Sous-Chef
    When you say layer, do you actually mean an actor layer in GameSalad, or are you using that word loosely to mean a new level in the game?

    Well, first put the hints in a table with a row for each level. Then, retrieve the hint from the row that corresponds with the current level.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ShaunRasulov@y7mail.com[email protected] Posts: 20Member
    thanks for your reply tatiang, but I think i didn't explain properly. The hint is an image(pop up window with a sentence in it) Upon pressing the button, this message has to come up, and it is different on every level. So, can i have just one actor displaying different images on different levels of the game?

    cheers,
    Shaun
  • TheGabfatherTheGabfather Posts: 633Member
    edited March 2013
    Would your hints essentially look the same, save for the difference in text? If so, it would be better to go with the Table solution as suggested by @tatiang . What you would do is simply make a single actor that has your popup window decorations as an image (eg. Frame / Word Bubble) and do a Display Text Rule that grabs from the appropriate Row from your Hints Table (eg. at Level 104, grab from Row 104).

    Should save you from creating 200 different images :)

    If you'll read up on Tables and Attributes I think you will be able to understand how this works and be able to work around this perfectly :) good luck!

    0011 0010 0011 0010 0010 0000 0110 1101 0010 0000 0111 0011 0110 1001 0110 1110 0110 0111 0110 1100 0110 0101

  • tatiangtatiang Posts: 11,860Member, Sous Chef, PRO, Senior Sous-Chef
    What @TheGabfather said.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ShaunRasulov@y7mail.com[email protected] Posts: 20Member
    great thanks guys, appreciate it,sorry for the late reply, my PC has been going through tough times:)
  • ShaunRasulov@y7mail.com[email protected] Posts: 20Member
    that worked awesomely, but i was wondering how I would make the text stay. every time i click the actor/button, the text shows up and disappears, what can i do so the text stays?
  • TheGabfatherTheGabfather Posts: 633Member
    edited April 2013
    Does it disappear immediately? It would help if you can tell us how your Rule is designed so far :) are you using a combination of On Touch and On Release?

    0011 0010 0011 0010 0010 0000 0110 1101 0010 0000 0111 0011 0110 1001 0110 1110 0110 0111 0110 1100 0110 0101

  • ShaunRasulov@y7mail.com[email protected] Posts: 20Member
    yes it does disappear immediately; it just appears for a second, then disappears. I would like it to stay until a player reached the next level. iam using touch and pressed, I've tried released, but then the hint text for the next level comes up automatically when i move to the next level, without having to ask for help/pressing the hint button. i hope it makes sense; the hint is different for every level and should only come up when the hint button is pressed.

    thanks for your help mate, appreciated
  • ShaunRasulov@y7mail.com[email protected] Posts: 20Member
    btw, aim from australia, don't be surprised by mate:)
  • TheGabfatherTheGabfather Posts: 633Member
    If your Rule is
    When Touch is Pressed
    do
    Display Text

    Don't. :)

    This will only display the text while Touch is Pressed. And since if you're using Released and the hint remains, I'm assuming you're using a single Scene for your game, for all levels? :)

    Just make do with Custom Attributes. Create a Boolean Attribute (eg. 'showHint' == "false"). When Touch is Pressed, Change Attribute 'showHint' to "true." And then in your hint Actor, do: If 'showHint' == "true," Display Text ...

    Then when you finish the level, reset 'showHint' back to "false." :)

    0011 0010 0011 0010 0010 0000 0110 1101 0010 0000 0111 0011 0110 1001 0110 1110 0110 0111 0110 1100 0110 0101

  • ShaunRasulov@y7mail.com[email protected] Posts: 20Member
    thanks mate, I've got the first part right, but how would i create the rule to reset the show hint button to false? what rule will i have to create?

    cheers

  • TheGabfatherTheGabfather Posts: 633Member
    Not to disrespect, but I think you need to master the basics more if you are to successfully implement most if not all the things you want with your game.

    Start by going through the CookBook, because I feel like you haven't yet. Good luck! :)

    0011 0010 0011 0010 0010 0000 0110 1101 0010 0000 0111 0011 0110 1001 0110 1110 0110 0111 0110 1100 0110 0101

This discussion has been closed.