playMaker

Author Topic: Abilities  (Read 1074 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Abilities
« on: December 24, 2020, 10:27:21 AM »
Hello,

I want my player to be able to use an ability to interact with the environment. For example, when there is wood, my player can cast a fire spell to burn the wood. I think my character could use the ability whenever, it just might not do anything. Any help getting this to work would be appreciated. Thanks!

John Bassi

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Abilities
« Reply #1 on: December 30, 2020, 12:00:42 PM »
Bumping this thread.

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: Abilities
« Reply #2 on: December 31, 2020, 02:34:42 AM »
It's quite a broad question you're asking... where to begin?

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Abilities
« Reply #3 on: December 31, 2020, 01:48:59 PM »
I guess to give you more specifics about my game, my character (a Wizard) gains 4 elemental abilities at the beginning of the game (similar to how Link gets his 4 runes at the beginning of Breath of the Wild). These abilities can be used in various ways to interact with the envirnmenont to solve puzzles (ex. using fire to burn wood, using water to fill a pond so that my character can swim across it, using wind to activate windmills, etc.). Eventually, I would like to get my character to be able to combine these different abilities in order to make new ones (ex. Fire and Wind make blaze), but I'm not worrying about that quite yet. Keep in mind this is a 2d game. Hopefully this makes it more clear. I guess thinking through possible solutions, would you have objects that you can interact with have a on/off like feature (ex. wood is either there or not, depending if the player burned it or not). I am not entirely sure how to implement this, or even if this is the right way of going about it. Hope this gives you enough to go on. Or would it be that each ability needs a different way of solving the problem? I guess for starters, I would like to figure out how to do the on/off mechanic of when the player interacts with an object. Sorry for the long post, but hey, you wanted more detail! :)

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Abilities
« Reply #4 on: January 03, 2021, 04:09:54 PM »
So, I was able to figure it out, using triggers. However, this only works while the player is standing on an object. What I need is for the player to jump up, touch the intractable object, press the button, and then remove the platform. Why will it only work when I am standing on top of an object, but not when the top of my player touches an object from below (almost like the breakable blocks in 2d Mario). Also, once I have the ability (not before) my character jumps through the box collider (before I even hit the button to break it) why is all of this happening? Is it because my character's jump is super fast (another problem I need to fix) and doesn't have time to register? Thanks in advance for your help! :)

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Abilities
« Reply #5 on: January 04, 2021, 12:22:16 PM »
I figured it out. Had to use a bunch of triggers to do it. And then use the destroy object action.

paradiseprime

  • Full Member
  • ***
  • Posts: 105
Re: Abilities
« Reply #6 on: January 05, 2021, 10:20:06 AM »
Instead of using destroy, see if you can implement pooling. It will allow you save on performance.

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Abilities
« Reply #7 on: January 05, 2021, 12:44:27 PM »
I tried installing pooling actions from the ecosystem, but it just gave me errors; had to delete the package off my computer. Is there another way to save on performance (yes, you are right that my game is lagging) or am I just not implementing pooling properly. Thanks!

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Abilities
« Reply #8 on: January 05, 2021, 12:50:12 PM »
Also, will pooling allow for the objects to respawn in if I do a certain action (ex. enable FSM action)? Because I would also need that, and it doesn't seem like that is possible with the destroy action.