Colored Boxes Script--Still NOT Working..[Solved]

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

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

Colored Boxes Script--Still NOT Working..[Solved]

Postby mercedes » Tue May 13, 2008 6:18 am

I have made four hotspots on top of each other...put colored pictures .ico files.

BLACK X4 ---GOING acroos
BLUE X4 ---Going across
GREEN X4 -----Going across
RED X4 -----Going across



So all together 16 hotspots..i want to make it so the end sequence is RED GREEN BLUE BLACK..

One on each hotspot..going across...the colored sequence will appear four colors..

but when i go to the test frame...my colors don't change..at all..Code is probably wrong..

can someone please help me..:(..I cant get over how long this one is taking me..lol..

I'm not sure how this ended up in the tutorial section..?..Moderator can you please move it..thanks..:)
Last edited by mercedes on Sat Aug 16, 2008 7:47 am, edited 2 times in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Tue May 13, 2008 7:42 am

Maybe you were looking at the code for the colored boxes... Anyway, you should provide us with your code to help you...


You don't have to place hotspots on top of each other. Just use one hotspot and create a sequence that loads pictures using this code:
Code: Select all
Action.LoadAPicture Hotspot(index_number),"filename.extention"

Place the pics into the external folder (or the areas? Sorry, don't remember) and replace index_number and filename.extention (but use the quotes)
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue May 13, 2008 8:00 am

Code: Select all
Action.LoadAPicture Hotspot(index_number),"filename.extention"


So am i writing this four times..once for each colour..?..How do i know what index to use by the way..?..I'm not sure what number i'm supposed to put in there..>i'll try it again..[/code]


Code: Select all
 
Color1 = Color1 - 1
If Color1 = -1 then Action.LoadAPicture Hotspot(2), "blue.GIF"
If Color1 = -2 then Action.LoadAPicture Hotspot(2), "green.GIF"
If Color1 = -3 then Action.LoadAPicture Hotspot(2), "red.GIF"
If Color1 = -4 then Color1=0 : Action.LoadAPicture Hotspot(2), "black.GIF"

If Color1 = -3 Then
ColorSet1 = 1
Else
ColorSet1 = 0
End If   


Then this was suposed to go into hotspot to check it ..


Code: Select all
If ColorSet1 + ColorSet2 + ColorSet3 = 3 Then
Action.GoToFrame "Frame_Name"
Else
Message "The code is wrong"
End If   



This was the code i HAD in there...now is urs..going to try out yours now
Last edited by mercedes on Tue May 13, 2008 8:50 am, edited 2 times in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Tue May 13, 2008 8:04 am

Well, do you want to have the player click on the boxes to change them or to have them changed automatically? And yes, you have to paste it four times for the four different colors :P...
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue May 13, 2008 8:56 am

Awe..kid your so smart..i could just bust right out crying..i cant beleive how easy that was...no i wanted the player to click on it...:) I'm so tired..i fought with that foreverrr.That was so easy..and no writing..That's what I like about the script you use as well..hardly any writing to it..makes for an easy code to remember..When I did code in excel..same thing, I found the easies way out of it..lol..

You are the man..~ 8)

What about index..what does this mean..how do i know what number to put in there..?

oh one more thing..how do i make the sequence now..??

i hope u are still here..

in all four boxes at the end i want them to be RED GREEN BLACK BLUE..

SO i gather i need variables here..this sequence will get them through the door..


DArn its not working..the other colours aren't loading..?? its going right to red..black to red..

heres code..

Code: Select all
Action.LoadAPicture Hotspot(1),"Blue.ico"
Action.LoadAPicture Hotspot(1),"Green.ico"
Action.LoadAPicture Hotspot(1),"Red.ico" 

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

Postby Mystery » Tue May 13, 2008 9:06 am

Hmmm, the code that you've added to your edited post, was what I've given to you once - it is not different from Lyberodoggy's idea... It's just more detailed, and contains the variables that you need, and creates the sequence :roll:

The index is the hotspot number where you want the image to appear.
Last edited by Mystery on Tue May 13, 2008 9:08 am, edited 2 times in total.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue May 13, 2008 9:07 am

Awwwe..you left already..??..i'm almost done it but its not working...?? :cry:

oh hi mystery..ya it was fine the code..it was working for me either though..mind u ..

I wasn't sure how many hotspots to have..with that one..and i didn't have the colors in the external folder..
How many hotspots am i supposed to have on top of each other..are there supposed to be more than one..Mystery..could be why it didn't work..i had four on top of each other..

maybe itll work now..?

would that make a difference..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Tue May 13, 2008 9:12 am

As Lyberodoggy has already mentioned:

You don't have to place hotspots on top of each other.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue May 13, 2008 9:18 am

nope won't work for me

now it just goes from black to blue..which is next colour..

heres code..

Code: Select all
Color1 = Color1 - 1
If Color1 = -1 then Action.LoadAPicture Hotspot(1), "blue.ico"
If Color1 = -2 then Action.LoadAPicture Hotspot(1), "green.ico"
If Color1 = -3 then Action.LoadAPicture Hotspot(1), "red.ico"
If Color1 = -4 then Color1=0 : Action.LoadAPicture Hotspot(1), "black.ico"

If Color1 = -3 Then
ColorSet1 = 1
Else
ColorSet1 = 0
End if
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Tue May 13, 2008 9:22 am

Make sure you write the file names correctly. You have used in your posts two spellings:
Blue.ico
blue.ico


Is the hotspot number correct?
Have you created the necessary variables?
Have you imported all image files into your AM project?

There must be some mistake that prevents it from working.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue May 13, 2008 9:28 am

As it stands..i have Black already as the first picture..then in the advanced..i added the above code..and this time i spelled it right..it is with capitals..

but its still not working..

the hotspot is 1..

What do u mean by creating variables..does that code not do that for me..automatically..?..i didn't realize i had to create them in them variables tab too..?

And all files are in the external folder..

So frustrating.. :cry:
Last edited by mercedes on Tue May 13, 2008 9:31 am, edited 1 time in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Tue May 13, 2008 9:31 am

No, the script doesn't create your variables automatically.
You need to create them by using the "VBS Variables".

Import the images into the "Hotspot Graphic Files" folder - they are hotspot graphics ;)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue May 13, 2008 9:34 am

how do i do that Mystery..create variables in the vbs variables..is that the link in the project folder..? or in the button in the same properties box thas says variables..

what do i write in there..and the files are in graphic folder..lol..makes sense..why would the blue one load then..i wonder..? and not green or red..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby mercedes » Tue May 13, 2008 9:48 am

So that's it then..?..Thanks anyways I guess.. :?

Lyberdoggy ..your code is missing something up there.. it only loads one colour at a time...
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Tue May 13, 2008 11:17 am

Mercedes, your post is at the limit of sounding rude.

This is a forum that members visit when they have time - and not a 24/7 hotline.
I can't be around all the time as I have work, household, children etc. to take care of :roll:
Attachments
variable.jpg
variable.jpg (46.08 KiB) Viewed 16652 times
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue May 13, 2008 11:47 am

I know "where" to create the variable..I don't think that's the problem..the other two hotspot graphics files..will not load..It goes from black to blue..and red and green will not load.


I wasn't sounding rude :roll: ...I was confused...I felt like i was g etting head way...but as soon as it got complicated...felt like everyone ran..


Anyways..Theres a different problem..here..nothing to do with the code as I'm sure you have used it many times...anyways doesn't matter Mystery.

I never said it was a 24hour hotline..is that you being sarcastic?
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Tue May 13, 2008 12:01 pm

Hehe! That's alright for me! I 'm at the crowd's service.


Anyway, I had to go to school, it was like 10 in the morning here (well, normally we go to school at 8:15- that's not spam, I right this to prevent any questions)

mercedes, I replied your PM without seeing this post, so the code included there is used to automatically change the color.
The variables you declare in your code are not global variables. That means that when the procedure ends, they are automatically destroyed and even if the procedure is still running, another call of the same procedure can't see them

What you need to do is create the variable Mystery mentioned. Remember to create an integer variable.
Then use one of the hotspots.
Make appear as red
Go to advanced and use this code:
Code: Select all
If myvariable=0 Then
myvariable=1
end if
Select case myvariable
Case 1
color="red.bmp"
Case 2
color="green.bmp"
Case 3
color="black.bmp"
Case 4
color="blue.bmp"
End Select
Action.LoadAPicture Hotspot(1), color
myvariable=myvariable+1


Alternatively, If you don't need the colors to re-appear, Create four hotspots on top of each other as you did before, make them appear as red, green, black and blue and finally make them hide once they are pressed (hotspot->Actions->Hide This Hotspot (permanently))
Now that I am rethinking, If you use the second one, Then have the last (blue) hotspot use the new action of AM 4.5, Action.ResetRemovedHotspots, you won't need the rest of the coding...
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue May 13, 2008 12:07 pm

Oh sorry kid..answered Pm..not a timed event i want..just buttons..go from BLACK BLUE RED GREEN...and i have this 4 places..

user has to hit

RED, GREEN BLACK BLUE..

to leave..:)

do u understand..not as complicated as timed event i think..then again..i don't know..lol
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Tue May 13, 2008 12:17 pm

Mercedes, checking more carefully the codes you used, I think you have missed to change things (match variable number, and hotspot number).

So for example, for hotspot 1
Code: Select all
Color1 = Color1 - 1
If Color1 = -1 then Action.LoadAPicture Hotspot(1), "blue.ico"
If Color1 = -2 then Action.LoadAPicture Hotspot(1), "green.ico"
If Color1 = -3 then Action.LoadAPicture Hotspot(1), "red.ico"
If Color1 = -4 then Color1=0 : Action.LoadAPicture Hotspot(1), "black.ico"


For hotspot 2, you need to make changes (Replace all "Hotspot(1)" by "Hotspot(2)", and replace all "Color1" by "Color2")
Code: Select all
Color2 = Color2 - 1
If Color2 = -1 then Action.LoadAPicture Hotspot(2), "blue.ico"
If Color2 = -2 then Action.LoadAPicture Hotspot(2), "green.ico"
If Color2 = -3 then Action.LoadAPicture Hotspot(2), "red.ico"
If Color2 = -4 then Color2=0 : Action.LoadAPicture Hotspot(2), "black.ico"


If those numbers aren't changed appropriately, the two last colors don't load indeed.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue May 13, 2008 12:26 pm

Ya..but im in the same hotspot though..like i havent even gotten past it..

The first hotspot..goes from black-blue-green-red-----This stops at blue.

Second hotspot..goes from black-blue-green-red..--I'm not here yet..I haven't done anything with this one at all yet..its right beside it..

I have four in a row..hotspots...and they all go from BLACK, BLUE, GREEN RED.

When the user is playing he/she has four blocks of colors...in a row..and they all go from BLACK-BLUE-GREEN-RED..

But to get out..they have to set..each one to a different color...and the sequence would be...RED GREEN BLACK BLUE.

not sure if this is any clearer.. :cry: ..not sure how else to put it...
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Tue May 13, 2008 12:36 pm

I've understood what you want to do.
But there must be some mistake that you've made that prevents it from working.

I've made a small demo with just 2 hotspots that go BLACK, BLUE, GREEN, RED (and repeat this sequence).

Download it, unzip it, and add it as a project folder in AM, so that you can take a look at it. Maybe you'll be able to find the mistake.

www.adventuremaker.mysterys-games.ch/color_boxes.zip
(fixed version)
Last edited by Mystery on Tue May 13, 2008 1:10 pm, edited 1 time in total.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue May 13, 2008 12:54 pm

Ok..i see it now..i beleive..only thing is..The first box u made..goes perfectly..The second one is messed up..it freezes and stops at green..and at one point it wouldn't do anything..would'nt repeat it self

This is the one in the thread..
Code: Select all
Color1 = Color1 - 1
If Color1 = -1 then Action.LoadAPicture Hotspot(2), "blue.GIF"
If Color1 = -2 then Action.LoadAPicture Hotspot(2), "green.GIF"
If Color1 = -3 then Action.LoadAPicture Hotspot(2), "red.GIF"
If Color1 = -4 then Color1=0 : Action.LoadAPicture Hotspot(2), "black.GIF"

If Color1 = -3 Then
ColorSet1 = 1
Else
ColorSet1 = 0
End If


The one in your project looks differently..

Code: Select all
Color1 = Color1 - 1
If Color1 = -1 then Action.LoadAPicture Hotspot(1), "blue.GIF"
If Color1 = -2 then Action.LoadAPicture Hotspot(1), "green.GIF"
If Color1 = -3 then Action.LoadAPicture Hotspot(1), "red.GIF"
If Color1 = -4 then Color1=0 : Action.LoadAPicture Hotspot(1), "black.GIF"


its just because there's no variable though right..?..


Now this is the second box..the one beside it..its messed up..i'll post it in case you did it fast and can see it better here..I would like to see if theres a difference..Cause if not..maybe i need to restart AM or something..


