Msgbox not working ?[Solved]

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

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

Msgbox not working ?[Solved]

Postby Candle » Sat Nov 26, 2005 8:15 am

return_value = msgbox ( "Do you want a hint?", vbYesNo + vbQuestion, "HINT?")
if return_value = vbOK then msgbox "You have clicked OK. Here is the hint..."

This popups a msgbox and if you click yes it just closed and give no hint.
No does the samething?
Something change in the code?
Last edited by Candle on Mon Nov 28, 2005 8:13 am, edited 1 time in total.
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 GM-Support » Sat Nov 26, 2005 9:32 pm

Hi Candle,

Just change the vbOK into vbYes.

GM-Support
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby Candle » Sat Nov 26, 2005 10:42 pm

I get this error now?
Code: Select all
---------------------------
Error
---------------------------
Error executing script.



Make sure that:

- your system is not set to use chinese characters, or other special character sets;

- your global variables do not have names that are reserved by Adventure Maker.



The Scripting Engine returned the following error message:



Expected end of statement


Code looks like this .
Code: Select all
return_value = MsgBox ( "Do you want a hint?", vbYesNo + vbQuestion, "HINT?")If return_value = vbYes then MsgBox "You have clicked OK. Here is the hint..."


What I'm going to do is if they say Yes they get an item and if they say No they don't get the item.
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 ShadowHunter » Sun Nov 27, 2005 1:06 am

Hi Candle,

The code is just fine, just put the "If...." on a new line and it should work just fine... i's working perfectly here :wink:

Code: Select all
return_value = MsgBox ( "Do you want a hint?", vbYesNo + vbQuestion, "HINT?")

If return_value = vbYes then MsgBox "You have clicked OK. Here is the hint..."


Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Candle » Sun Nov 27, 2005 1:19 am

Thank you for the help ShadowHunter, but I get this error and two msgboxs ?
I had it giving an item so I remove that and had it going to a new room so remove that but still get the error.

---------------------------
Error
---------------------------
Error executing script.



Make sure that you are not trying to execute a script while another script is being executed. The Scripting Engine returned the following error message:



Cannot call this method while the script is executing.
~~~~~~~~~~~~~~~~~~~~

return_value = MsgBox ( "Do you want a hint?", vbYesNo + vbQuestion, "HINT?")
If return_value = vbYes then MsgBox "You have clicked OK. Here is the hint..."
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 ShadowHunter » Sun Nov 27, 2005 1:25 am

Hi Candle,

Sounds like you also have a timer or a plug-in running !

Please check that...

One advice for coding, do not put the code in the properties of a hotspot do it in the VBS procedures... just call a routine... you will make less mistakes.

If you are really stuck, please mail me that part of your project that goes wrong, I will solve you problem, coding in AM is my speciality :wink: Hope you already knew that 8)

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Candle » Sun Nov 27, 2005 1:36 am

Sent you a PM with a link
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 ShadowHunter » Sun Nov 27, 2005 3:02 am

Hi Candle,

Yip, a timer problem !

Solved your problem though... works great now 8)

It is caused by the fact that you are executing a script to display the system time by means of a timed event. Before displaying the message box you should remove that timer. I have added a piece of code on the requested frame that does that and also added a global variable that identifies the timerID so the correct timer can be removed.

The frame you asked for works perfectly now however you will need to apply the extra code to all frames that works in a similar way... just give the frame "eyeguy1" a preview... you will see that the will time stop during the periode the "Hint" message box appears. It will start runnig again after the user has made a choise, since you use the system time, a gap in time will appear, that's normal behavior of course...

Do you have an FTP-server so I can upload 15Mb ?

My mailbox doesn't alow it and my server has reached it's limit :wink:

Please PM me the FTP-details...

You know that all I ask in return is small credit in your game :roll: and a link to my website (but you have done that already in a great way) or a game on my X-mas list :lol:

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Candle » Sun Nov 27, 2005 3:45 am

Check your messages. :)
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 Candle » Sun Nov 27, 2005 4:23 am

I got it working on my own. yaaaaa
I'll just leave the timer off of the frame.

Code: Select all
return_value = MsgBox ( "Do you want the eyeball?", vbYesNo + vbQuestion, "EYEBALL?")
If return_value = vbYes then Action.AddItem "eyeball"
If return_value = vbYes then  Action.GoToFrame "eyeguy2"
 

No need to upload that file now .
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 ShadowHunter » Sun Nov 27, 2005 1:14 pm

Hi Candle,

Glad you solved it by yourself. However my solution leaves the timer on the frame.

You should write the code like this, it's more efficient and easier to read

Code: Select all
return_value = MsgBox ( "Do you want the eyeball?", vbYesNo + vbQuestion, "EYEBALL?")

If return_value = vbYes then
      Action.AddItem "eyeball"
      Action.GoToFrame "eyeguy2"
End if


Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Candle » Mon Nov 28, 2005 1:26 am

Thanks for the help. upload that file so I can look at it ok.
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

cron