- View New Content
-
Getting Started
-
Tutorials
Tutorial Categories
Tutorials Main Page Installation and Setup Downloadable TutorialsROM Adjustments
Number of Balls Adjustments Volume Adjustments
-
Visual Pinball Tables
VP 8 Desktop Tables
All VPM Recreations VP Recreations VP/VPM MODs VP Originals ROMsVP 9 Desktop Tables
All VPM Recreations VP Recreations VP/VPM MODs VP Originals ROMsVP9 Cabinet Tables
All Full Screen Cabinet Full Screen B2S Cabinet Spanned Cabinet Tables Media Packs ROMsVPX Tables
All VPinMAME Recreations VPX- - /VPinMAME - MOD Tables VPX Recreations VPX Originals Media Packs ROMs VR
-
Frontend Media & Backglass
Media Packs
Complete Media Packs Wheel Logos VideosBackglasses
dB2S Animated Backglasses UVP Animated Backglasses Topper Images
- Future Pinball Tables
-
Design Resources
Main Resources
Table Templates Playfield Images Image Library Sound Library Key CodesVP Guides
VP8 Guide - English VP8 Guide - Deutsch VP9 Guide - English VP9.1.x Guide - English VP Object Guide VPM DocumentationFuture Pinball Resources
Playfield Images 3D Model LibraryFuture Pinball Guides
FP Script Guide Big Draco Script Guide FP Table Design Guide FP DMD Guide
- Other Features
- Bug Tracker
- Image Gallery
- Blogs
-
More
1/2 COIN FIRST TIME
Started By
sasa12345
, Apr 16 2015 11:18 PM
7 replies to this topic
#5
Posted 06 May 2015 - 06:36 PM
Well, I think most of the programming is already there for what you want and that you'd just need to change a couple of values.
The first thing to do would be to create a line near the top of your programming: Dim Coins
You'd need something like that for later. Put it in among all the other Dims at the beginning of your code. Since this is one you'd be adding, I think the best place for it would be at the bottom of that list.
Next, there's a line that goes Sub FuturePinball_KeyPressed(ByVal KeyCode). That would be the Subroutine I'd look into now. There's a line in that Subroutine that goes If (KeyCode = GetKeyCode(InsertCoinKey)) Then. You'll notice the first line beneath that is PlaySound = "CoinIn", followed by nvCredits = nvCredits + 1. This is where you'll want to make some changes. I think I would do something like this:
If (KeyCode = GetKeyCode(InsertCoinKey)) Then
PlaySound "CoinIn"
Coins = Coins + 1
If (Coins => 2) Then
nvCredits = nvCredits + 1
If (fpTilted = FALSE) Then
LeftSlingshotBulb1.FlashForMs 200, 100, BulbOff
LeftSlingshotBulb2.FlashForMs 200, 100, BulbOff
RightSlingshotBulb1.FlashForMs 200, 100, BulbOff
RightSlingshotBulb2.FlashForMs 200, 100, BulbOff
End If
End If
End If
Give it a shot.
#7
Posted 06 May 2015 - 10:36 PM
Okay, so I just took the example I made here and posted it to my Space Invaders table for Future Pinball. Works fine there.
That said... I'm not sure what Line 192 is on your code. Knowing this could help, though given your lack of clarity regarding the Dim Coins, this may be part of the issue.
Okay, I'll try breaking it down. "Coins" is a variable. In this case we need it to be a numeric variable, ie 1, 2, 3, 4, etc... No problem. The program needs to know that "Coins" is a numeric value to work with, so you are declaring it near the beginning of your code along with all the other variables up there, such as "Dim bFreePlay", "Dim BallsOnPlayfield" and so on.
If you did not add a line in that list that says "Dim Coins", then the program does not know what "Coins" is and just gives you an error as it fails to understand what "Coins" even are. By adding "Dim Coins", the program understands that it is something important, something that has value to it somehow.
The line, "Coins = Coins + 1" tells it that whenever the button is pressed (5 by default) it means that Coins is a numeric value that goes up by 1 every time that button is pressed.
The next lines, "If (Coins => 2) Then ... nvCredits = nvCredits + 1 ... " means that whenever you have 2 or more "Coins" then it equals 1 Credit, which gets added to the number of credits that Future Pinball will remember.
It's not a perfect code. Granted, even I think it could use a little polish, but this is probably the simplest way to code that kind of thing. Just remember to add an extra "End If" for that extra IF line you added, otherwise it might confuse the program as it would be expecting an "End If" at the end of the subroutine, perhaps jumble a few things in the process.
That help any?
#8
Posted 08 May 2015 - 01:01 PM
very well explained al somewhere is making a mistake
I thought it would be easier
If (MoneyIn = 0) and (nvCredits = 0) Then 'When the game first starts, you must insert 2 coins for the first credit
MoneyIn = MoneyIn + 1
I thought there would simply be a change
Thank you for your answer



Top









are all trademarks of VPFORUMS.