Register
Email: Password:
Forum » Pinball mod (W.I.P)

Pinball mod (W.I.P)

TheSlider 3 years ago
Hi,

I'm trying my hands on a new and more elaborate mod. I'm having some trouble setting up the controls and the point counter (pictures below).

Right now, this is what i have working :
- The ball (in pink) "falls" downwards like if influenced by gravity and bounces nicely around the level.
- When the ball touches the large black circle below the flippers, it's teleported in the spring launcher.
- Using the spring launcher throws the ball inside the pinball as expected.
- Kickers will push (explode) the ball away. I had to indent them so that the ball isn't pushed in random directions.

What needs some work :
- Flippers are animated with a rotation but the animation doesn't take into account the physics so it has no effect on the ball (like if they don't move), they also animate when used by the player. I don't really know how make it work, maybe by using joints but i'll need some help figuring this out.
- The Bumper (right below the ball in the first picture) is supposed to increase the score (money) count by 50 when hit but it doesn't show up in the inventory so i guess i messed up the script.
- The white rectangle has a script showing up the score (amount of money) you have but i either mistyped the money variable or it doesn't exist in this fashion. I think I'll create a new one just for this.

What do you think about it ?

I was thinking of making some other minigames like a billiard table or pong.

Editor :

In game :




Edited 3 years ago
#
Amarth 3 years ago
Whoah. Awesome!
#
TheSlider 3 years ago
Thanks. : )

I managed to make the scoring work, i'm not sure why i cant send variables to the showMessage function, i used tutorialMessage instead.

Now i only need to make the flippers work properly. They do animate but the physics box doesn't rotate with the animation so it's impossible to move the ball with them in this state.
I was thinking about setting some joints but i don't know how they work exactly. I'll have to check some Driftmoon puzzles to see.

I'd gladly accept any help with this matter !

How it looks like right now :
note : The smoke in the middle is the "player", maybe too much smoke right now.




Edited 3 years ago
#
ChuckV 3 years ago
That's a really great idea you've got there,

About the flippers: You will never get them to work using an animation, because those simply don't affect the physics of the object.

You could use the "setangle" function to alter the position of your flippers but I think this "teleports" the object to the desired angle so it might not hit an oncoming ball.

The way I handled rotating things with the physics in my mod was to have an object with no graphics (We'll call this the "reference" point) that overlaps the thing I want to rotate (We'll call this the "thing"). Then I link the "reference" to the "thing" with a rotate joint and have a script (setangle) that changes the angle of the "reference". I give the "reference" an infinite density (0) so that the "thing", which is lighter, is forced to rotate to have its own angle match that of the "reference".
#
TheSlider 3 years ago
Wow, thanks ChuckV, that's Brilliant !
I'll try it tomorrow !
#
ChuckV 3 years ago
Good luck,

Note that you can create joints in the physics tab of objects or through the "createrotatejoint" script. Let us know how it goes!

Edited 3 years ago
#
TheSlider 3 years ago
It kinda works but i can't manage to add enough punch into the movement of the flippers so that the ball goes back up. Instead the ball seems to sticks to them. X )

I'm not sure where i'm wrong. I also think the physics tab needs some more input fields for angle values (need of precision ! ) but it's not a real problem here.

The joint on the left flipper with a limit on how much it can rotate :

Initialization of hinges (reference) on map startup :

Event when i click the button n°2.



Can someone take a look and maybe help me figure out what can be done to make this work ? : )
I can send the map file if needed or upload it as a mod although it's still non functional yet.


Right now, i have a simple scoring system that works by removing health from the player when he loses the ball and adds some more each time he earns 500 points.



Edited 3 years ago
#
ville 3 years ago
Have you had a look at how the doors are done in Sarah's house at the Docks map? They're sort of more realistic than other doors in the game in that they open and close using the physics engine. The hinge joint in the door actually doesn't close it, there's a distance joint doing the actual work there. Something like that could work here, and you could tune the angles better as well, even tune the power.

The ball getting stuck to the flipper sounds very strange, but could simply be the result of the changeangle script making the flipper jump over the ball object. Using the distance joint to turn the flipper should help there.

This mod sounds great by the way!

Edited 3 years ago
#
ChuckV 3 years ago
If you want to try with the rotate joints a bit more, I suggest you increase the density of your paddle and importantly the resume force of the rotate joint (You have it set to 0), to give the movement of your paddle more inertia and more "punch".

But I guess you should probably try Ville's suggestion, he should know right? Keep in mind that the density of the paddle and the resume force of the joint are what determine your paddle's "strength".
#
TheSlider 3 years ago
Hi,

Thanks for the suggestions !

I tried changing the density and resume force but i can't seem to find the perfect match. I think I would need some sort of physics debug information showing up in the editor to get a grasp of what does what and why.
I still don't get what's wrong as it somehow worked on another map with simpler objects... X )

Anyway, I exported/imported Viles doors from the docks and tried editing them to understand how they worked. I find them quite interesting and I managed to make the flippers work as expected by trial and error.
Here too the lack of visual representation of the forces involved didn't help me fully understand how things interact with each other.

@Vile, if you have some time, do you think you could add a colored line that illustrates the force between the door object and the "open" and "close" distance joints ?
Also, the angle limit functionality needs an input field. : )
#
ville 3 years ago
You've found the physics debug drawing cheat right? First shift+F1, then something else that I can't recall right now. It's a bummer that it doesn't show the actual forces involved graphically - I'll have to think about that in a future version (yes, I'm working on a big engine update actually).

By the way, the rotate joint resume force is internally done by adding a distance joint to it that stretches.
#
TheSlider 3 years ago
Wow, thanks for the info and debug menu. I didn't know about it and now that i saw it, i feel quite dumb for reading the "cheat" section in the wiki and thinking it was only basic cheats without even reading the table entirely. X )
The debug tool does have some useful information in here but not really what i was expecting as you may have guessed.

On a side note, i'm quite interested by what you just said (engine update). Care to share some new features ? Maybe a blog post ?

[EDIT]
I took some time to add stuff to the wiki. Everything i learned while making this mod is inside. (sounds, skills, talents...). I'll probably add more later.


Edited 3 years ago
#
TheSlider 3 years ago
I'll be taking a quite long holiday so i've uploaded the mod as it is right now. I tried doing a nice level selector for later use and also in case someone is interested in making his own table for inclusion (it's also fine with me if people prefer to do their own pinball mod).

Anyway, i hope you'll enjoy and post suggestions on how to improve it further.

Have fun !

Ps : By the way, is it possible to remove the startup difficulty selector and point distribution on a new game ?

Edited 3 years ago
#
ville 3 years ago
Thanks TheSlider! This one is definitely very inventive. I kept losing a lot because the ball went from the sides, but it does that to me in real flipper as well. Hey, maybe a fourth key could be to push the ball up just a bit? You could even use the camera shake effect with it.
#
TheSlider 3 years ago
Good idea ! Adding it right now with some tweaks.
#
Forum » Pinball mod (W.I.P)

Post Reply


Your email:
Your name: