Input Name MODIFIED

druadic

20+ YEARS as a VP author. How time flies...
Site Supporters
Joined
Jun 9, 2003
Messages
1,272
Solutions
4
Reaction score
825
Points
131
Favorite Pinball Machine
Anything before 1939 (pre war), Firepower II, Agents 777
I've been working with this for a little while and came across a dilemma;
"what if I can only allow a certain length of letters within my WIP for VP for the player's name due to constricting length or size issues on the screen?"

Well, this has been fixed. I've tinkered with it and the result is total control of the amount of letters typed by the user. Using the Len command, the amount of letter typed by the user are limited, even though the messagebox will not stop the amount typed. Here is a demo:

Player 1 wants to put in their name. You have set the length to the maximum amount of letters being 5. The player types in "Anthony". The amount of letters typed by the user is too long, so the messagebox resets and the user must re-enter his name. The player then types in "Tony" and the amount of letters used is equal or less than 5. The name is shown and the game will start.

This tutorial is fully scripted and tells you what does what and where. I hope this helps someone out there with the issues of input of messagebox size and acceptance. This will be a very valuable tool for me in my WIP.
Hope it works for you too!!!

d

PS: The demo allows an equal or lesser value of 15 letters maximum. This can be changed in only two areas of the code. Just change the two "15" numbers and voila! READ THE SCRIPT for MORE information.

AGAIN, I had to upload this as a RAR file. PN's messaging system doesn't like certain types of files ;)
 
I dislike input boxes with a passion. Since no one else ever uses my computer, I don't need to know who I am, since most days I have that information. And I don't need to have my name displayed in any high score honor roll, since I'm only competing against myself. I like things nice and simple, and neat. But for those who like such things, I'm sure they'll appreciate your work.
 
I would most def. put it into my tables if I can get it to stay working once I do. I hate having to type in only three letters into a high score box at tables end. yeah I do have a three letter nickname, but you guys don't know that one and to put it into tables, while meaning much to me, doesn't mean squat to you! and I'm sure some of you would rather spell out your handle than just a 3 letter tag of some sort! So, Thanks! I'll see if I can use it...
 
The reason I did this is because the limited amount of room for textbox input in many WIPs. I'm sure someone will find it quite helpful. The worst part of it is when you have a textbox with limited room and someone puts in a 20 letter name and it either goes across the PF or shows lower than the textbox should. This fixes this problem.

I'm currently working on MessageBox control that allows only certain buttons to appear and control. This is so easy; you can control ANY "click" in a MessageBox and what it can do. I hope soon enough I can make a full blown script with info showing how to do this. I'm shocked how easy VB really is.

Mouse control on the game screen is the next issue I plan on jumping into. It DOES WORK; you just have to make VB or VP understand what is going on. I hope to redo Face To Face and Flip It using total mouse control.

d

Faralos;

You'll find the script is VERY VERY small. It actually is only four lines of code! This should make it much easier for the newbie author as well as the more seasoned author. I can see that many authors would like a way to have your ACTUAL NAME input into a game. This solves the problem. Better than initials for sure! Glad I can share all I can ;) I'm learning VB very quickly and have found commands that have me amazed. It's so amazing what VB can do using the proper commands. You can control ANYTHING.

JOHN;

If you have time, PLEASE put this RAR file in the tutorials and help section of the download area - not the basic area please. It seems I cannot reach this area on my system and only admin have access to this point. Thanks.
 
it is not a matter of its size (although 4 lines will help) it's a matter of it working in an already existing table! sometimes stuffwhich i think is cool, when I go to put it in I get all sorts of error codes and end up not getting it in at all, so, I will see if it works or not! I already have that random kicker code in one finished pin and 2 working wip's that coding is too only about 4-5 lines, so I am hoping this one works too. The problem is that the high score coding is usually many lines long and I hope I green out the right things!
 
it is not a matter of its size (although 4 lines will help) it's a matter of it working in an already existing table! sometimes stuffwhich i think is cool, when I go to put it in I get all sorts of error codes and end up not getting it in at all, so, I will see if it works or not! I already have that random kicker code in one finished pin and 2 working wip's that coding is too only about 4-5 lines, so I am hoping this one works too. The problem is that the high score coding is usually many lines long and I hope I green out the right things!

Faralos;

Use the modified script I made and then use Starman7007's SAVE code. Change it to allow "fname" to save and you've got it. Piece of cake. It will save the ENTIRE NAME when a high game is to be saved.

I use Starman7007's save commands since they are relatively easy to use and control.

Notice I removed MOST of the script from patrick's source code out of the "plunger" keypress area and created a separate SUB for the input of the name to take place. The player's name is used as "fname" so using any type of save feature to allow "fname" to save WILL SAVE IT. Easy as pie. I also like the fact as long as you have a separate SUB for the name input from the user, it makes cutting and pasting that small amount of code from table to table very easy. ;) It's also easier to keep track of it while coding.

I myself like to save "code" or "script" as txt files in notepad, and have a separate folder for all the goodies I need. I then open the file via notepad, copy the info and paste it right into VP. Lovely. Also in notepad, the files are 20 times smaller and you don't have to load separate VP table files which is a complete waste of time.


d

PS: If you'd like, I can fix this above to work out for you. All I have to do is implement the save from Starman7007's script to coincide with the modified name. Let me know if you'd like me to do this for you. Be glad to help :) Starman7007's script is approximately 15 lines of code, including a few places you need to add elsewhere. His way of scripting is very simplistic Faralos. He only uses two small SUB statements.

Folks, you also DO NOT need this for a game to start. This script can be used in the background by allowing the user to press ANOTHER KEY if they WANT to enter thier name. Either way, it can work whatever way you want it to.
 
if they use another key then would it still show up in my text box? I would like to have that as an option in my dogtown pin and yeah I can send it to you if you want. it uses Anthias's skeleton and already has things like tilt, 4 player, high score, match etc and to put that in may be a small nightmare for me to even attempt!
 
As requested by Will, I added his file to the VP Tutorial & Support File section.

http://www.pinballnirvana.com/index.php?name=UpDownload#LAST

John;

Thanks, but the description is a bit wrong. This modified version for the input name textbox description would be:

"allows a preset number of letters allowed by the user/player (MAX/MINIMUM) to accept or reject a name."

That might be better suited. I do appreciate the upload though. Seems my system can't go in there. Wierd.

Again, I appreciate the upload pal and the description change fix.

Faralos;

You can use ANY KEYPRESS for this to work!

Really, all you have to do is at ANY KEYPRESS (keycode) add "Iname" (next line after keycode and without the quotes as shown) and that tells that keypress to go directly to the Iname SUB. Don't forget to add "fname" to your DIM ARRAY statements (at the very top of your script) as well. That's all there is to it! Then add the four lines of code using SUB Iname. This would be best placed at the VERY END of your table script. This then works where and when a user wants to type in his/her name.

Like I said, I can script a small VP file for you tomorrow using the "save" feature from Starman7007's save script. I'll try to tackle it tonight if I have a second. I'll also explain as much as I can. Give me a few hours.

d
 
Edit taken care of. For now on just let me know what you want for a description.
 
Thanks for your efforts, please don't stop thinking about putting stuff up to help others, but in future you may wish to check out the tutorials section first...it could save you a lot of time:

http://www.pinballnirvana.com/UpDownload-req-getit-lid-323.html - has been there since 2005.

...and seeing as that was already there, I didn't do one the same, but showed how it could be used as a single high score: http://www.pinballnirvana.com/UpDownload-req-getit-lid-1527.html
or multiple high scores (4 name table): http://www.pinballnirvana.com/UpDownload-req-getit-lid-1528.html

Faralos: Slightly odd that you don't remember/recognise these, as you've already used them in most of your pins!

Regards,
Dan.
 
if they use another key then would it still show up in my text box? I would like to have that as an option in my dogtown pin and yeah I can send it to you if you want. it uses Anthias's skeleton and already has things like tilt, 4 player, high score, match etc and to put that in may be a small nightmare for me to even attempt!

The Anthias's table template for VP is a nice table template and the Rockinghorse Demo is very good as well. I would like to use them again to build a few one player tables, if I ever get the free time to build some new VP tables. I want to build a new table on Bob's table template as well, it's very nice. ;)
 
Thanks for your efforts, please don't stop thinking about putting stuff up to help others, but in future you may wish to check out the tutorials section first...it could save you a lot of time:

http://www.pinballnirvana.com/UpDownload-req-getit-lid-323.html - has been there since 2005.

...and seeing as that was already there, I didn't do one the same, but showed how it could be used as a single high score: http://www.pinballnirvana.com/UpDownload-req-getit-lid-1527.html
or multiple high scores (4 name table): http://www.pinballnirvana.com/UpDownload-req-getit-lid-1528.html

Faralos: Slightly odd that you don't remember/recognise these, as you've already used them in most of your pins!

Regards,
Dan.

Wiz;

That is the OLD version. I modified that version to limit the amount of letters a person can input into a textbox. It's different. Test both and you'll see. ;)

d

John, thanks again. Appreciated.
 
Dan you must remember that most of the table skeletons I use already have the scoring routines in, if they work I don't even look at it! scoring, multipliers and bonus advance are still three chunks of code that I don't know how to write yet. so for the most part if it's in a skeleton I leave them alone.
woops just lookedat it! yeah you are right! my olderskeleton used to use that input box, then the newer table skeletons (anthias, RH, Chris) all use their own so again if it ain't broke...
 
Dan you must remember that most of the table skeletons I use already have the scoring routines in, if they work I don't even look at it! scoring, multipliers and bonus advance are still three chunks of code that I don't know how to write yet. so for the most part if it's in a skeleton I leave them alone.
woops just lookedat it! yeah you are right! my olderskeleton used to use that input box, then the newer table skeletons (anthias, RH, Chris) all use their own so again if it ain't broke...

What little I know I've picked up by looking at other author's scripts. Some are way too advanced for me to understand, but a few snippets now and then help me figure things out.
 
Last edited:
What little I know I've picked up by lookimg at other author's scripts. Some are way too advanced for me to understand, but a few snippets now and then help me figure things out.

John;

The scripts really aren't that tough to figure out. Read a little on VB and most of the signs and commands and it's just like basic. Some of it takes me time to figure out myself until I can let it sink in. It looks tough, but really it's not.

d
 
for most of coding, it takes a bit longer but then WAMMO! like when I first started, nothing sank in, till it 'clicked' with Wizard Hat's help, I started to learn quite quickly. Now I can script drops, bulls (movable bulls), lights, simple attract modes (groups of lights with different timings), kickers with timers, but anything else is still 'not clicked' with me yet, meaning I can cut and paste it, but if it brings up an error, I'd have no clue as to why or how to fix it.
Now, it's funny, but when I at at work on a wip at most of the times I'll cut and paste, changing names as I go, to save time. But recently if I am really into that pin and don't want to look for that script (it may be in another table), I just write it out, then do a cut and paste from that. (guess that means I am finally starting to learn coding, whew! 'bout time...)
 
Just watch what you code or script and where. That's the biggest problem with VP table scripting; not keeping track of one simple command or piece of code. That's all it takes for a WIP to croak.

d
 
John;

The scripts really aren't that tough to figure out. Read a little on VB and most of the signs and commands and it's just like basic. Some of it takes me time to figure out myself until I can let it sink in. It looks tough, but really it's not.

d

Being just like basic doesn't help if you never used basic. The only things I ever wrote code in was DOS and Lotus, and that was over 20 years ago. One of the reasons I've done so many bagatelle is that I know the scripting works for them. Most everything else I'm lost with unless I get lucky or get help.
 
Wiz;

That is the OLD version. I modified that version to limit the amount of letters a person can input into a textbox. It's different. Test both and you'll see. ;)

d

John, thanks again. Appreciated.
Yeah - what I meant was my highscore tutorial uses the input name idea AND limits the size of the input string.

Just watch what you code or script and where. That's the biggest problem with VP table scripting; not keeping track of one simple command or piece of code. That's all it takes for a WIP to croak.

d
My top tip...comment your script as much as you can. That way if something doesn't work you can at least remember what you were trying to do and also, if you ask for someone's help they can also see what you were thinking as you wrote it.

Regards,
Dan.
 
Yeah - what I meant was my highscore tutorial uses the input name idea AND limits the size of the input string.


My top tip...comment your script as much as you can. That way if something doesn't work you can at least remember what you were trying to do and also, if you ask for someone's help they can also see what you were thinking as you wrote it.

Regards,
Dan.

Wiz;

That is correct and folks, if you're working on a WIP please take note of this. Well said Wiz - I agree with that 100%!

d
 
You know, you could do this without using an inputbox - and then every time the user enters a letter, you can figure out what the keycode was and add or subtract the number of letters that were entered.
 
Forum activity
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
      Mibs Mibs: StevOz has posted a new reply in the thread "Post interesting videos you found on YouTube".
      Back
      Top