SECOND BOX beside it....It only changes colours with the box beside it..in other words..i have to hit blue in hotspot #(1) then ht blue in HS # (2)..know what i mean..?no big deal..i just wondered if its my computer or something or code..

Code: Select all
Color2 = Color2 - 1
If Color1 = -1 then Action.LoadAPicture Hotspot(2), "blue.GIF"
If Color1 = -2 then Action.LoadAPicture Hotspot(2), "green.GIF"
If Color1 = -3 then Action.LoadAPicture Hotspot(2), "red.GIF"
If Color1 = -4 then Color2=0 : Action.LoadAPicture Hotspot(2), "black.GIF"


have anything to do with Color2=0?

Ok well i'll try this...right now..

OH..by the way..i have it set to resize to fit hotspot...does this make adifference..?
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Tue May 13, 2008 12:57 pm

Oh! I didn't know mystery was working on a sample, so I 've made one too... I 'm uploading it...


By the way, the right sequence for this project is red, black, green, black.
Attachments
test colors.zip
sample project. Unzip and use..
(88.42 KiB) Downloaded 290 times
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue May 13, 2008 1:03 pm

ok..this didn't work either..man..ok at this point im beginning to think its the actual graphic files themselves...It silll only stops at blue..goes only from black to blue..I copied exactly your code..only I changed the .ico extention..and the capitals in the graphic files..And I have it set to resize to the actual hotspot...not sure if that makes a difference..

any ideas of what to do with them..?..

And does it matter that i may have used them esle where inthe project..I can't get over how diffucult this is turning out to be..lol..
Last edited by mercedes on Tue May 13, 2008 1:06 pm, edited 1 time in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Tue May 13, 2008 1:04 pm

Yep, sorry - I didn't upload the latest saved version, I've replaced it now, I hope this time it's correct.

Hmmm, can you zip and upload your project folder somewhere?
And tell the frame name where you have this puzzle?
Last edited by Mystery on Tue May 13, 2008 1:09 pm, edited 3 times in total.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Lyberodoggy » Tue May 13, 2008 1:05 pm

Check my file mercedes...
User avatar
Lyberodoggy
Administrator
 
Posts: 2519
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue May 13, 2008 1:52 pm

Hmmm, can you zip and upload your project folder somewhere?
And tell the frame name where you have this puzzle?


I'm not sure what you mean by this...

Still no freaken luck.. :cry:

this is whats in there now..

I have the HS.. and in it I have the black picture..Then in the advanced I have this...There are variables created..

Code: Select all
Color1 = Color1 - 1
If Color1 = -1 then Action.LoadAPicture Hotspot(1), "Blue-Tile.ico"
If Color1 = -2 then Action.LoadAPicture Hotspot(1), "G-Tile.ico"
If Color1 = -3 then Action.LoadAPicture Hotspot(1), "Red-Tile.ico"
If Color1 = -4 then Color1=0 : Action.LoadAPicture Hotspot(1), Black-Tile.ico"


I have renamed all the boxes...hoping that might help..Still no green and red tile after blue..

Now does it matter..that I have these two colors else where in the same project..?

Gonna try yours now Lyberdoggy...:)
Last edited by mercedes on Tue May 13, 2008 2:03 pm, edited 1 time in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Tue May 13, 2008 1:57 pm

mercedes wrote:
Hmmm, can you zip and upload your project folder somewhere?
And tell the frame name where you have this puzzle?


I'm not sure what you mean by this...


Well, the same way as Lyberodoggy and I have zipped and uploaded our demo project folders.

I just have the feeling that despite of those many posts, we are getting nowhere, so I thought that maybe Lyberodoggy or I can take a look at that part of your project, and maybe discover the mistake...
But for this, we need your project folder, and the information where (on which frame) the puzzle is.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue May 13, 2008 1:57 pm

Lyberdoggy for some reason..ur file won't unzip for me...the project is not in it..the subfolder exists but not the actual folder...do u know what i mean..?..Normall when u unzip it..it unzips and is by it self..till i dbl click it in AM..and then usee folder..well this keeps telling me to open project that I want...needs to be zipped up again...


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

Postby mercedes » Tue May 13, 2008 1:59 pm

Lyberdoggy..folder is empty..I am unable to unzip it properly..it appears as one folder..compared to usually two..one folder and a sub folder...this is sad...ugh..

*Sigh*..lol
Last edited by mercedes on Sat May 28, 2011 7:17 am, edited 6 times in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Next

Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron