playMaker

Author Topic: Need Playmaker state to set off a trigger  (Read 1488 times)

grafxtech

  • Playmaker Newbie
  • *
  • Posts: 1
Need Playmaker state to set off a trigger
« on: December 31, 2015, 06:43:34 PM »
I have text with a collider, when player triggers collider the text pops up. I want to use Playmaker to set off the pop up text. So when the player score reaches its max the pop up text will display winner. I have a health manager FSM working fine but not sure how to get the winner state to set off the text to pop up the winner message. Any tips on hpw I should approach this would be helpful. At this time i have the winner text as a child to trigger collider. Just need it to show winner when the health manager fsm ends up at the winner state. I am new at this.

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Need Playmaker state to set off a trigger
« Reply #1 on: February 01, 2016, 01:05:14 PM »
I am not really sure about what you are trying to do and im sure you have figured it out over the last month but, as a noob myself, ill have a go to at least provide my idea of a solution:

So there is a text box that reads 'Winner' when the player collides with it?

You want to make it so that the box automatically reads 'winner' without being collided with, as soon as the maximum score is reached??

If so I think it may be easy:

I assume you are counting your score somewhere (lets say a float variable). Also lets say the maximum is 100.

Also I assume that you have an FSM on the text object, which sends an event upon colliding with player.

First make the score variable global, so you still add to it the same as before.

Secondly on the text object FSM make a global event. Add a state that is not connected to the other states and right click on it to 'add global transition' and add the global event you just created. You do not need any actions on this state, just add a finished event and send it to the State that displays your text.

Then make an empty game object with a float compare action on it (every frame). If float is less than 100- do nothing, if float equals or is greater than a 100 go to next state. In this state you should add action 'send event', chose to send the global event you created on the text object FSM. In the dropdown box, chose broadcast.

This is a very rough idea of how to do it, written by a noob, but then again if i understand your question, then watching a few tutorials and reading a bit more about playmaker may be useful.

I tried to answer this as i think its best to have at least one answer to all questions, especially for noobs like me, but to be honest im still not sure if I understood the question. I hope it helps...