variable help

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

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

variable help

Postby Candle » Sat Aug 26, 2006 2:13 am

I'm trying to use a password to to enable a hotsopt but I can't seem to get this to work.
Someone help me with this if you could.

password = "668944"
Do
returnvalue = InputBox("Please enter the password to enter the room.","Password")
Select Case returnvalue

Case ""
MsgBox "You have clicked Cancel"
Exit Do

Case password
MsgBox "Passwork OK. Power enabled to keycode..."
variable im trying to turn on--> password = password - 1
Exit Do

Case Else
MsgBox "Wrong passord. You will now be asked the password again."

End Select
Loop

Error I get


Error executing script.
The Scripting Engine returned the following error message:
Overflow: 'password'
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby Mystery » Sat Aug 26, 2006 7:47 am

I think that you are confusing AM with the line
password = password - 1
because you use the term password again (or: too many times).
How about enabling a hotspot by assigning the value 1 to a variable called e.g. PasswordOk like this:

Case password
MsgBox "Password OK. Power enabled to keycode..."
PasswordOk=1
Exit Do

Or is it something else you would like to do and I misunderstood it?
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Candle » Sat Aug 26, 2006 8:26 am

See I made a variable called password and I have a hotspot that will be come enabled with the password variable becomes 1 .
I want to use the password input box to make the variable password 1.
Get what I'm trying to do?
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby Mystery » Sat Aug 26, 2006 8:31 am

Yes, I think I understood you before.
So you just would have to do it like this:

Case password
MsgBox "Password OK. Power enabled to keycode..."
password=1
Exit Do

(Although I don't know if the name password would not confuse AM because you use it in the script also, but you can try. If it doesn't work, you need to change its spelling like I suggested to something like password_ok or passwordok etc. But maybe it works)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Candle » Sat Aug 26, 2006 8:33 am

Ok I could just add to it like Mypassword.
I will give it a try see what happens.
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby Mystery » Sat Aug 26, 2006 8:41 am

It should work as I used this kind of scipt a couple of times for my games, but I have never used the variable name password, I gave the variable always another name.

This is an example that I used for one of my games:

Code: Select all
password = "9638"
Do
returnvalue = InputBox("Please set the wavelength.","Wavelength")
Select Case returnvalue

Case ""
MsgBox "You want to quit"
Action.GoToFrame "Room1"
Exit Do

Case password
MsgBox "Wavelength set. Entry permitted."
Wavelenght=1
Action.GoToFrame "Room5a_zoom5 "
Exit Do

Case Else
MsgBox "Wrong wavelength. Try again."

End Select
Loop
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Candle » Sat Aug 26, 2006 8:44 am

I just put a My infront of the password and it works now. thanks for the help.

Little hint what I'm doing . heh heh
Attachments
escapesnapshot53.jpg
escapesnapshot53.jpg (101.73 KiB) Viewed 5035 times
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby Mystery » Sat Aug 26, 2006 8:46 am

Looks good :D
Glad you got it to work :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Candle » Sun Aug 27, 2006 12:54 am

Well spoke to soon as i is not working.
Anything else I can do to make this work?
Never mind did something else.
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby unwired » Mon Aug 28, 2006 9:50 am

maybe you should try with IF and ELSE IF.


dont know if :
Code: Select all
Select Case returnvalue
Case password


really means :

enter this case if returnedvalue is same as the value of password ? => not really sure never used case.
(i dont even mention the fact that it can compare integers and not strings and so on..)

but i made some conditionnals with If and else If and it works fine.
unwired
Member
 
Posts: 19
Joined: Mon Jul 24, 2006 12:20 pm

Postby unwired » Tue Aug 29, 2006 9:40 am

so you solved your problem ?.
unwired
Member
 
Posts: 19
Joined: Mon Jul 24, 2006 12:20 pm

Postby Candle » Tue Aug 29, 2006 9:42 am

In a kind of round about way I got it done.
thanks for asking.
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests