Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: KurdLegend on July 25, 2012, 07:06:31 PM

Title: Variable Help
Post by: KurdLegend on July 25, 2012, 07:06:31 PM
Hi there guys,

Im creating a 1st person rpg and it involves mining ores and thats where im kinda stuck

You can see in the attached picture how my Ore Vein trigger is set up, after a 1/3 chance of mining a ore which pops out, so my question is how can i add some EXP to the player after he has successfully mined a vein ? im still kind of new to unity and playmaker so im not sure how to use variables and such, plus i also would like the mining exp to be displayed on the HUD if its easy to do

And also is it possible to create an inventory system with Playmaker? i did some searching and couldnt find any

Any kind of help will be deeply appreciated

Thanks for your time :)
Title: Re: Variable Help
Post by: Lane on July 25, 2012, 07:38:24 PM
The XP would just be a variable (int/float) that you would have a few different ways of gathering.

Basically, the way I would do it is.



Basically just make the manager wait for the event, make a blank state and add transitions that are global events like "addXP" so when an action sends the 'do this' command then it runs the event, adds to the xp variable and loops back to the idle listener state when its done.

To create the GUI reference you can briefly make a quick fix for testing by creating a GUILayout Float(or Int) Field and have it reflect the global playerXP variable. This should be updated regularly, like when the manager loops back to idle state or something.
Title: Re: Variable Help
Post by: KurdLegend on July 25, 2012, 07:51:41 PM
wow thats a great reply thank you, im going to try it out now :)
Title: Re: Variable Help
Post by: Lane on July 25, 2012, 09:30:32 PM
One of the video tutorials (the health one?) explains the idea behind managers but once you create your first one it should be pretty clear what you can do with them. In conjunction with the send and broadcast event actions they're quite flexible.

Later you can set up a level manager or something that reads the xp manager and runs an event that gives the player an item or reward when the XP variable reads a value greater than Nth.