playMaker

Author Topic: How would I accomplish the following.  (Read 1658 times)

jbh142

  • Playmaker Newbie
  • *
  • Posts: 1
How would I accomplish the following.
« on: July 18, 2013, 01:09:33 AM »
I am making a two player game where the object it to capture the other teams flag and bring it back to your spawn point for the win.

With playmaker how would I assign the flag to be picked up by a certain type unit and once that unit returns back to their spawn point a win condition is achieved. Also if the unit is killed while carrying the flag the flag drops at that location and either team can pick it back up?

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: How would I accomplish the following.
« Reply #1 on: July 18, 2013, 01:05:35 PM »
Hey, how I would do this would be by using collision checks. Player has a collider and flag has its own collider. Also both player have its own tag (player can be tagged mainPlayer, Flag can be tagged flag). Create an FSM in the flag and make an event called playerPickUp

Next create a new state with the action trigger Event on the flag. You can use On Trigger Enter since the player runs up to it to pick up. The collide tag would be mainPlayer since that is what you want to be able to pick it up and the send event would be playerPickUp. The second state would be giving the player the flag and making the flag that was at the location to disappear.   

I would use 2 send events telling for the flag and the mainPlayer. For the flag you would have this in a new FSM with two states, the listen (Start State) and the other state being flagGone (give this state a Global Event called flagTaken) and on this state you want to remove the flag.

You would do the same for the mainPlayer but instead of removing the flag you would have the flag already on him and enable it. You can do this with a bool Check. So it goes to its second state has an action that is called Set Bool Value, and enable a bool you would create specifically for if the player is carrying the flag. You can also use this bool point saying if true when player reaches spawn point give point in a game manager FSM. Or if player is killed and the flag bool was true return flag to origin.

So mainly playing around with that and I'm sure there are plenty of ways to do it but this is just one approach.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez