Pinball Nirvana Home Page

Go Back   Pinball Nirvana Forums > VP/VPM Help and Support > Resources & Tutorials

Resources & Tutorials Announce & Discuss Resources and Tutorials

Reply
 
Thread Tools Search this Thread
  #1  
Old 12-17-2010, 01:55 AM
druadic's Avatar
druadic druadic is offline
Pinball Wizard
 

Join Date: Jun 2003
Posts: 789
Credits: 94,199.24
Thanks: 125
Thanked 42 Times in 34 Posts
Rep Power: 23
druadic will become famous soon enough
Default Input Name MODIFIED

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
Attached Files
File Type: rar tutorialinputnameMODIFIED.rar (26.7 KB, 287 views)
__________________
RETIRED from VP
Reply With Quote
  #2  
Old 12-17-2010, 02:51 AM
tiltjlp's Avatar
tiltjlp tiltjlp is offline
PN co-founder
 

Join Date: Jun 2003
Location: Cheviot Ohio
Posts: 3,727
Credits: 215,802.09
Thanks: 45
Thanked 143 Times in 101 Posts
Rep Power: 54
tiltjlp has a spectacular aura abouttiltjlp has a spectacular aura about
Default

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.
__________________
John

Reply With Quote
  #3  
Old 12-17-2010, 08:46 AM
faralos's Avatar
faralos faralos is offline
Faralos
 

Join Date: Nov 2008
Location: Eastern Pa.
Posts: 1,816
Credits: 124,907.30
Thanks: 5
Thanked 194 Times in 171 Posts
Rep Power: 31
faralos has a spectacular aura aboutfaralos has a spectacular aura aboutfaralos has a spectacular aura about
Default

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...
Reply With Quote
  #4  
Old 12-17-2010, 04:31 PM
druadic's Avatar
druadic druadic is offline
Pinball Wizard
 

Join Date: Jun 2003
Posts: 789
Credits: 94,199.24
Thanks: 125
Thanked 42 Times in 34 Posts
Rep Power: 23
druadic will become famous soon enough
Default

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.
__________________
RETIRED from VP

Last edited by druadic; 12-17-2010 at 04:49 PM.
Reply With Quote
  #5  
Old 12-17-2010, 05:15 PM
faralos's Avatar
faralos faralos is offline
Faralos
 

Join Date: Nov 2008
Location: Eastern Pa.
Posts: 1,816
Credits: 124,907.30
Thanks: 5
Thanked 194 Times in 171 Posts
Rep Power: 31
faralos has a spectacular aura aboutfaralos has a spectacular aura aboutfaralos has a spectacular aura about
Default

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!
Reply With Quote
  #6  
Old 12-17-2010, 05:43 PM
druadic's Avatar
druadic druadic is offline
Pinball Wizard
 

Join Date: Jun 2003
Posts: 789
Credits: 94,199.24
Thanks: 125
Thanked 42 Times in 34 Posts
Rep Power: 23
druadic will become famous soon enough
Default

Quote:
Originally Posted by faralos View Post
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.
__________________
RETIRED from VP

Last edited by druadic; 12-17-2010 at 06:09 PM.
Reply With Quote
  #7  
Old 12-17-2010, 09:12 PM
faralos's Avatar
faralos faralos is offline
Faralos
 

Join Date: Nov 2008
Location: Eastern Pa.
Posts: 1,816
Credits: 124,907.30
Thanks: 5
Thanked 194 Times in 171 Posts
Rep Power: 31
faralos has a spectacular aura aboutfaralos has a spectacular aura aboutfaralos has a spectacular aura about
Default

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!
Reply With Quote
  #8  
Old 12-18-2010, 12:01 AM
tiltjlp's Avatar
tiltjlp tiltjlp is offline
PN co-founder
 

Join Date: Jun 2003
Location: Cheviot Ohio
Posts: 3,727
Credits: 215,802.09
Thanks: 45
Thanked 143 Times in 101 Posts
Rep Power: 54
tiltjlp has a spectacular aura abouttiltjlp has a spectacular aura about
Default

As requested by Will, I added his file to the VP Tutorial & Support File section.

http://www.pinballnirvana.com/index....pDownload#LAST
Attached Thumbnails
Click image for larger version

Name:	Name input.jpg
Views:	279
Size:	42.1 KB
ID:	4626  
__________________
John

Reply With Quote
The Following User Says Thank You to tiltjlp For This Useful Post:
druadic (12-18-2010)
  #9  
Old 12-18-2010, 12:49 AM
druadic's Avatar
druadic druadic is offline
Pinball Wizard
 

Join Date: Jun 2003
Posts: 789
Credits: 94,199.24
Thanks: 125
Thanked 42 Times in 34 Posts
Rep Power: 23
druadic will become famous soon enough
Default

Quote:
Originally Posted by tiltjlp View Post
As requested by Will, I added his file to the VP Tutorial & Support File section.

http://www.pinballnirvana.com/index....pDownload#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
__________________
RETIRED from VP

Last edited by druadic; 12-18-2010 at 02:11 AM.
Reply With Quote
  #10  
Old 12-18-2010, 02:20 AM
tiltjlp's Avatar
tiltjlp tiltjlp is offline
PN co-founder
 

Join Date: Jun 2003
Location: Cheviot Ohio
Posts: 3,727
Credits: 215,802.09
Thanks: 45
Thanked 143 Times in 101 Posts
Rep Power: 54
tiltjlp has a spectacular aura abouttiltjlp has a spectacular aura about
Default

Edit taken care of. For now on just let me know what you want for a description.
__________________
John

Reply With Quote
The Following User Says Thank You to tiltjlp For This Useful Post:
druadic (12-18-2010)
  #11  
Old 12-18-2010, 04:30 AM
Wizards_Hat's Avatar
Wizards_Hat Wizards_Hat is offline
Pinball Nudger
 

Join Date: Nov 2008
Location: Manchester, UK
Posts: 58
Credits: 34,782.91
Thanks: 1
Thanked 17 Times in 14 Posts
Rep Power: 11
Wizards_Hat is on a distinguished road
Default

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/UpDown...t-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/UpDown...-lid-1527.html
or multiple high scores (4 name table): http://www.pinballnirvana.com/UpDown...-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.
Reply With Quote
  #12  
Old 12-18-2010, 05:14 AM
Liteuser.'s Avatar
Liteuser. Liteuser. is offline
Pinball Wizard
 

Join Date: May 2005
Posts: 165
Credits: 26,467.80
Thanks: 63
Thanked 17 Times in 15 Posts
Rep Power: 15
Liteuser. is on a distinguished road
Default

Quote:
Originally Posted by faralos View Post
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.
Reply With Quote
  #13  
Old 12-18-2010, 05:42 AM
druadic's Avatar
druadic druadic is offline
Pinball Wizard
 

Join Date: Jun 2003
Posts: 789
Credits: 94,199.24
Thanks: 125
Thanked 42 Times in 34 Posts
Rep Power: 23
druadic will become famous soon enough
Default

Quote:
Originally Posted by Wizards_Hat View Post
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/UpDown...t-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/UpDown...-lid-1527.html
or multiple high scores (4 name table): http://www.pinballnirvana.com/UpDown...-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.
__________________
RETIRED from VP
Reply With Quote
  #14  
Old 12-18-2010, 08:58 AM
faralos's Avatar
faralos faralos is offline
Faralos
 

Join Date: Nov 2008
Location: Eastern Pa.
Posts: 1,816
Credits: 124,907.30
Thanks: 5
Thanked 194 Times in 171 Posts
Rep Power: 31
faralos has a spectacular aura aboutfaralos has a spectacular aura aboutfaralos has a spectacular aura about
Default

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...
Reply With Quote
  #15  
Old 12-18-2010, 12:40 PM
tiltjlp's Avatar
tiltjlp tiltjlp is offline
PN co-founder
 

Join Date: Jun 2003
Location: Cheviot Ohio
Posts: 3,727
Credits: 215,802.09
Thanks: 45
Thanked 143 Times in 101 Posts
Rep Power: 54
tiltjlp has a spectacular aura abouttiltjlp has a spectacular aura about
Default

Quote:
Originally Posted by faralos View Post
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.
__________________
John


Last edited by tiltjlp; 12-19-2010 at 03:56 AM.
Reply With Quote
  #16  
Old 12-18-2010, 08:23 PM
druadic's Avatar
druadic druadic is offline
Pinball Wizard
 

Join Date: Jun 2003
Posts: 789
Credits: 94,199.24
Thanks: 125
Thanked 42 Times in 34 Posts
Rep Power: 23
druadic will become famous soon enough
Default

Quote:
Originally Posted by tiltjlp View Post
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
__________________
RETIRED from VP
Reply With Quote
  #17  
Old 12-18-2010, 08:32 PM
faralos's Avatar
faralos faralos is offline
Faralos
 

Join Date: Nov 2008
Location: Eastern Pa.
Posts: 1,816
Credits: 124,907.30
Thanks: 5
Thanked 194 Times in 171 Posts
Rep Power: 31
faralos has a spectacular aura aboutfaralos has a spectacular aura aboutfaralos has a spectacular aura about
Default

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...)
Reply With Quote
  #18  
Old 12-18-2010, 08:36 PM
druadic's Avatar
druadic druadic is offline
Pinball Wizard
 

Join Date: Jun 2003
Posts: 789
Credits: 94,199.24
Thanks: 125
Thanked 42 Times in 34 Posts
Rep Power: 23
druadic will become famous soon enough
Default

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
__________________
RETIRED from VP
Reply With Quote
  #19  
Old 12-19-2010, 04:02 AM
tiltjlp's Avatar
tiltjlp tiltjlp is offline
PN co-founder
 

Join Date: Jun 2003
Location: Cheviot Ohio
Posts: 3,727
Credits: 215,802.09
Thanks: 45
Thanked 143 Times in 101 Posts
Rep Power: 54
tiltjlp has a spectacular aura abouttiltjlp has a spectacular aura about
Default

Quote:
Originally Posted by druadic View Post
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.
__________________
John

Reply With Quote
  #20  
Old 12-19-2010, 06:53 AM
Wizards_Hat's Avatar
Wizards_Hat Wizards_Hat is offline
Pinball Nudger
 

Join Date: Nov 2008
Location: Manchester, UK
Posts: 58
Credits: 34,782.91
Thanks: 1
Thanked 17 Times in 14 Posts
Rep Power: 11
Wizards_Hat is on a distinguished road
Default

Quote:
Originally Posted by druadic View Post
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.

Quote:
Originally Posted by druadic View Post
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.
Reply With Quote
  #21  
Old 12-19-2010, 01:25 PM
druadic's Avatar
druadic druadic is offline
Pinball Wizard
 

Join Date: Jun 2003
Posts: 789
Credits: 94,199.24
Thanks: 125
Thanked 42 Times in 34 Posts
Rep Power: 23
druadic will become famous soon enough
Default

Quote:
Originally Posted by Wizards_Hat View Post
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
__________________
RETIRED from VP
Reply With Quote
  #22  
Old 12-28-2010, 10:21 AM
destruk destruk is offline
Pinball Wizard
 

Join Date: Nov 2004
Posts: 534
Credits: 21,409.62
Thanks: 1
Thanked 66 Times in 23 Posts
Rep Power: 20
destruk will become famous soon enough
Default

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.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Front page article input tiltjlp tiltjlp spouts off! 4 12-02-2004 02:52 AM


All times are GMT -4. The time now is 11:58 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Template-Modifications by TMS
Credits System provided by vBCredits II Deluxe (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Shoutbox provided by vBShout v6.2.15 (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.