So I am trying to figure out, how I can make a Shop for buying weapons or buying characters. I’ve looked at @jr 01 example, and I couldn’t figure it out. can anyone explain how that thing works, like the whole process. That would be loads of help for me. Thanks!
I’ll try to make a clear explanation. So basically, you have an object that tracks the collectible(s) you have. Then, you select another object that requires a specific number of collectible. This object sends a message to the object tracking the collectibles to evaluate the number you have, and the number you need. One of two things will happen:
If you have less collectibles than you need:
The collectible tracker will send a message to the object with a specific value telling it that it is not enough. That message will then trigger a whole set of behaviors designed to remind the player that they don’t have enough collectibles.
If you have enough collectibles:
The collectible tracker will send a message to the object with a specific value telling it that the item can be purchased. That message will then trigger a whole set of behaviors designed to grant the player that item and let them know that they do have access to it.
If you are still confused, just ask for any clarification or a better explanation from me or someone else. I hope this information helps you, and good luck with your game!
@Superstargames I think your missing a key point in my shop examples.
The importance of my shop examples is to show how Save behaviors work. Where you said “have an object that tracks the collectible” is actually save behaviors that track collectables. Any object can use these save behaviors
This is my attempt on explaining what Save behavior/blocks are:
- Saves are used to remember a number when you play or come back to a game.
- You can Save a number that you can use later or Read the number that’s in there.
- If you Read before saving anything, it will output a 0.
- You can have as many saves as you want, as long they have different names (cap sensitive).
- You can even have several of the same saves if the are named EXACTLY the same.
- Reading or Saving will both cause an output, so careful to not cause an endless loop.
- Loops from a save can crash your game.
Oh yeah, I forgot about that!
So what if I wanted a person to cost 100 coins, what do I really have to do?
If you look at my example and go to the 2nd purchasable character, you would just need to change the expression from 5 to 100.
The system if kinda complex but I can try to explain it if you want.
Basically it Checks to see if you can purchase it or not.
So can you explain how this really works. The game looks complicated. Maybe you could make a video and then send it to my gmail. I mean whatever works best for you.