Jump to content
Download Section Back Up, Navigate the Right Hand Menu to find files, ignore the 0s

Nudging options


northvibe

Recommended Posts

great job!

i downloaded the exe and will test it

so this is optimized compile, and should perform same as official version, right?

it has all buttons disabled and only xy axes are enabled for nudge and z for plunger

that's a great idea, cause actually no body needs that hardcoded mappings and you can do all through xpadder

great!!!

Yup, I believe it is an optimized compile, used the fast+sse config when building it (honestly, have never really compiled anything before this :) ). I didn't touch anything other than your initial change, and the handling for sending hard coded events if coming from a PBW controller. My changes below... (just commented out "//" the lines for the buttons I didn't want)

This is all starting originally at line 790 in pininput.cpp (line 794 with Blur's gamepad changes, some 'tabs' removed for better display; also, button 1 on the gamepad is shown as DIJOFS_BUTTON0, so button 16 would be DIJOFS_BUTTON15, etc)

	int updown = (input->dwData & 0x80)?DISPID_GameEvents_KeyDown:DISPID_GameEvents_KeyUp;

//	if(( input->dwOfs == DIJOFS_BUTTON9 ) && (uShockType == USHOCKTYPE_PBWIZARD))	// left - vp function disabled
//	{
//		FireKeyEvent( updown,g_pplayer->m_rgKeys[eLeftFlipperKey] );
//	}
if(( input->dwOfs == DIJOFS_BUTTON8 ) && (uShockType == USHOCKTYPE_ULTRACADE))	// left - else if changed to if because previous button disabled
{
	FireKeyEvent( updown,g_pplayer->m_rgKeys[eLeftFlipperKey] );
}
//	else if(( input->dwOfs == DIJOFS_BUTTON1 ) && (uShockType == USHOCKTYPE_PBWIZARD)) // right - vp function disabled
//	{
//		FireKeyEvent( updown,g_pplayer->m_rgKeys[eRightFlipperKey] );
//	}
else if(( input->dwOfs == DIJOFS_BUTTON10 ) && (uShockType == USHOCKTYPE_ULTRACADE)) // right
{
	FireKeyEvent( updown,g_pplayer->m_rgKeys[eRightFlipperKey] );
}
//	else if(( input->dwOfs == DIJOFS_BUTTON0 )	&& (uShockType == USHOCKTYPE_PBWIZARD)) // plunge - vp function disabled
//	{
//		FireKeyEvent( updown,g_pplayer->m_rgKeys[ePlungerKey] );
//	}
else if(( input->dwOfs == DIJOFS_BUTTON13 )	&& (uShockType == USHOCKTYPE_ULTRACADE)) // plunge
{
	FireKeyEvent( updown,g_pplayer->m_rgKeys[ePlungerKey] );
}
//	else if(( input->dwOfs == DIJOFS_BUTTON4 )	&& (uShockType == USHOCKTYPE_PBWIZARD)) // volume up - vp function disabled
//	{
//		FireKeyEvent( updown,g_pplayer->m_rgKeys[eVolumeUp] );
//	}
else if(( input->dwOfs == DIJOFS_BUTTON5 )	&& (uShockType == USHOCKTYPE_ULTRACADE)) // volume up
{
	FireKeyEvent( updown,g_pplayer->m_rgKeys[eVolumeUp] );
}
//	else if(( input->dwOfs == DIJOFS_BUTTON3 )	&& (uShockType == USHOCKTYPE_PBWIZARD)) // volume down - vp function disabled
//	{
//		FireKeyEvent( updown,g_pplayer->m_rgKeys[eVolumeDown] );
//	}
else if(( input->dwOfs == DIJOFS_BUTTON6 )	&& (uShockType == USHOCKTYPE_ULTRACADE)) // volume down
{
	FireKeyEvent( updown,g_pplayer->m_rgKeys[eVolumeDown] );
}
//	else if(( input->dwOfs == DIJOFS_BUTTON11 )	&& (uShockType == USHOCKTYPE_PBWIZARD)) // coin 1 - vp function disabled
//	{
//		FireKeyEvent( updown,g_pplayer->m_rgKeys[eAddCreditKey] );
//	}
else if(( input->dwOfs == DIJOFS_BUTTON0 )	&& (uShockType == USHOCKTYPE_ULTRACADE)) // coin 1
{
	FireKeyEvent( updown,g_pplayer->m_rgKeys[eAddCreditKey] );
}
//	else if(( input->dwOfs == DIJOFS_BUTTON12 )	&& (uShockType == USHOCKTYPE_PBWIZARD)) // coin 2 - vp function disabled
//	{
//		FireKeyEvent( updown,g_pplayer->m_rgKeys[eAddCreditKey2] );
//	}
else if(( input->dwOfs == DIJOFS_BUTTON1 )	&& (uShockType == USHOCKTYPE_ULTRACADE)) // coin 2
{
	FireKeyEvent( updown,g_pplayer->m_rgKeys[eAddCreditKey2] );
}
//	else if(( input->dwOfs == DIJOFS_BUTTON8 )	&& (uShockType == USHOCKTYPE_PBWIZARD)) // start - vp function disabled
//	{
//		// Check if we can allow the start (table is done initializing).
//			if( ((msec() - firedautostart) > ((U32)(ptable->m_tblAutoStart*1000.0f))) ||
//			(pressed_start) || started() ) 
//		{
//			pressed_start = 1;
//			FireKeyEvent( updown,g_pplayer->m_rgKeys[eStartGameKey] );
//
//		// Check if this was a press.
//			if ( updown == DISPID_GameEvents_KeyDown )
//			{
//				// Update the number of plays.
//				VPinball::NumPlays++;
//				SetRegValue( "Statistics", "NumPlays", REG_DWORD, &(VPinball::NumPlays), 4 );
//			}
//		}
//	}
else if(( input->dwOfs == DIJOFS_BUTTON12 )	&& (uShockType == USHOCKTYPE_ULTRACADE)) // start
{
	// Check if we can allow the start (table is done initializing).
		if( ((msec() - firedautostart) > ((U32)(ptable->m_tblAutoStart*1000.0f))) ||
		(pressed_start) || started() ) 
	{
                       pressed_start = 1;
                       FireKeyEvent( updown,g_pplayer->m_rgKeys[eStartGameKey] );

		// Check if this was a press.
		if ( updown == DISPID_GameEvents_KeyDown )
		{
			// Update the number of plays.
			VPinball::NumPlays++;
			SetRegValue( "Statistics", "NumPlays", REG_DWORD, &(VPinball::NumPlays), 4 );
		}
	}
}
//	else if(( input->dwOfs == DIJOFS_BUTTON7 )	&& (uShockType == USHOCKTYPE_PBWIZARD)) // exit - vp function disabled
//	{
//		// Check if we have started a game yet.
//		if ( (started()) ||
//			 (ptable->m_tblAutoStartEnabled == false) )
//		{
//			if( DISPID_GameEvents_KeyDown == updown ) 
//			{
//				first_stamp = msec();
//				exit_stamp = msec();
//				FireKeyEvent( DISPID_GameEvents_KeyDown,g_pplayer->m_rgKeys[eExitGame ] );  
//			}
//			else 
//			{
//				FireKeyEvent( DISPID_GameEvents_KeyUp,g_pplayer->m_rgKeys[eExitGame ] );  
//				exit_stamp = 0;
//			}
//		}
//	}
else if(( input->dwOfs == DIJOFS_BUTTON14 )	&& (uShockType == USHOCKTYPE_ULTRACADE)) // exit
{
	// Check if we have started a game yet.
	if ( (started()) ||
		 (ptable->m_tblAutoStartEnabled == false) )
	{
		if( DISPID_GameEvents_KeyDown == updown ) 
		{
			first_stamp = msec();
			exit_stamp = msec();
			FireKeyEvent( DISPID_GameEvents_KeyDown,g_pplayer->m_rgKeys[eExitGame ] );  
		}
		else 
		{
			FireKeyEvent( DISPID_GameEvents_KeyUp,g_pplayer->m_rgKeys[eExitGame ] );  
			exit_stamp = 0;
		}
	}
}
//	else if(( input->dwOfs == DIJOFS_BUTTON6 )	&& (uShockType == USHOCKTYPE_PBWIZARD)) // pause menu - vp function disabled
//	{
//		if( DISPID_GameEvents_KeyDown == updown ) 
//		{
//			g_pplayer->m_fCloseDown = fTrue;
//		}
//	}

//	else if( input->dwOfs == DIJOFS_BUTTON5 )	// BKGL
//	{
//	}
//	else if( input->dwOfs == DIJOFS_BUTTON10 )			// left 2 - vp function disabled
//	{
//		FireKeyEvent( updown,g_pplayer->m_rgKeys[eLeftMagnaSave ] );
//	}
//	else if( input->dwOfs == DIJOFS_BUTTON2 )			// right2 - vp function disabled
//	{					
//		FireKeyEvent( updown,g_pplayer->m_rgKeys[eRightMagnaSave ] );
//	}
else if(( input->dwOfs == DIJOFS_BUTTON6 )	&& (uShockType == USHOCKTYPE_ULTRACADE))	// Manual Joystick control
{
	if(updown&1 && g_pplayer != NULL) 
	{					
	if(g_pplayer->m_NudgeManual >= 0) g_pplayer->m_NudgeManual = -1; //standard mode
	else g_pplayer->m_NudgeManual = joyk;			//only one joystick has manual control

	rotLeftManual = g_pplayer->m_NudgeManual >= 0;	// for normal UltraCade Table
	}
}

Again, not a whole lot of experience doing this kind of stuff, and while the one I am using works just fine for me with no perceived side effects, I am just still just guessing at this and assume everything else will be fine.

Link to comment
Share on other sites

  • Replies 261
  • Created
  • Last Reply

It may be labeled as 9.0.7, but if you dig into it a little, in the trunk\changelog.txt, it list changes for 9.1.1, and in the trunk\vbatest_eng.rc, it lists the most recent version as 9.1.2 (as that file controls what will show up in the properties when the exe is compiled, I changed mine so it reads as 9.1.2a). Because of this, I am fairly confident in assuming this has all the 9.1.2 updates and it is simply mislabeled.

Link to comment
Share on other sites

Why not move the project to github? It allows for easier community development. Patches can be added and then pull requests can be created. Pull requests allow the owners of the project to control what makes it into the source. Seems like a better option than all the different unofficial builds. Also you could create a branch thus eliminating the confusion as to what version of the source people have. Source forge is archaic to say the least. I honestly have never liked them for hosting my projects.

Sent from my Galaxy Nexus using Tapatalk

Link to comment
Share on other sites

Thanks to the post by Blur about adding support for any gamepad, I was inspired to make some other changes of my own.

I don't know if anyone would be interested, but in my quest to get my Mot-Ion and Plunger kit working the way I wanted in my newly built cab, I ended up compiling a version of VPinball with most of the hard coded keys disabled (mainly to get rid of the exit, pause, and volume keys, but got rid of all but flipper and launch buttons). Currently I am just using xpadder to remap all the buttons I freed up. For those of you altering VPinball to use any gamepad as a PBW, you can comment out all the hard coded buttons and use/remap every button on your controller with no restrictions.

If there is any interest, I can post my modified pininput.cpp and/or list the changes I made if anyone else wants. Or if desired, I can just compile a version with the gamepad changes and all hard coded PBW buttons removed and put up a link.

(EDIT: Decided to just post a link to the compiled exe as I am probably gonna be away from computer for the next day or 3... this includes changes from Blur's post, all PBW hard coded buttons removed, compiled with 'Release MinDependency Fast+SSE' configuration, and is 1.36MB - Download - Any issues, let me know, I am currently using my original modified exe with no issues, and just removed the rest of the hard coded buttons/added Blur's changes, so I wouldn't expect any issues from this, but you never know...)

Anyway, just putting this out there as I had a hell of a time utilizing all 16 inputs on my Mot-Ion adapter (4 flipper buttons, launch, start, extra ball, reliable pause/exit through fplaunch, coin door open/close and the 4 service buttons, 2 coin buttons, and a key for instructions in-game) and couldn't find any other solutions.

Can you make a guide for grabbing the correct source version and compiling it optimized? I know nothing about .net and have never really cared for sourceforge.

Link to comment
Share on other sites

Tested this new compiled version for few hours.

Looks like it is working ok - it is not slow like unoptimized builds.

Will have to compare fps with mainstream version to be sure.

Didn't tried nudging yet - will have to put some weight on gamepad and turn it upside down.

Link to comment
Share on other sites

Tested this new compiled version for few hours.

Looks like it is working ok - it is not slow like unoptimized builds.

Will have to compare fps with mainstream version to be sure.

Didn't tried nudging yet - will have to put some weight on gamepad and turn it upside down.

i am still unable to use the z-axis for plunger operation. does this build allow generic gamepads to be interpreted as the pbw?

Link to comment
Share on other sites

yes, all gamepads should be regarded as PBW, but i didn't test that part yet

i tested speed first, cause that was the problem in my release, nudging and plunger worked already so they should work now also

Link to comment
Share on other sites

yes, all gamepads should be regarded as PBW, but i didn't test that part yet

i tested speed first, cause that was the problem in my release, nudging and plunger worked already so they should work now also

ugh any way that i can debug the plunger that you know of? short of grabbing the source and adding debug lines in i am at a loss now...

Link to comment
Share on other sites

Where can I find this version Blurry?

So now I can use the weel for plunger action in tables? :D

Would be awesome if that's the case!

You cant use the wheel... Wish you could. Would be really nice to have all of those features with just a sidewinder. I suppose two controllers could work too but that would cause issues like what was brought up before.

the version we are talking about is right here.

http://hyperspin-fe.com/forum/showpost.php?p=170467&postcount=149

Link to comment
Share on other sites

just tested plunger on my ps2 style gamepad with this exe

it works great but - on table you have to find plunger object and click enable mechanical plunger. if there is no plunger object you can't do that. So you have to add plunger object and change the code for plunger.

tables that have plain ugly vp plunger (default table) work out of the box (just click enable) but lot's of tables that have some fancy plunger animations have to be updated with one of the scripts from noah's post on nanotech plungers.

another thing that could be the problem is - vp checks if gamepad is PBW, then if gamepad is ultracadem then if gamepad is sidewinder freestyle pro, and then maybe some other joysticks if somebody added them, and in the end if your gamepad is none of them I set it to work as PBW.

This means only gamepads that are not on the list will be recognized as PBW, all gamepads from the list like sidewinder pro will be recognized as them self and they are used like programmer who implemented that gamepad wanted them to be used.

For example rascal as i remember made side winder support only nudge not plunger (cause it doesn't have stick) and so on.

How can you debug it - with visual studio

How will you compile it - every thing is described in idiot proofed steps (proved by me :)) in posts before

Link to comment
Share on other sites

How can you debug it - with visual studio

How will you compile it - every thing is described in idiot proofed steps (proved by me :)) in posts before

I will have to read through the thread then so that I can debug it. I am using a generic gamepad for the xbox 360. It shows up in xpadder. I have remapped the right stick to be zaxis in its software (xbcd) but it still doesnt work. Guess I will have to mess with the source then...

Link to comment
Share on other sites

Since my w.i.p. cab isn't located at my residence (no space to build it in my apartment), I have set up my home pc as a kinda test setup for trying to get all the tables I have downloaded working with an analog plunger. The only gamepad I have available is a PS3 controller, and when using the modified exe with no hard buttons mapped, and using the motionjoy software, everything works just fine, nudge (tried both accelerometer and stuck nudging), buttons, and even utilizing the z axis for the plunger (can use one of the sticks or one of the pressure sensitive buttons, depending on how you set it up in the motion joy software). I guess if I wanted, I could even tear apart the controller and use it instead of a PBW in my cab, as it works that well (possible 17 buttons, accelerometer, 2 sticks for analog input).

EDIT: And Blur, if you want, you should just link the new .exe directly at the bottom of the appropriate post linked in your signature, as it might be easier to find for those that want to use it.

Link to comment
Share on other sites

will have to check when i get home. what table should i be testing with? the racing one or tutorial? i have tried with both in the past to no avail.

default table - the one you get when you create new table - file - new

best table for test

later you can find one that supports plunger (like sinbad) or fix one to support it

post a screenshot of your game controller properties

Link to comment
Share on other sites

default table - the one you get when you create new table - file - new

best table for test

later you can find one that support plunger (like sinbad) or fix one to support it

post a screenshot of your game controller properties

didnt work. here are two screen shots showing z+ and z-

pin1.png

pin2.png

Link to comment
Share on other sites

this looks ok - my ps2 like gamepad looks same - only difference is it has only 12 buttons and x y z and z rotate axis.

plunger reacts on z

maybe try to move some other axis and see what happens?

don't know why would one joystick act different then the other

to debug it you can put breakpoint in pininput.cpp and see if vp sets gamepad type to pbw

oh, i forgot one thing - does nudging work ok?

it is best to test nudging on zero angle table and you have to set enable pbw accelerometer in table physics

Link to comment
Share on other sites

this looks ok - my ps2 like gamepad looks same - only difference is it has only 12 buttons and x y z and z rotate axis.

plunger reacts on z

maybe try to move some other axis and see what happens?

don't know why would one joystick act different then the other

to debug it you can put breakpoint in pininput.cpp and see if vp sets gamepad type to pbw

oh, i forgot one thing - does nudging work ok?

it is best to test nudging on zero angle table and you have to set enable pbw accelerometer in table physics

it works if i pick the sidewinder up and tilt it. if i just bump the table it doesnt work. in xpadder it shows that the direction triggers just doesnt work in vp. i thought that vp could only take one game pad. because of this i was just going to map the nudging to buttons so that i could have a real plunger. is this not the case? I will grab visual studio. What version do I need? Will need to make sure I get the right version of the source and compile it correctly so that it wont be all slow.

Link to comment
Share on other sites

you have several joysticks?

don't know how vp will react in that case, i know when i connected two gamepads both were used for buttons but only first one for nudge and plunger.

remove sidewinder and test only with xbox controller

and stop asking questions about compiling - i told you you have all instructions in first posts - just read it

Link to comment
Share on other sites

I have gotten my gamepad to work with x/y/z working for nudge/plunger, so I know it 'can' work.

What table are you using to test nudge/plunger?

If you can roll the ball around the table with the x/y axis, nudge is working, but you may need to tweak the gain/jolt settings to make it act like a nudge instead of just tilting the table.

Link to comment
Share on other sites

I have gotten my gamepad to work with x/y/z working for nudge/plunger, so I know it 'can' work.

What table are you using to test nudge/plunger?

If you can roll the ball around the table with the x/y axis, nudge is working, but you may need to tweak the gain/jolt settings to make it act like a nudge instead of just tilting the table.

i am more concerned with the z axis for plunger at the moment. i am trying with the default file>new table. it is not working so far. maybe vp isnt picking it up... come to think of it, i had no nudging till i set it up in xpadder. i think maybe my controller isnt being picked up... I have no problem mounting it upside down with a weight for nudging though. Not 100% sold on the sidewider. Now to get to the bottom of this...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...