Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Enemy drop items...

CynicSyndrome

Towns Guard
Xy$
0.36
I am currently limiting the player's ability to pickup items based on 4 variables, an inventory size, # of items in inventory, open inventory space, and single item carry max. also gold is limited in the exact same way. is it possible to prevent the pickup of enemy drop items and gold using a system such as this? my goal is not to use a plugin for this. any help would be appreciated.
 

Status Gear Entertainment

Praised Adventurer
Items might be a bit trickier I will have to look more into that later. But gold is relatively easy. You can have a parallel process run in the background checking for gold.

upload_2018-6-6_0-51-54.png

You need to set up:
1. A variable that grabs your current gold.
2. A variable that will be how much gold you want to limit your character to holding.
3. Change the value of your first variable by subtracting it from your limiter.
  • That new value becomes how much of an overflow the character has.
  • You change the gold by DECREASING the amount from the player and set the value to the first variable.
  • This will ensure that your limiter is the MAX value you can have.
  • Do not forget to set the IF statement. it needs to be Greater Than or Equal To 1 above the max.

==========================================================================================

EDIT : Actually I just found out about item possession counts.

upload_2018-6-6_1-7-45.png

If you do a parallel process that checks for all the possession of specific items on hand and then add them all up, you'll be able to get an inventory count. Then just like the gold, create a limiter. And when you exceed the max count, force prompt the player to throw away the item they just picked up so you need to check what item that was and remove it. Or annoyingly prompt the player to remove an item from their inventory.
 
Last edited:

CynicSyndrome

Towns Guard
Xy$
0.36
Thanks very much. i had suspected a parallel process was the only solution for this. which is trouble for me because of the size of the game I'm building. If i had one process to govern all limitations on only single item size, inventory size, and wallet size, the lag would be quite long. this would mean several processes to lessen the lag, but the real problem i have with it is that i want my project to have exceptions to the limitations under certain circumstances and this would very likely prevent that.
 

Status Gear Entertainment

Praised Adventurer
i had suspected a parallel process was the only solution for this.
Well it doesn't have to necessarily be a parallel process but rather, just a process that can be called to every time you go to collect an item, armor or gold. This would be more efficient because a consistent check for every single moment would slow down the game drastically. It would still be just as a good to just call for it only when the user collects something so as long as you can identify when the user has something new, you should be fine. (glad)

If i had one process to govern all limitations on only single item size, inventory size, and wallet size, the lag would be quite long.
Ideally 1 single process to govern everything sounds nice and efficient in theory. But like you have mentioned, due to the size of the project, it would simply be more efficient to divide the processes up. It wouldn't make any sense for making the game check to see if you picked up a new item or armor when all you did was collect gold. But aside from sense, it would be an unnecessary process that would also eat up time and speed.

this would mean several processes to lessen the lag, but the real problem i have with it is that i want my project to have exceptions to the limitations under certain circumstances and this would very likely prevent that.
Exceptions are easy to create and you can create them WITHIN the limiting process themselves. Say you want to limit the item carry capacity to 10 items. But in the exception case for a moment you will allow 15, you can just set a conditional branch to check if a specific switch is ON and then you could simply have it carry out it's process and then use lables to jump it.

upload_2018-6-6_18-32-24.png
 

CynicSyndrome

Towns Guard
Xy$
0.36
So i originally wanted to handle this in the victory aspect of each enemy event but i don't think this solution will do it for random encounters as they don't have a standard event process. am i right?
 

Status Gear Entertainment

Praised Adventurer
That is correct, you will not be able to do anything like this naturally. You will probably have to find a custom system that does something like this. Luckily you can still imitate something similar by creating a variable that will constantly change it's value until you specify a specific value.

1. Create a variable and set its value to random and have it run over the course of maybe 20 frames between each random value.

2. Create another variable and have it be a specific or random value and when Variable 1 finally matches the value of variable 2, it will trigger a fight that you set.

3. Create another variable that would be random as well, that variable could determine which enemy you encounter on the map.

upload_2018-6-6_20-33-50.png

Here you can see that if you win after the battle, you can call for your victory winnings.

But anything other than that you will probably need a plugin for that.
 
Top