playMaker

Author Topic: Upgrades [SOLVED]  (Read 2050 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Upgrades [SOLVED]
« on: December 24, 2020, 10:22:47 AM »
Hello,

I am wondering how to give players upgrades when they get to a certain point (ex. get to a magical book that gives them a new ability). I want the player to be able to collect these upgrades in any order they want, depending on which one they reach first. Any help would be appreciated. Thanks!

John Bassi
« Last Edit: January 03, 2021, 06:47:20 PM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Upgrades
« Reply #1 on: December 25, 2020, 09:46:11 AM »
Hi.
If there we will be a few then you can just use some bool variables and load save them.

Else you can use arrays / hashtables / xml but you probably need easy save as well then

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Upgrades
« Reply #2 on: December 26, 2020, 12:22:28 PM »
I think I need a little more detailed of an explanation. If you have the time to explain, that would be great. If not, could you link me to a video that explains this using playmaker. Thanks!

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: Upgrades
« Reply #3 on: December 26, 2020, 01:59:27 PM »
You could just use a collider (is trigger) and when the player hits the trigger it sends an event to add your item to an array.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Upgrades
« Reply #4 on: December 27, 2020, 09:45:43 AM »
Hi.

If you have many upgrades maybe this can help :



when a few only then have a set of bools which you can load/save.

then when you pick something up, set to true and save, then send a event to your upgrade manager (for example) to reload upgrades.

manager then checks all bools and if true then activate it.

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Upgrades
« Reply #5 on: December 31, 2020, 05:09:13 PM »
So I was messing around with it, and I wasn't exactly sure how to implement your ideas, so I think I have a start, but its still not working, so I wanted your thoughts. I start with a collision 2d event that the game object is the physical upgrade in the game world. Then it loops from that into the jump ability (figured it was an easy one to start with). The jump should then theoretically work forever (might have to implement a save eventually). This is all on my player. As of right now, even when I walk over the upgrade, it doesn't work. Any advice would be appreciated. Thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Upgrades
« Reply #6 on: January 01, 2021, 11:32:14 AM »
Hi.
It's hard to say what is wrong.
can you show your setup (fsm / states / actions)

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Upgrades
« Reply #7 on: January 01, 2021, 03:36:45 PM »
Here you go.

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Upgrades
« Reply #8 on: January 01, 2021, 03:38:07 PM »
Here are the rest.

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Upgrades
« Reply #9 on: January 03, 2021, 11:36:54 AM »
I figured it out. Heres the FSM. It uses triggers.