playMaker

Author Topic: Gathering/mining system and setup?  (Read 1541 times)

servantsaber

  • Playmaker Newbie
  • *
  • Posts: 2
Gathering/mining system and setup?
« on: May 06, 2014, 11:52:31 PM »
Hey there guys, I've just started using play-maker, and Although I've gone thru a few tutorials, I guess I just haven't nailed it down, with so many options.

What I'm wanting to do:
           Setup and handle a resource called "Gems" that can be mined from props.
           Setup a way to handle the mining, like that seen in rust or other games.

I'm sorry if I'm coming off as Somewhat sounding "Needy", but I really don't know where to start on this project.

What I have so far:
                           A basic scene with small crystal models littering the landscape.
                           A first person controller Controller.

I know I'll eventually Figure this out, but any help would be greatly appreciated regarding tips or a quick rundown on how I would start.

Thanks in advance for your time^^





tezer86

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Gathering/mining system and setup?
« Reply #1 on: May 07, 2014, 06:02:34 AM »
Im still quite new with playmaker myself though I can give you some pointers towards this until someone better replies.

The first thing would be setup a variable called 'Gems' on both the character and the little gem assets around the scene. Start the character with 0 as they dont have any Gems, and then make the Gems variable on each of the assets whatever you want the amount of Gems in each one to be.

Then assuming this is a FP game, when the player presses the mouse down cast a ray with a range of however far you want the reach of the player. If the ray hits one of the assets with Gems in then remove Gems from the asset and add the same amount of Gems to the player.

So an overview of the actions you will need:

- Get Mouse down (used to detect if the player has pressed the mouse)
- Raycast (casts a ray and stores the object hit)
- Tag compare (compares the tag of the object hit to see if its an asset)
- Get fsm int (gets an int variable from an fsm, used to get the Gem variable from the asset then raycast hit)


That should be enough to get you started. Its not all of the actions you will need but its a good start.

My advice would be to start with the player character facing and right next to the asset that has the Gems in. Then you dont have to worry about navigation at the start.

Or

Build your character navigation and input system first and forget about the Gem gathering until you have the nav system ready.

Hope this helps,

Good Luck
« Last Edit: May 07, 2014, 06:04:16 AM by tezer86 »