playMaker

Author Topic: Character controlling and custom scripting?  (Read 5223 times)

ryf9059

  • Full Member
  • ***
  • Posts: 100
Character controlling and custom scripting?
« on: May 30, 2013, 10:42:10 AM »
Hi, I'm a newbie to playmaker. I just bought this package in hope that I can use the state machine to control character easily in my 2D game.


I watched the video where you can setup a FSM to control a character, you first attached a character controller and then setup FSM. My question is, since my game is 2D does the character controller from unity suitable for my needs? Or can I just use playmaker to build my own character control? is there a template or something that I can easily get my hands on with?

Also, I use a 2d skeleton animation tool called spine, it's still under development so there is no support yet (hopefully when it gets complete playmaker will support it). For things like this not supported in playmaker, can I use custom scripts and invoke custom function?

Thanks
« Last Edit: May 30, 2013, 11:57:45 AM by ryf9059 »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Character controlling and custom scripting?
« Reply #1 on: May 30, 2013, 11:05:51 AM »
I watched the video where you can setup a FSM to control a character, you first attached a character controller and then setup FSM. My question is, since my game is 2D it the character controller from unity suitable for my needs? Or can I just use playmaker to build my own character control? is there a template or something that I can easily get my hands on with?

It should work fine, I prefer making my own character controllers since it generally allows more flexibility unless you have a nice character controller script ready to go with inspector controls and suiting your needs pretty well.

Quote
Also, I uses a 2d skeleton animation tool called spine, it's still under development so there is no support yet (hopefully when it gets complete playmaker will support it). For things like this not supported in playmaker, can I use custom scripts and invoke custom function?

I'm not familiar with Spine, but depending on how complex the asset is whether or not you even need actions to support it. Often times you can just use Get/Set Property to reach into scripts and change things and don't need any custom actions to do things. Check out the Get/Set Property tutorial, you basically just drag the script over to the editor FSM and it will prompt you which action you want.

Does that help?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Character controlling and custom scripting?
« Reply #2 on: May 30, 2013, 02:38:08 PM »
It should work fine, I prefer making my own character controllers since it generally allows more flexibility unless you have a nice character controller script ready to go with inspector controls and suiting your needs pretty well.

Do you have a tutorial for making character control specifically? 2D would be better (I heard that 2D controll is generally more difficult than 3D)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Character controlling and custom scripting?
« Reply #3 on: May 30, 2013, 02:55:05 PM »
It depends a lot on what you want to do. I can make an example scene, possibly this evening or tomorrow. Top down? Side scroller?

Meanwhile, there are a lot of threads about 2d character controllers on the forum.
http://hutonggames.com/playmakerforum/index.php?topic=2865
http://hutonggames.com/playmakerforum/index.php?topic=1214
http://hutonggames.com/playmakerforum/index.php?topic=3271
http://hutonggames.com/playmakerforum/index.php?topic=3076
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Character controlling and custom scripting?
« Reply #4 on: June 01, 2013, 02:12:07 PM »
It depends a lot on what you want to do. I can make an example scene, possibly this evening or tomorrow. Top down? Side scroller?

Meanwhile, there are a lot of threads about 2d character controllers on the forum.
http://hutonggames.com/playmakerforum/index.php?topic=2865
http://hutonggames.com/playmakerforum/index.php?topic=1214
http://hutonggames.com/playmakerforum/index.php?topic=3271
http://hutonggames.com/playmakerforum/index.php?topic=3076

2D side scroller with gravity enabled, so player can move around and jump, stuff like that. (not sure what's the best way to handle this physical interaction like jump)

Also, when runing and jumping etc, different animations are played, in my game this is done by a custom script called SpineSkeleton, it's part of the spine-unity runtime which is not integrated into playermaker yet, I need to call those function in the code probably (the script is attached to the player).

Also, the player contains life points, exp, skills point etc which may need to associate with GUI in the future (I heards that there are local and global variables for different usage). I have NGUI package so if your example contain things that will utilize it that would be awesome.

Thanks!
« Last Edit: June 01, 2013, 02:17:40 PM by ryf9059 »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Character controlling and custom scripting?
« Reply #5 on: June 01, 2013, 04:02:14 PM »
Hmm. I don't have NGUI or SpineSkeleton so I'll just make a basic capsule side scroller. I'm pretty sure it should be enough to carry over the FSM's to a full 2d system you can use with other plugins.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Character controlling and custom scripting?
« Reply #6 on: June 02, 2013, 07:10:47 AM »
Hmm. I don't have NGUI or SpineSkeleton so I'll just make a basic capsule side scroller. I'm pretty sure it should be enough to carry over the FSM's to a full 2d system you can use with other plugins.


When are are done with the example where can I see it? BTW, do I use rigidbody for the player control in my case? I assume this belongs to the "unrealistic physics" category