Beefy Kasplant Posted April 29, 2020 Share Posted April 29, 2020 Ever made an event where you give multiple items? Ever thought about how it would break horribly if the person has free inventory spaces, but not enough to receive all items? Well, do I have the SOLUTION for you! Just check how many free inventory spaces the guy has bro! First, create an invisible item: InvCheck (Can be any name of course) Player Variables: FreeSpaces InvCheckItemHeld Common Event: Set PV FreeSpaces to 0 Set PV InvCheckItemHeld to 0 -> These two first lines are to reset the system Label: StartLoop -> This is the start of the loop to check how many free spaces the person has Give Item: InvCheck SUCCESS: Add PV FreeSpaces +1 Add PV InvCheckItemHeld +1 Go to label: StartLoop -> If it succeeds, this means there is a free inventory slot, it goes to the start of the loop to try again until it fails. FAIL: Show text: You have \pv {FreeSpaces} free inventory slots Label: TakeInvCheckItem -> This is the loop to take the inventory checker items until they are all gone. Take Item: InvCheck SUCCESS: Go to label: TakeInvCheckItem -> This will keep going until all InvCheck items are gone You can put this common event before any event that gives multiple items, and just add a conditional branch in which you check if PV FreeSpaces is high enough to continue giving the actual items. NOTE ALERT NOTE ALERT: I did this without an editor and without checking, so please let me know if there are ways to improve or bugs in this event! Ainz Ooal Gown, Shenmue, Vio and 1 other 4 Link to comment Share on other sites More sharing options...
Weylon Santana Posted April 29, 2020 Share Posted April 29, 2020 I will test now @Beefy Kasplant Beefy Kasplant 1 Link to comment Share on other sites More sharing options...
Cheshire Posted April 29, 2020 Share Posted April 29, 2020 Would it not be easier to get a Condition to check for this? Link to comment Share on other sites More sharing options...
Beefy Kasplant Posted April 29, 2020 Author Share Posted April 29, 2020 3 minutes ago, Joyce said: Would it not be easier to get a Condition to check for this? A condition to check for amount of free inventory spaces would be easier yeah haha. But this is a way to do it with events, in case you are like me, and you can't do it with code. Ainz Ooal Gown 1 Link to comment Share on other sites More sharing options...
Cheshire Posted April 29, 2020 Share Posted April 29, 2020 I was trying to nudge people into writing a github feature request. 😉 Need those to develop against. Beefy Kasplant 1 Link to comment Share on other sites More sharing options...
Weylon Santana Posted April 29, 2020 Share Posted April 29, 2020 @Beefy Kasplant all working okay. Great tutorial! https://prnt.sc/s81hh1 I made a command to give 5 items. It remains the same. Full working. https://prnt.sc/s81kql Beefy Kasplant 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now