Trying to reset a table

newbie001newbie001 Member Posts: 8
edited July 2014 in Working with GS (Mac)

Hello Everyone,

I am fairly new to GS, so still trying to learn a lot. I hope some of you could guide me and show me the correct path as I am stuck at some point.

I am trying to make a word game. My problem is that when I try to reset the scene, the already filled alphabets could be erased with no problem (I am using copy table to achieve that), but I cannot write re-enter alphabets to the answer slots. It is not letting me do that.

What I am doing:

A Reset Button, which has:
-On touch
-if game.reset is true (reset is a boolean attribute created by me)
- trigger "Reset scene" behaviour

On another actor (for answer slots), I have placed a Rule:

  • if game.reset is true
  • Copy Table "Table_1_blank" to "Table1"

On the actor (where alphabets are pre-populated for selection):

  • On touch
  • ChangeTableValue for Table: "Table1", row:"1", Column: "Game.count" and Value: "self.image" (Where count is an integer game attribute)
  • ChangeAttribute "game.count" to "game.count+1"

Table1 created by me has one row and 5 columns

I am able to place alphabets in the answer section in the first attempt, but after reseting the scene (successfully removing the selected alphabets from the answer section) I cannot re-enter the alphabets into the answer section.

I was trying to attach few screenshots along with my post to make my question much more clear, but I don't know how to do that (As under attach image it is only taking url's).

Thanks in advance everyone :-)

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2014

    Hi @newbie001 and welcome to GSC and the Forums.

    I think the answer is straightforward: when you reset any aspect of a game back to its original settings, you have to include all elements relevant to it ... so in this case, add the following to your Rule:

    When game.reset is true
    Copy Table "Table_1_blank" to "Table1"
    Change Attribute game.count to 1

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • newbie001newbie001 Member Posts: 8

    Amazing :-) It solved my issue. Thank you very much @gyroscope. I really appreciate your help.

    Have a great day :-)

Sign In or Register to comment.