OK guys here on start of this conversation i will put latest news about my updated core.vbs and instructions how to use it and link to latest version, something like i did with FPLaunch.
For now latest version of core.vbs with nudge and tilt sounds is 3.33. You can download it here (link changed from megaupload to mediafire):
http://www.mediafire...nuz7ydt0rbp2lrl
Be sure to put mp3 sounds in vpinmame music dir.
Rob's tuned version: http://www.vpforums....a...st&id=11567
Important features of new core.vbs are:
- filter time - period after nudge during which no new nudges are accepted from any direction
- return force - recoil force is a percent of original nudge force and acts in opposite angle
- nudge interval - period during which nudges are counted and if there is too many nudges table is tilted, after every nudge interval nudge count is reduced a little so that you can nudge again
- front nudge direction is changed so that ball goes down instead of up (it will go up only if it bounces of something) - which is much more real than unconditional up movement
- nudge sound - whenever you nudge you'll hear solenoid sound so that you know vp accepted your nudge
- tilt sound - whenever tilt occurs you will hear tilt sound, even if table doesn't support it, on some table tilt sound will even come before tilt as a warning
- you can have shake effect on all tables - just uncomment startshake command - beware - startshake causes problems on some configurations
More info on latest version for now can be found here (it will also be transferred to this post):
http://www.vpforums....s...st&p=100739
Few ideas for next versions are:
- to implement preferred angles and preferred strength, so whenever someone calls nudge from some angle i conclude - aha - table author wants left nudge, i want all left nudges to be from an angle of 270, and strength of 1.3, and then i call nudge 270 1.3 regardless of his angle and strength. This way you can tune all tables at once. Of course you can leave preferred angle and strength empty and it will not be used. Everything will work like before. My core.vbs was always old users friendly - meaning if you don't want to change anything you just leave all settings on default.
- post your comments on the end of discussion
__________________________
Here is the original first post so that you can follow discussion from the beginning:
In this post http://www.hyperspin...mp;postcount=25 on hyperspin i have a new version of core.vbs (3.33?).
Actually it is 3.32-1 from this site, updated with nudge filtering from melon and jpsalas i think and some other additions from me.
Additions include:
- increased filter time (tiempofiltro) from 100 to 500 milisec. and nudge interval (time after which table forgets previous nudges) from 70 to 500 msec. These values are experimental and we can set them to whatever is best for all. (default in 3.32-1 was no filtering and 1 sec nudge interval)
- totally disabled nudging during tiempofiltro time (changed mcount2 = 0 to mcount2 = 1 in DoNudge procedure) cause some cab users reported that they get many nudges every time with this script
- changed front nudge so that ball goes down instead of up. It will however go up if it bounces of something.
- added COUNTER EFFECT on all nudges - when you nudge from left nudge is applied from left and then after few miliseconds from the opposite direction with 70% of force - so the ball goes left and then returns a little.
- added STARTSHAKE to initialization - so now all tables will have shake effect even if author did not put startshake in the table. If you want to remove it just comment our startshake line
You can get core.vbs from the link above (it is in the code box), and try it and tell me what you think.
Maybe someone with permissions can attach it here.
All parameters and times in there are optional - we can change them if you don't like current settings.
For this code to work table has to be vpm table and has to use DoNudge OR it can leave nudging by default (no event on nudge keys) - then DoNudge will be invoked by default.
I have another idea - to put somewhere sound named nudge and tilt and to play them on every nudge or tilt, but to leave possibility to users to put some other sounds and to table authors to put sound with same name in table file so that it is executed instead.
Here is only nudge class code which is the only part of code that is changed:
Private mCount, mCount2, mReturnCount, mReturnDir, mReturnForce, mSensitivity, mNudgeTimer, mSlingBump, mForce
Public TiltSwitch
Public TiempoFiltro
Private Sub Class_Initialize
mCount2 = 0 : TiempoFiltro = 500 : mReturnCount = 0 : mReturnDir = 0 : mReturnForce = 0
mCount = 0 : TiltSwitch = 0 : mSensitivity = 5 : vpmTimer.AddResetObj Me
StartShake
End sub
Private Property Let NeedUpdate(aEnabled) : vpmTimer.EnableUpdate Me, False, aEnabled : End Property
Public Property Let TiltObj(aSlingBump)
Dim ii
ReDim mForce(vpmSetArray(mSlingBump, aSlingBump))
For ii = 0 To UBound(mForce)
If TypeName(mSlingBump(ii)) = "Bumper" Then mForce(ii) = mSlingBump(ii).Force
If TypeName(mSlingBump(ii)) = "Wall" Then mForce(ii) = mSlingBump(ii).SlingshotStrength
Next
End Property
Public Property Let Sensitivity(aSens) : mSensitivity = (10-aSens)+1 : End property
Public Sub DoNudge(ByVal aDir, ByVal aForce)
if mCount2 > 0 and mCount2 < TiempoFiltro\conTimerPulse then exit sub
mcount2 = 1
mReturnCount = 1
if aDir < 20 or aDir > 340 Then aDir = aDir + 180
aDir = aDir + (Rnd-0.5)*15*aForce : aForce = (0.6+Rnd*0.8)*aForce
Nudge aDir, aForce
mReturnDir = aDir + 180
mReturnForce = aForce * 0.7
If TiltSwitch = 0 Then Exit Sub ' If no switch why care
mCount = mCount + aForce * 1.2
If mCount > mSensitivity + 10 Then mCount = mSensitivity + 10
If mCount >= mSensitivity Then vpmTimer.PulseSw TiltSwitch
NeedUpdate = True
End sub
Public Sub Update
mCount2 = mCount2 + 1
if mReturnCount > 0 Then mReturnCount = mReturnCount + 1
if mReturnCount > 5 Then mReturnCount = 0 : Nudge mReturnDir, mReturnForce
If mCount > 0 Then
mNudgeTimer = mNudgeTimer + 1
If mNudgeTimer > 500\conTimerPulse Then
If mCount > mSensitivity+1 Then mCount = mCount - 1 : vpmTimer.PulseSw TiltSwitch
mCount = mCount - 1 : mNudgeTimer = 0
End If
Else
mCount = 0 : mCount2=0 : NeedUpdate = False
End If
End Sub
Public Sub Reset : mCount = 0 : End Sub
Public Sub SolGameOn(aEnabled)
Dim obj, ii
If aEnabled Then
ii = 0
For Each obj In mSlingBump
If TypeName(obj) = "Bumper" Then obj.Force = mForce(ii)
If TypeName(obj) = "Wall" Then obj.SlingshotStrength = mForce(ii)
ii = ii + 1
Next
Else
For Each obj In mSlingBump
If TypeName(obj) = "Bumper" Then obj.Force = 0
If TypeName(obj) = "Wall" Then obj.SlingshotStrength = 0
Next
End If
End Sub
End Class
Edited by blur, 05 July 2012 - 02:21 PM.




Top


Contributor
























are all trademarks of VPFORUMS.