Arrow puzzle: Someone please look at this...

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

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

Arrow puzzle: Someone please look at this...

Postby mercedes » Sun Jan 11, 2009 1:40 pm

Hi there...:)

I have arrows..and I want the arrows to change. The LEFT arrow is already on the frame...I want the user to go from the one that is there..to

UP
RIGHT
DOWN
LEFT AGAIN..which is a picture..the first one is not..

I have FOUR hotspots...they should all do the same...Picture 4 handles on a dresser...and a hotspot on each... And each handle goes from UP RIGHT DOWN LEFT..etc..

I have tried this one..and it works to change the arrows...but i'ts not working with the code..

I think this is so the user can only press it so many times.....I want the user to be able to go around as many times as they want..but i'm sure i used this before..to do that..:?

I have t his in all four hotspots..only set up slightly different..

Code: Select all
myvariable = myvariable - 1
If myvariable = -1 then Action.LoadAPicture Hotspot(1), "Up_arrow.bmp"
If myvariable = -2 then Action.LoadAPicture Hotspot(1), "Arrow_right.bmp"
If myvariable = -3 then Action.LoadAPicture Hotspot(1), "Down_arrow.bmp"
If myvariable = -4 then Action.LoadAPicture Hotspot(1), "Left_arrow.bmp"
If myvariable = -4 then my variable = 0

If myvariable = -2 Then
Arrow1 = 1
Else
Arrow1 = 0
End If


Is there a variation to this..so i can use it for what i want..

THanks..in advance..

EDIT..

I have changed mycode to this..but for some reason...it is skipping the first UP arrow in each hotspot..If i change the select case to CASE 1 as opposed to CASE 0 it works..the UP arrow is included ...but the code to get out doens't work..:?

Code: Select all
If myvariable>0 Then
box1=0
End If
If myvariable=4 Then
myvariable=0
End If
Select Case myvariable
Case 0
arrow="Up_arrow.bmp"
Case 1
arrow="Arrow_Right.bmp"
box1=1
Case 2
color="Down_Arrow.bmp"
Case 3
arrow="Left_Arrow.bmp"
End Select
Action.LoadAPicture Hotspot(1), arrow
myvariable=myvariable+1


Second hotspot

Code: Select all
box2=0
If myvariable2=4 Then
myvariable2=0
End If
Select Case myvariable2
Case 0
arrow="Up_Arrow.bmp"
box2=1
Case 1
arrow="Arrow_right.bmp"
Case 2
arrow="Down_arrow.bmp"
Case 3
arrow="Left_Arrow.bmp"
End Select
Action.LoadAPicture Hotspot(2), arrow
myvariable2=myvariable2+1



THird and fourth are pretty much the same...they skip the UP arrow :(

In my frame Properties i have this..

Code: Select all
myvariable=1
box1=1
myvariable2=1
myvariable3=1
myvariable4=1



THanks to anyone who can look at this..Or offer an alternative please..:) and thanks..
Last edited by mercedes on Mon Jan 12, 2009 3:24 am, edited 3 times in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Mon Jan 12, 2009 1:12 am

We had a similar question here:
http://www.adventuremaker.com/phpBB2/vi ... mated+lock

I don't see at first glance what's wrong with your code, but maybe looking at the other thread, you can figure it out :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Mon Jan 12, 2009 3:17 am

I looked at that...which is similar to what im doing for sure...I think it may not be what would work for this..Sounds like the user has to click it so many times..to get the code to work..In my case the user simply just has to get the right arrows...

The second code im working with now...but it skips the first arrow..I gather i'll just have to live with that...:(...I've tried everything..


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

Postby Mystery » Mon Jan 12, 2009 8:19 pm

I still guess it's the same process in both cases.

What happens if you use (slightly changed your first code)
Code: Select all
myvariable = myvariable - 1
If myvariable = -1 then Action.LoadAPicture Hotspot(1), "Up_arrow.bmp"
If myvariable = -2 then Action.LoadAPicture Hotspot(1), "Arrow_right.bmp"
If myvariable = -3 then Action.LoadAPicture Hotspot(1), "Down_arrow.bmp"
If myvariable = -4 then Action.LoadAPicture Hotspot(1), "Left_arrow.bmp"
If myvariable = -5 then my variable = -1

If myvariable = -2 Then
Arrow1 = 1
Else
Arrow1 = 0
End If
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue Jan 13, 2009 12:01 am

Hi Mystery...

I wanted to ask before i put this in all of my hotspots..

I can use this same code for all 4 hotspots..? all four handles..and I don't have to change "myvariable" in other words..it can be the same myvariable in all four hotspots..? I don't have to have myvariable2 myvariable3..and so on up to 4?

Just have the Arrowsvariables--arrow1 arrow2 arrow3 arrow4?

One last thing...Does this code work for the "clicks" they do..

I want them to be able to go around as many times as they want..and if they still land on -2 it will still be arrow1 = 1

Im wondering if this code works like...The user has to press it -2times for arrow1 to become =1

Or if i put this in the second hotspot..and arrow2 is supposed to be down lets say..I want them to be able to go around as many times...and if they choose to land on down..say the fourth time around..it will still work?

I know these codes are sometimes used for "amount of clicks"..i think..~

Am i making any sense..?
Peace..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Tue Jan 13, 2009 1:04 am

You need to have myvariable1, myvariable2, myvariable3 etc., and you'll need to change the hotspot number in the code, plus - depending on which arrow would be the correct one for the hotspot in question, - also change the second part of the code.

If you look at the other thread, there is a counter called Digit1 = Digit1-1
for the other digits, it's Digit2=Digit2-1 etc.
You need to create a click counter for each hotspot separately.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Tue Jan 13, 2009 6:58 pm

Thanks Mystery...
This worked beautifully..!~ I used the myvariable 2 +3 and 4 in all the other hotspots..I just changed the -5.. When i had the -5 in there..They had to click it one extra time..to get the arrow up again...which will work perfect for another puzzle i have..:D With this..i was able to go around the clock ..with no pauses..I can't believe it worked this time..but mind you..I had something different in the leave hotspot before..ok well thanks..off to watch Desparate Housewives..:P..lol..

Code: Select all
myvariable = myvariable - 1
If myvariable = -1 then Action.LoadAPicture Hotspot(4), "Up_arrow.bmp"
PlaySound GetPath(2) + "Snapt.mp3", False
If myvariable = -2 then Action.LoadAPicture Hotspot(4), "Arrow_right.bmp"
PlaySound GetPath(2) + "Snapt.mp3", False
If myvariable = -3 then Action.LoadAPicture Hotspot(4), "Down_arrow.bmp"
PlaySound GetPath(2) + "Snapt.mp3", False
If myvariable = -4 then Action.LoadAPicture Hotspot(4), "Left_arrow.bmp"
PlaySound GetPath(2) + "Snapt.mp3", False
If myvariable = -4 then myvariable =0

If myvariable = -3 Then
box1 = 1
Else
box1 = 0
End If


And I put this in the Leave hotspot

Code: Select all
Allboxes=box1+box2+box3+box4
If AllBoxes=4 Then
Dresser = 1
Action.CreateTimedEvent 1, "Action.GoToFrame ""Bedroom_light_off_Picture"""
PlaySound GetPath(2) + "Sound1.wav", False
Else
Text(1).Caption= "The code is wrong"
Action.CreateTimedEvent 1, "Text(1).caption="""""
End If



I'm very happy thanks so much..:D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron