Memory Game (Need help)

This forum is meant for requesting technical support or reporting bugs.

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

Memory Game (Need help)

Postby ZeornWarlock » Sun Aug 17, 2008 9:46 pm

Hi folks,

I need to re-create a memory game similar to the demo that comes with AM.

However, I have a few problems.

1= My game needs to load more than one memory game called after certain variables during the adventure. Not sure how to accomplish that feat!

2= Some of the memory games need 4 tiles, some 6 and some 8. Now, I did try an 8-tile memory game to see if I could pull it off, but I always get an error script on the frame saying the following "Control array element (1) doesn't exist". (Might have to do with a variable, but that would be strange considering I copied and pasted everything.) If I continue, when I click on a tile I get the following error message "Type mismatch:'[string"(Null)"]'. See pictures below.

I have copied and pasted everything from the memory game to mine, Then I have assign everything to where it should go and made sure I have the same variables. I have changed two things in the script. I replaced the 64 tiles with 8 and I have replaced the tags of the tiles to match mine. In addition, I have put my own memory games tiles (the JPGs) in my game's Area folder and I named them from 1 to 4.

3= Once the games are complete, I must make sure the frame changes and a variable states it did change.

I need to add even more codes to the script, but this is what needs to be done first.

Thanks.

ZW.
Attachments
AM-Script-Problem1.jpg
AM-Script-Problem1.jpg (12.2 KiB) Viewed 7403 times
AM-Script-Problem2.jpg
AM-Script-Problem2.jpg (12.24 KiB) Viewed 7403 times
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 mercedes » Sun Aug 17, 2008 10:03 pm

Hi there...:)

Usually when u get that message.."control array element 1" means you have created something ...for example.. A textbox..and in the code you forgot to put (1) beside textbox(1)....Also it could mean you actually Put it there..but its not matching what it should match..In other words..you have (2) where it should say 1..Also could mean a hotspot(1). Or you have it in the procedures or Frame properties..to look for it..and it doens't exist. The procedures is looking for Hotpsot(1) in other words and you never created sort of thing..

Could also mean its trying to find variable...Again this is how i have seen why i got them..Because I have gotten these errors before, and thats what its been related to everytime.

The second one Null one could mean that its an invalid script..Type mismatch..You have something different in your Procedures than u do in your Frame script..The string is invalid. If you are getting them at the same time...Theyr'e probably related. Is what I gather..Like in the same frame.


I hope that helps..:)

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

Postby ZeornWarlock » Sun Aug 17, 2008 10:33 pm

Merci pour ton aide mercedes. :)

The thing is, I have been searching deep for the error all night, last night, but I still can't find it. Either or I did not name my JPGs right, but that would be odd, or one thing I have noticed is this...

"'- NumberOfIterationsToRandomize: Since the tiles are randomized by inverting
'the "tag" property of two hotspots, it corresponds to the number of inversions
'that take place during the randomization operation."


The memory demo uses 34 tiles and a number of iterations of 200. Why 200?

So my games with...

4 must have 24

6 must have 35

and 8 must have 47?

Or I am completely lost on the moon with this! :oops:

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 mercedes » Sun Aug 17, 2008 10:50 pm

Bienvenue..:)

I'm pretty sure its a hotspot number ...Or a variable is there and it doesn't need to be..or is missing..if you changed it you would have to change all if statements to match what u have..Not just copy and paste..Each of those Global variables are equal to whatever statement calls them.

Check all if statements where all variables come to play..


Probably just an automated error..but check subs..if you changed them..perhaps one of them doens't exist..That too would call for control element 1.

Another thing you can do is post the script here..and see if anyone can find the mistake..:)

Also make sure the Frame Properties has Initialize the game in there..

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

Postby ZeornWarlock » Sun Aug 17, 2008 11:37 pm

Mercedes,

Lines I have changed in the procedure...

'-----------------
'GENERAL SETTINGS:
'-----------------
NumberOfTiles = 8
NumberOfIterationsToRandomize = 200
I left it to 200 in case.

and the following one...

'************** PROCEDURE TO SHOW THE TILE ASSOCIATED TO A HOTSPOT ******************
Sub ShowHotspotTile(HotspotNumber)
If Hotspot(HotspotNumber).Tag <> 0 Then
Action.LoadAPicture Hotspot(HotspotNumber), "Sword" + CStr(Hotspot(HotspotNumber).tag) + ".jpg"
End If
End Sub


My jpgs are in the project's Areas folder so you know. They are named Sword1, Sword2, Sword3 and Sword4.


All the rest is where it should be.

Variables= NumberOfTiles, NumberOfIterationsToRandomize, NumberOfMistakes, IndexOfFirstHotspot, IndexOfTimedEvent
Frame properties= InitializeTheGame
HotSpot Properties = HotspotClick Action.GetHotspotNumber

What gets to me, is that it should not be that dificult to re-create.

In the introduction source code there is the following...
'Each hotspot has a "tag" property, which contains the number that
'identifies the corresponding tile. What we call a "tile" is one of the
'colored symbols that appear when you click on a hotspot (squares,
'triangles, etc.). To change the "tag" property, the following code is used:
'Hotspot(HOTSPOT_NUMER).tag = TILE_NUMBER


Could this be the problem! If so what do I do with this?

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 mercedes » Sun Aug 17, 2008 11:45 pm

Just a couple of things...

Are your hotspots in the Hotspot Graphics folder as well..?

and

Action.LoadAPicture Hotspot(HotspotNumber), "Sword" + CStr(Hotspot(HotspotNumber).tag) + ".jpg"


The name of Sword..should it have Sword1

I saw that and thought to ask it first..:)

In the introduction source code there is the following...
'Each hotspot has a "tag" property, which contains the number that
'identifies the corresponding tile. What we call a "tile" is one of the
'colored symbols that appear when you click on a hotspot (squares,
'triangles, etc.). To change the "tag" property, the following code is used:
'Hotspot(HOTSPOT_NUMER).tag = TILE_NUMBER


I think he is just explaining that to you..This procedure alone gets the cooresponding tile number [hotspot]..Which is why you have that in all hotspots..He is just telling you what each procedure means..

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

Postby ZeornWarlock » Mon Aug 18, 2008 12:04 am

mercedes wrote:Are your hotspots in the Hotspot Graphics folder as well..?


Hotspot Graphics folder? I have never seen that folder in AM. Neither the memory demo nor my game has one. The only place I saw the JPGs for the memory demo are in the Areas folder.

mercedes wrote:The name of Sword..should it have Sword1 or Sword2...


In my project's Areas folder, the names are Sword1, Sword2 etc... Nevertheless, in the code I only need to put Sword. Well that is the way I see it in the demo.

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 mercedes » Mon Aug 18, 2008 3:21 am

When you go to Manage Resourses..is where you will see Hotspots Graphics Folder. Hit link while in thumnail view and you will see it..

You would put the exact name of the file..So if its Sword1 then thats what you would put..:)
The demo has images and Shadow has named them Level1--Level17 ..He has made a string so that it saves him time having to go Level1.jpg +Level2.jpg + and so on.....Its converted to string so that all AM has to do is call jgps in the hotspots graphics folder--- Level1---All the way to Level 17 for pictures...+ he added the extention in the string so AM knows to look for Level1-Level17. JPG

Also make sure they all have the same Extention... JPG. if they have different extentions..AM won't find them just an added thought. i'm sure you have done that :P

Peace
Last edited by mercedes on Mon Aug 18, 2008 5:21 am, edited 1 time in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby ZeornWarlock » Mon Aug 18, 2008 5:16 am

Thanks for telling about the manage resource thing, I never had to look into it before I got the full commercial version. The Graphics hotspot folder is fine thought. All my needed jpgs are listed there. The problem comes from somewhere else.

By the way, the maker has only 17 tiles and the background in terms of jpgs. (The later found in a frames background folder) There are no other images as you pointed out. (If you do not count the ico. file that is.)

Anyhow, I still get the same errors. I even tried to name my jpgs the same as in the demo and even that does not work. :(

Well, I will need to work on the rest of the project until someone can help me solve this. Guess I will have to prepare other areas for the time being.

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 mercedes » Mon Aug 18, 2008 8:17 am

Just so you know..I fixed this..I sent you a PM.. The control element 1 you were missing was the TEXT(1) You will see it on the frame i put it there..:)

You needed to have "Number of Mistakes So Far"

I'll send it back to you..:)
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby ZeornWarlock » Mon Aug 18, 2008 9:16 am

mercedes wrote:Just so you know..I fixed this..I sent you a PM.. The control element 1 you were missing was the TEXT(1) You will see it on the frame i put it there..:)

You needed to have "Number of Mistakes So Far"

I'll send it back to you..:)


No need to send it back, I saw what you found and fixed it. Thanks a big bunch for this, mercedes. :D

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 mercedes » Mon Aug 18, 2008 9:18 am

De Rien..:)

I'm just happy you are able to work it now...all that work with graphics..thats where the work is really ...:P...Anyhow..Your very welcome~

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

Postby ZeornWarlock » Sat Sep 13, 2008 11:47 pm

Hey VB script geniuses,

I need more help with the basic memory game example, which comes with AM! :P

I need to call over 20 different memory games in a game I am creating; how the eck can I separate each of them in the VBS procedure?

I guess I have to make a variable name for each of them. Say I am in the main frame of the game. I make a random event variable and voila, one of the 20 memory games will start. How should I proceed in creating this?

Thanks.

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 Lyberodoggy » Sun Sep 14, 2008 12:42 am

Maybe the GetVariableReferenceFromName command will help you:
randomize
stagenumber=int(Rnd*20)
Set X=GetVariableReferenceFromName("Stage"+cstr(stagenumber))


Then refer to Stage selected by using X.Value
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby ZeornWarlock » Sun Sep 14, 2008 5:03 pm

Lyberodoggy wrote:Maybe the GetVariableReferenceFromName command will help you:
randomize
stagenumber=int(Rnd*20)
Set X=GetVariableReferenceFromName("Stage"+cstr(stagenumber))


Then refer to Stage selected by using X.Value


Sounds good, not sure it sounds easy thought. :P

Thanks. :)

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 Lyberodoggy » Sun Sep 14, 2008 5:10 pm

Variable reference is a real pain in the butt
I use it for plugins and its very confusing and difficult
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby ZeornWarlock » Sun Sep 14, 2008 5:17 pm

Lyberodoggy wrote:Variable reference is a real pain in the butt
I use it for plugins and its very confusing and difficult


Oh, that is so encouraging! :x

Still, thanks for the help. ;)

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 Lyberodoggy » Sun Sep 14, 2008 5:25 pm

Hehe... I can help you if you find any problems... When I started using it, even the help files were wrong :P
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests