INPUT BOX

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

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

INPUT BOX

Postby andyrads » Sun Aug 06, 2006 2:37 pm

Is there any way of making an Input Box as part of a frame rather than the standard pop-up box? Hope that make sense.
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby ShadowHunter » Sun Aug 06, 2006 3:19 pm

Hi Andyrads,

Welcome to the forums :D

I'm sure it can, just take a look at the help document... the controls section to be more specific.

You will need to play around a bit but it should be possible...

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 andyrads » Sun Aug 06, 2006 4:08 pm

Thanks for your reply Shadow. I've been playing around with the controls but it either doesn't work properly or doesn't do what I want. Hope someone has some script that may be the solution.

Cheers,
Andy
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby ShadowHunter » Sun Aug 06, 2006 5:09 pm

Hi,

There are some things you can't seem to change:

- Height: can't be made smaller than a default size
- Borders: can't remove them

Both properties not being able to set makes things kind of hard make an interface the way you wan't.

You can almost use any property that is available in VB6 but not all of them work.

Small snippet of what I used:

Code: Select all
LoadControl TextBoxObject(1)   
TextBoxObject(1).Height = 8*15
TextBoxObject(1).Width = 250*15
TextBoxObject(1).Left = 160*15
TextBoxObject(1).Top = 60*15
TextBoxObject(1).BackColor = RGB(255,255,255)
TextBoxObject(1).ForeColor = RGB(0,0,0)
TextBoxObject(1).TabIndex = 0
TextBoxObject(1).FontSize = 8         
TextBoxObject(1).Visible = True


What do you want to create ? Maybe I can help to some extend.

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 andyrads » Sun Aug 06, 2006 5:17 pm

Shadow, many thanks for your help. What I wanna do is create a box which is the INPUT for passwords etc. This then needs to be checked from a list which contains all of these passwords. Does that make sense? What I don't like is the pop-up boxes for inputting.

Thx
Andy
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby Mystery » Sun Aug 06, 2006 5:49 pm

What you can do is use ShadowHunters code to load a textbox and also load a picture of a button into a hotspot next to it that the player has to push as soon as a password is entered. Then you can use the following code for this button (here the example from the helpfiles but I changed it to message instead of a pop-up messagebox)

Code: Select all
If TextBoxObject(1).Text <> "dog" Then
   Message "Wrong Password!"
Else
   Message "Password Correct!"
End If


Is this what you meant?
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby andyrads » Sun Aug 06, 2006 6:27 pm

Hi Mystery, thanks for the help. Been trying a few things like this now. However, on going to the next frame, the messagebox stays on screen. I've tried to use unload control, but this causes the input to be lost and creates an error message. The additional problem is how do you create an array of all allowed passwords?

cheers,
Andy
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby Mystery » Sun Aug 06, 2006 6:35 pm

I'm not sure where you added the unload control command. If I add it like this, it works:
Code: Select all
If TextBoxObject(1).Text <> "dog" Then
   Message "Wrong Password!"
Else
   Message "Password Correct!"
End If

UnloadControl TextBoxObject(1)


When the player wants to try again he/she has just to click again on the hotspot that loads the textbox. I had no problems just checked in my demo.

What do you mean with the array of passwords? Do you mean that you don't want to have an input box but checkboxes instead, and the player has to check the correct one?
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby andyrads » Sun Aug 06, 2006 6:44 pm

Hi Mystery, thanks for the help so far. Have now successfully unload the control text box.

The game calls for quite a few password entries. These are entered into the same box on different occasions. Therefore the solution has to be a little more complex I feel. Using the method so far, I would need far too many frames just to get the inputs. What do you think?

Andy
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby ShadowHunter » Sun Aug 06, 2006 6:49 pm

Hi,

You must place the "check" code into the VB-procedures and call the routine upon checking the password in each frame... that is very easy and not at all complex... just one line of code.

Upon calling the routine pass the framename so the script knows what password to use. Use a "select case" combined with an "and" for frame filtering.

I hope this makes sence,

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 Mystery » Sun Aug 06, 2006 6:54 pm

But wouldn't be still several frames needed this way? As I understood andyrads wanted to work with one frame only if possible.

I also thought of placing the check code into the VB Procedures but I thought of working with variables. So if there is a specific order of the passwords, you could call the routine depending which variable has the value of one already.
I haven't checked yet if it works, I'm about to try it out.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby andyrads » Sun Aug 06, 2006 7:01 pm

Shadow, that sounds gr8 (I think). Now let me see if I've got where you're coming from...create a procedure to call. Each frame has a password (that's fine). But I have to admit I'm not sure how to create the vb check code which can be called for each frame to check whether access is allowed or not. Can you help with a small sample?

many thanks,
Andy
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby ShadowHunter » Sun Aug 06, 2006 8:58 pm

Hi,

Of course I'm willing to help you by making a small example. Just describe exactly what you need (using two or three frames)

Of course Mystery is right, you need to use variables to remember if a password was already entered correctly.

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 ShadowHunter » Mon Aug 07, 2006 9:20 pm

Hi,

I have made a small example of some password processing like promissed... It might not be exactly what you need as a copy paste example but it uses an array of coding methods... good to learn from :wink:

Though I must admit I have done this in a big hurry (holiday here I come) and it might be a bit complex and poorly documented.

So please feel free to ask for more information.

Hope this helps,

Kind regards,

ShAdOwHuNtEr
Attachments
inputbox.zip
(58.11 KiB) Downloaded 474 times
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby andyrads » Mon Aug 07, 2006 11:13 pm

Shadow. This is most excellent! Very many thanks. I am now working my way through it to understand it fully. It seems to me the easiest way to include a password (if necessary) on any given frame is to include this in the Frame Properties. But your scripting for inputing addresses is exactly what I wanted. I am now endeavouring to adapt this part only (with limited success), but I will keep at it!

Have a good holiday!
Andy
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby ShadowHunter » Tue Aug 08, 2006 9:44 am

Hi,

Glad I could help and thanks :D

Good luck with your project.

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 andyrads » Tue Aug 08, 2006 11:45 am

Hi Shadow, I have now successfully used your script to input the addresses. Brilliant. I'm now working on making text appear as though being typed one letter at a time. I've checked the forums but can find nothing on this topic. Any ideas?

Andy
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby ShadowHunter » Tue Aug 08, 2006 6:34 pm

Hi,

Glad the script helped you out :D

As you see using script in AdventureMaker is pretty easy once you get the hangs of it and offers limitless possiblities...

Yeah, I can make text appear one character per time... I have made a small update to the pervious demo that shows how... I'm pretty sure you are excited with this :wink:

Hope you like it,

Kind regards,

ShAdOwHuNtER
Attachments
inputbox_with_typeeffect.zip
(60.4 KiB) Downloaded 489 times
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby andyrads » Tue Aug 08, 2006 11:05 pm

Hi Shadow,

Once again many thanks for your invaluable help. I've copied the sub-routines into my game, but I'm having problems getting it to run. Keep getting an error message saying CONTROL ARRAY ELEMENT 8 DOESN'T EXIST. Strange.


Andy
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby ShadowHunter » Tue Aug 08, 2006 11:26 pm

Hi,

The error is normal, in my example the textbox used has ID 8, I have only used a blanc space so you can't see it in edit mode.

Just change Text(8).Caption to the textbox number you have used (right click on the frame to create a text in AM, then hover the mouse over it to see the ID)

Then it will work...

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 andyrads » Tue Aug 08, 2006 11:33 pm

Hi again,

Funny that, I was playing around with the (8) after Text but I never had a text box in the frame. I did have one, then deleted it as I thought that as the text was in the Frame Properties it wasn't necessary. So basically you just need an empty text box.

Once again, many thanks.
Andy
andyrads
Junior Member
 
Posts: 10
Joined: Sun Aug 06, 2006 2:36 pm

Postby Lyberodoggy » Wed Dec 31, 2008 3:58 pm

OMG!
Sorry for bumping this post but I just realised that the typing effects plugin I and chromegloss developed was not necesary since a better code already existed...

Seems that shadowhunter is always five steps ahead :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