Changing text in Tables

alarm656alarm656 Member Posts: 291
edited October 2013 in Working with GS (Mac)
Hi everyone can someone explain how to change the text?

I have created Table (TBText) and inside of table I created 2 text attributes 2rows and 2 columns.
Row1 & Columns1 has text: "The door is locked"
Row2 & Columns2 has text: "It's not used here"

I have a 3 actors. (Message, Door and Key)
I have 2 Global Boolean and 1 Text attributes. I called boolean attribute "key-own" and show-message, text attribute called "DisplayMessage"

Message actor has rule: Attribute game.show-message is true
Behavior: Display Text. Text: game.DisplayMessage

Door actor has following rules:

Rule1. Actor receives event touch pressed

Change attribute: game.show-message to true
Change attribute: game.DisplayMessage to TableCellValue(TBText,1,1) //"The door is locked"


Rule2. Actor receives event touch pressed
Attribute game.key-own true

Change attribute: game.show-message to true
Change attribute: game.DisplayMessage to TableCellValue(TBText,2,2) //"It's not used here"

//My second rule gives me the text from first rule.

Please help me.

Comments

  • SingleSparqSingleSparq Member Posts: 1,339
    Maybe I'm missing something here but you say your door actor has 2 touch rules. Isn't it always going to do the first one over the other? What separates the rules in respect to what make each available?
  • alarm656alarm656 Member Posts: 291
    Maybe I'm missing something here but you say your door actor has 2 touch rules. Isn't it always going to do the first one over the other? What separates the rules in respect to what make each available?
    Thanks for your reply. I don't know how it is. yes there is 2 touch rules in door actor. I just wanted to make different text. something like that: if player has nothing active item in inside of inventory and just touches the door than he can see the text that the door is closed.
    if player has a key but wrong key but he doesn't know that the key is not for this door. he will try to open door with key which he found and he has a active item(key) in inside of inventory, he touches the door but he sees the another text "it's not used here")))

  • SingleSparqSingleSparq Member Posts: 1,339
    edited October 2013
    Then you should add those as part of the touch rules for each. If if this collides withX and active item = 0 (you should have a global attribute that gets updated if a player has something active or not) then do this. In the otherwise put your other touch rule.
  • alarm656alarm656 Member Posts: 291
    thank you so much. I don't understand clearly but I'll try to add touch rules for each.
  • alarm656alarm656 Member Posts: 291
    Can someone help me please? I can't tables to work. It's just click and point game.
  • alarm656alarm656 Member Posts: 291
    I tried to add additional global attribute "integer" if key take true and touch pressed. Change attribute wrong key to (game.wrongkey+1)%2.
    So if wrongkey = 1
    Change attri: table change text. Doesn't work
  • -Timo--Timo- Member Posts: 2,313
    make a display text with game.wrongkey somewhere so you can check if its really changing. if so then it should work... maybe you can post your project or a screenshot of your rules
  • alarm656alarm656 Member Posts: 291
    Without wrong key
  • alarm656alarm656 Member Posts: 291
    With wrong key. I touch the wrong key and key has Alfa color 0,5 key-use attribute is in active. Touch the door but same message
  • alarm656alarm656 Member Posts: 291
    I added some graphics, will try to add progress graphics
  • alarm656alarm656 Member Posts: 291
    Door message rules. Just touch
  • -Timo--Timo- Member Posts: 2,313
    cant help you when you post screenshots of your game ;) I already understood what you meant. so you can post an image of your rules/behaviors? or even your project? (you also can PM me with project if you want)
  • alarm656alarm656 Member Posts: 291
    If wrong key use is active. game.R1 coup key-use is wrong key
  • alarm656alarm656 Member Posts: 291
    Thank you! Sorry I'm sending via iPhone)))
  • alarm656alarm656 Member Posts: 291
    maybe this can help you? https://www.dropbox.com/s/l42ft2zxu6xqwl0/table text changer.zip
    thank you so much) downloaded and exploring))
  • -Timo--Timo- Member Posts: 2,313
    edited October 2013
    this is also an option :) dutch and english text :) hope this helps
    https://www.dropbox.com/s/yiqsx281x4y5cyf/table text changer2.zip
Sign In or Register to comment.