Button Sequence Puzzle - The very basics

This forum is meant for people to share their knowledge by writing their own tutorials for Adventure Maker.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Button Sequence Puzzle - The very basics

Postby reneuend » Sun May 29, 2011 9:25 pm

If you want to create a puzzle where the player must solve the sequence, here is a very basic solution. It is designed to be highly customizable, which I will show in the next BBB issue! :wink:

Note: If you can't extract the code, let me know and I'll add a text file.

http://hickchickgames.com/downloads/A%20Sequence%20Puzzle.pdf
(not editable)

http://hickchickgames.com/downloads/A%20Sequence%20Puzzle.docx
(editable)

http://hickchickgames.com/downloads/sequence.zip
(Example AM Project File)
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Mon May 30, 2011 5:16 am

This is perfect!!!!! :D

... i took out the one sub..so no message boxes..type thing..I want them to not be sure what to do...
Only realize it when they click one and it goes down....and then so on.....But i figured you put that in there for us to see how it works. It's perfect. :D

Thx so much!~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Mon May 30, 2011 5:43 am

Great!

Yes, I put it in there because I thought it would be easier to see what was going on, and so it would give someone the ability to separate their code should they want to do a lot more then what I did!
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby ZeornWarlock » Mon May 30, 2011 5:54 pm

reneuend,

Do you have a win xp version of your "example"? The one you have here is for win 7 only! :( I'd check out the code only, but I'm a visual person! :P

ZW.
You have to make some to understand some.
User avatar
ZeornWarlock
Expert Member
 
Posts: 347
Joined: Tue Jun 05, 2007 12:52 am
Location: In front of the monitor.

Postby reneuend » Mon May 30, 2011 6:49 pm

What is win7 only? The project should work in XP or Win7.
Please let me know what it is you can't use from XP and I'll fix it!
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby ZeornWarlock » Mon May 30, 2011 7:39 pm

reneuend wrote:What is win7 only? The project should work in XP or Win7.
Please let me know what it is you can't use from XP and I'll fix it!


I suppose it should work and I think the reason it does not for me is because I still have the previous version of AM. But that's because here... http://www.adventuremaker.com/downloads.htm it states the latest version is for win 7 only which is the reason I did not update. If that version works with xp, then it should be noted and I will update of course. ;)

ZW.
You have to make some to understand some.
User avatar
ZeornWarlock
Expert Member
 
Posts: 347
Joined: Tue Jun 05, 2007 12:52 am
Location: In front of the monitor.

Postby reneuend » Mon May 30, 2011 8:40 pm

(updated) There isn't anything in the project I made that was special to Win7. I bet the project itself would work in your version. Have you tried it?

It wouldn't be too hard to build if you follow the instructions I sent. After copying and pasting the code, you only need to updated the highlighted areas...and there is only 3 per hotspot if I remember right. Can you open the "docx" file?
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Mon May 30, 2011 10:17 pm

ZeornWarlock wrote:
I suppose it should work and I think the reason it does not for me is because I still have the previous version of AM. But that's because here... http://www.adventuremaker.com/downloads.htm it states the latest version is for win 7 only which is the reason I did not update. If that version works with xp, then it should be noted and I will update of course. ;)

ZW.


Are you talking about the message that comes up with AM..when you first try and launch something that is made with a newer version of AM..?

Just ignore that..[Hit ok] If that's indeed what you're talking about...

I have XP..and I have 4.52 AM..All worked out fine for me..:)
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby ZeornWarlock » Tue May 31, 2011 5:41 am

reneuend wrote:(updated) There isn't anything in the project I made that was special to Win7. I bet the project itself would work in your version. Have you tried it?

It wouldn't be too hard to build if you follow the instructions I sent. After copying and pasting the code, you only need to updated the highlighted areas...and there is only 3 per hotspot if I remember right. Can you open the "docx" file?


reneuend, I wasn't referring ?you? to update your file; it was GM-Support that I was referring to, as he should update the notice about compatibility. Very sorry for that!

As mercedes mentioned, that was the report I was getting. I tried it anyway and it did work.

Very cool stuff and always useful. :)

ZW.
You have to make some to understand some.
User avatar
ZeornWarlock
Expert Member
 
Posts: 347
Joined: Tue Jun 05, 2007 12:52 am
Location: In front of the monitor.

Postby Vengeance66 » Wed Jul 27, 2011 12:18 am

I figure out everything, but when you get the correct order nothing happens...

I want to go to another frame... if that is possible...

Edit: This is the error after the correct sequence when nothing happens and when you click on a hotspot...

Code: Select all
function GetSequenceVal(sequence_pos)

  GetSequenceVal = GetWord(sequence_pos,sequence,",")

End Function




sub DisplayFail()

  Action.Message "Wrong melody!"

End Sub


sub DisplaySuccess()

  Action.Message "That is correct!"

  ResetGame()

End Sub



sub ResetGame()

  Action.GoToFrame Action.GetCurrentFrameName

End Sub





Function GetWord(index,text,delimiter)

Dim aWords

If ltrim(text) = "" Then
   GetWord = ""
   Exit Function
End If

If index > 0 Then
  index = index - 1
Else
  GetWord = ""
  Exit Function
End If

aWords = Split(text, delimiter)


If ubound(aWords) < index Then
  GetWord = ""
  Exit Function
End If

GetWord = ltrim(aWords(index))

End Function
Attachments
error.jpg
error.jpg (24.56 KiB) Viewed 9375 times
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby reneuend » Wed Jul 27, 2011 3:32 am

It looks to me that you are comparing a String with an Integer. I'd need to see your code in order to determine what's going on.

Did you download the files I have listed?
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Vengeance66 » Wed Jul 27, 2011 9:03 am

reneuend wrote:It looks to me that you are comparing a String with an Integer. I'd need to see your code in order to determine what's going on.

Did you download the files I have listed?


Yes. The code was from the project of yours. When you press the spots in wrong order, message shows in the lower section that is wrong. And if you get the order right, nothing happens...
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby reneuend » Thu Jul 28, 2011 3:31 am

I sent you a PM on how to do the sequence you wanted.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Vengeance66 » Thu Jul 28, 2011 10:38 am

reneuend wrote:I sent you a PM on how to do the sequence you wanted.


Thanks a lot reneuend
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby Vengeance66 » Thu Jul 28, 2011 11:37 am

Ok this is my last try...

This is in the procedures tab:

Code: Select all
function GetSequenceVal(sequence_pos)

  GetSequenceVal = GetWord(sequence_pos,sequence,",")

End Function

sub DisplayFail()

  Message "Wrong melody"


End Sub

sub DisplaySuccess()
  Message "It is correct!"
  ResetGame()

End Sub

sub ResetGame()

  Action.GoToFrame Action.GetCurrentFrameName

End Sub


Function GetWord(index,text,delimiter)

Dim aWords

If ltrim(text) = "" Then
   GetWord = ""
   Exit Function
End If

If index > 0 Then
  index = index - 1
Else
  GetWord = ""
  Exit Function
End If

aWords = Split(text, delimiter)


If ubound(aWords) < index Then
  GetWord = ""
  Exit Function
End If

GetWord = ltrim(aWords(index))

End Function


This is in the hotspots:


Code: Select all
btn_press_count = btn_press_count + 1

keynum = 1


expected_val = GetSequenceVal(btn_press_count)


If keynum = cint(expected_val) Then
    'correct sequence val
    If btn_press_count >= 12 Then
   DisplaySuccess()
    End If
Else
    'WRONG sequence
    DisplayFail()
    ResetGame()
End If


And this is in the correct hotspots, there are 8 correct:

Code: Select all
keycount = keycount + 1

    If keycount = 8 Then
      CorrectTune = CorrectTune + 1
      If CorrectTune = 8 Then
        Action.GoToFrame "room 3 correct"
      Else
        keycount = 0
        CorrectTune = 0
        Action.Message "Incorrect Tune. Try again!"
      End If
    Else
      'do nothing. the player missed.
    End If


Again, and again, and again... I get the same error... Is it because I use Win 7? Is it because I use older version of AM? Or it is the coding?
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby reneuend » Thu Jul 28, 2011 2:21 pm

The code I PMed you with doesn't go with the rest of the code. You had asked for a different kind of puzzle in your PM. :wink:

You can remove Everything except the last code box in your message. You only need the code that goes behind the hotspots.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Vengeance66 » Thu Jul 28, 2011 2:33 pm

reneuend wrote:The code I PMed you with doesn't go with the rest of the code. You had asked for a different kind of puzzle in your PM. :wink:

You can remove Everything except the last code box in your message. You only need the code that goes behind the hotspots.


I'll try then with both cases... Thanks!
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby reneuend » Thu Jul 28, 2011 2:40 pm

be sure to create 2 integer variables in the variable list:

keycount
CorrectTune

also, I suggest starting with a small sequence. No bigger than 3 hotspots to start with.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Vengeance66 » Thu Jul 28, 2011 4:18 pm

reneuend wrote:be sure to create 2 integer variables in the variable list:

keycount
CorrectTune

also, I suggest starting with a small sequence. No bigger than 3 hotspots to start with.


I kinda made this puzzle right! :D

I put the codes from your project for the third time and I know were it was my mistake. Instead of 8 correct, I've put 12 in the codes of the hotspot. Now when you get the correct tune you go to the correct tune :D

Thanks a lot! You were a huge help to my project...
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby reneuend » Thu Jul 28, 2011 7:50 pm

NP. I'm glad you got it working. :wink:
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA


Return to Post Your Own Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests

cron