Remembering a Spawn Actor

I am working on a logos game. I have it where when you type an answer on the answer scene, you hit a "check" button which checks with this number answer and takes back to the original screen. That works, but when you want to know its right, I was planning on adding a check mark under the picture in the original scene to show you have it right. The attribute "game.Word" (what you type in for the answer) is a number 77. You get this by adding every letter you typed (A=1, B=2, etc.). Under the picture in the original scene, I have it so "when game.Word is 77, spawn actor 'checkmark' in this location". This works, but when you click on the next picture to continue the game, it of course resets "game.Word" back to 0, like I told it to and it heads to the answer scene. If you hit the back button, though, the spawned image of the checkmark disappears after it had spawned. I believe that even though the attribute "game.Word" set to zero, I shouldn't delete the object it created on the original scene.

Please help!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    A couple things:

    Unless you have a reason to use numerical values (e.g. it's somehow a math game), I'd recommend storing text values in a ... text attribute. You can concatenate each letter by doing Change Attribute game.Word to game.Word.."game.Letter" where game.Letter is the letter that was tapped. You can then compare text attributes directly (When game.Word is "falcon" ...).

    You don't actually need to spawn the checkmark in this case. You can just place it on the scene and set it to self.color.Alpha=0 (invisible). When you need it to appear, have it change self.color.Alpha to 1. It sounds like you have a problem with you rules, so you may want to post a screenshot of them in order to get more help.

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

  • laduester42laduester42 Member Posts: 10
    tatiang,

    i've actually already tried that method before the one I listed above. For some strange reason, that hasn't worked either. Can you think of anything else to fix this problem?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    tatiang,

    i've actually already tried that method before the one I listed above. For some strange reason, that hasn't worked either. Can you think of anything else to fix this problem?
    Did you mean you tried the concatenating of letters or the self.color.Alpha?

    Without seeing your rules or project file, I can't really suggest anything else. You're welcome to send me a link to download the project file and I can see if it's a simple fix.

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

Sign In or Register to comment.