playMaker

Author Topic: Score System - With Collisions and Combos  (Read 3173 times)

sinan

  • Playmaker Newbie
  • *
  • Posts: 4
Score System - With Collisions and Combos
« on: January 07, 2016, 10:51:17 AM »
Hello, fellow Playmakers.

I've come to you today with a problem, i'm trying to build a Score System which counts when the following things happen:
- Items are thrown and collide with other Objects
- Acumulate Scores of both the thrown item and the hit items
- When certain conditions are met, multiplicate scores (Have found a good thread about, which would be okay but not perfect http://hutonggames.com/playmakerforum/index.php?topic=7872.msg37960#msg37960)
- A sequence of Objects are hit in a specific row, extra bonus points are given (I understand the Logic a bit, if item a collides with b & c, do +100 score but not how to accomplish it)

I have searched through the forums for anything that has to do with "Score" but none of the threads quite fit my problem.

What i want is a bit more complex and the best example of the way it should work that i've found is in Goat Simulator.
There the Goat hits certain things and accumulates scores, it destroys things in order, jumps over stuff, destroys x in a certain timeframe etc.

First of all is such a System possible with Playmaker and second of all, is it possible for a programming noob like me, i have to admit i'm fairly new to PlayMaker aswell, so instructions for absolute beginners would be great  ::)

Thanks in advance for any help and have a good day.
« Last Edit: January 09, 2016, 10:31:01 AM by sinan »

KellyRay

  • Full Member
  • ***
  • Posts: 170
Re: Score System - With Collisions and Combos
« Reply #1 on: January 07, 2016, 12:08:55 PM »
Defiantly possible.

I'd approach this very straight forward. I'd have a game object and name it something like levelScore which stores my INT variable.

This game object would communicate with a text gui object and passes the INT to this object as a string. You can do this with a convert int to string action.

You then use the collision event action a whole lot. Sticking it on every intractable item that would accumulate a score. When a collision happens, I'd add the appropriate value to the score int variable in my levelScore object. Be sure to read up on collision tags and events.

sinan

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Score System - With Collisions and Combos
« Reply #2 on: January 13, 2016, 07:21:29 AM »
Okay, so i have done the "Global Variables, Events and Managers" Tutorial again and knotted that with my UFPS Controller.
Everything works well, except that the counting doesn't work and i'd really appreciate if anyone could guide me through making a more sophisticated FSM.

I have followed your pointers, my Score gets stored in a Score Manager, which gets Setup -> Updates the HUD -> Listens for Action -> Adds Score.

I have added an FSM with a collision event to the interactable Item which is a simple cube, i have added the Tags but still nothing happens. 
OnCollision Enter (collide tag Cube) -> "Update Score" Send Event - add Score.

But somehow nothing happens, it would be great if someone knows how to solve this and could help out a bit.
I don't know how to go on :-\

« Last Edit: January 13, 2016, 07:28:38 AM by sinan »

KellyRay

  • Full Member
  • ***
  • Posts: 170
Re: Score System - With Collisions and Combos
« Reply #3 on: January 13, 2016, 12:38:04 PM »
Have you tried triggers in stead of collisions?

You might also make sure that your physics layers are checked:


sinan

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Score System - With Collisions and Combos
« Reply #4 on: January 18, 2016, 06:16:25 AM »
Yes, they are all active but still nothing is happening.

Could someone maybe help me by posting screenshots of how it should look like?

https://imgur.com/a/6ZHOK

I hope they are not completely wrong, as i've said - i'm a total beginner at this.
Need big help :(

KellyRay

  • Full Member
  • ***
  • Posts: 170
Re: Score System - With Collisions and Combos
« Reply #5 on: January 18, 2016, 09:29:30 AM »
You collide tag is set to cube on an object that is also named Cube. Is that because cube has the cube tag?

If so, this could be your problem. An object can't collide with itself. The collide tag should be set to the tag of the object you are checking for collisions with. So for instance. If my cube collides with a wall, I'd want a collision event with the wall's tag.

sinan

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Score System - With Collisions and Combos
« Reply #6 on: January 20, 2016, 05:46:50 AM »
Ooooooooohhhh my god.
Such a simple thing caused so much headaches.
Thank you so much, yes it was the collide Tag which caused the trouble.

I now added Objects which have different Tags and it works! Finally!

Now i'll just have to expand on that and polish everything out, i'm starting to get the hang of it a bit.

Any other input is very welcome, the FSM that's working now is very simple so anyone with a more complex one and ideas how to integrate it with different objects in a simple way and the combo or sequences would be great.

Thank you KellyRay again for taking your time and helping me out, have a good day :)

KellyRay

  • Full Member
  • ***
  • Posts: 170
Re: Score System - With Collisions and Combos
« Reply #7 on: January 20, 2016, 11:01:49 AM »
Of course! Glad you got it working.

More simple, more better.  :)