Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Col. Phil Bilko on April 09, 2011, 09:31:33 AM

Title: [solved] Lives & Local Scoring?!??
Post by: Col. Phil Bilko on April 09, 2011, 09:31:33 AM
Hello;

Just for a second pretend I am a complete novice at coding in Unity.... Ok actually I do not know how to code at all haha :D But I have put together a somewhat fun game so far with Playmaker.

Question One: How can I have it where a game object has 3 lives and when it collides with a trigger loses a life before respawing to set location? Also displaying a counter on screen.

Question Two: Is it possible to have score boards or local scoring with playmaker? If so how do I do it? (Scoring is not really needed for this game but would be nice to have some form of visual reward for collecting items)

I have EzGUI and Sprite Manager if that makes a difference??

Thanks in advance to those if any help a novice such as myself.

Regards;

Bilko
Title: Re: Lives & Local Scoring?!??
Post by: MaDDoX on April 10, 2011, 05:18:44 PM
D000d... you're asking how to make a full game with PlayMaker, that'd take a whole fricken tutorial :) Anyways, I'll give you some hints.

Quote
Question One: How can I have it where a game object has 3 lives and when it collides with a trigger loses a life before respawing to set location? Also displaying a counter on screen.
Don't put your lives in the "character" game object, or else when you destroy it you'll lose track of your lives. I'd recommend you having one main FSM attached to one object (call it "gamedata" or "gamevar") at the root of the scene. Put your main or global variables there, in your case create a "playerlives" integer variable and initialize it with the value of 3. At your character Game object add an FSM and set it up like this:
(http://www.gamereplays.org/community/uploads/post-31-1302469976.jpg)

Then in your main gamevar object create and add an event named "ePlayerWasHit" to the initial state, which adds -1 (ie. subtracts one) from the playerlives variable. As for question two, you can use a similar approach, just add some GUI actions to your main FSM ("gamevar" in my example).

Quote
I have EzGUI and Sprite Manager if that makes a difference??
There aren't EzGUI or Sprite Manager actions publicly available for Playmaker as of yet, although I'll be working on some for SpriteManager 2 this week and intend to release it publicly. Anyways, I don't see the need for them on such a simple scenario, simply use the new GUI system/actions available in Playmaker 1.1.

Hope this is of some use for you and other novices. Good luck, Bilko!
Title: Re: Lives & Local Scoring?!??
Post by: Col. Phil Bilko on April 12, 2011, 04:30:08 AM
D000d... you're asking how to make a full game with PlayMaker, that'd take a whole fricken tutorial :) Anyways, I'll give you some hints.

Hahahaha actually sorry I was not to clear, I HAVE made a cool fun little game so far using Playmaker, just needed a couple questions answered in regards to the above post, which you have answered for me.... Thanks ever so much! Now time to implement those new lives into the game :D

Regards;

Bilko