PrimeHover / Warehouse

This plugin allows the creation of warehouses where you can store items in the game.
6 stars 4 forks source link

Undefined #2

Open hughrock23 opened 8 years ago

hughrock23 commented 8 years ago

Let em start by telling you how absolutely life-saving this plugin is! I hate to complain when its base function seems to work as intended, but...

I created a completely fresh project with no other plugins, or script alterations of any kind. I left everything at its default.

When I run the simple plugin commands (the "a" is surrounded by "<" and ">"):

  1. "PHWarehouse create a"
  2. "PHWarehouse show a"

It pulls up the warehouse window and even titles it "a", but the "Withdraw", "Deposit", and whatever text appears next to the "50/50" at the bottom left corner of the window all register as "Undefined".

I can make the withdraw and deposit options appear as "Withdraw" and "Deposit" by specifically going in and changing the "this.withdrawText = PHPlugins.PHWarehouseWithdrawText; this.depositText = PHPlugins.PHWarehouseDepositText;"

to

"this.withdrawText = "Withdraw"; this.depositText = "Deposit";"

I don't know what goes next to the "50/50" in the lower left corner, otherwise I'd live with specifically going through the .js to change that specifically (as long as the rest of it worked).

Think you can throw me a bone?

PrimeHover commented 8 years ago

That's really strange. Other people in the past have the same problem, but right after I update to this last version, there wasn't the error anymore (I guessed).

The text next to 50/50 is the "Available Space", which indicates how much space it has left. The variable that contains the value is the this.availableSpaceText , line 943. Use it as a temporary solution while I still check out what happens with the undefined values.

I'll leave this issue open for while... Thanks for reporting and using this plugin! I'm glad it has helped you!

hughrock23 commented 8 years ago

Thank you for getting back to me so quickly. To be honest, I expected to be waiting another few days lol. No offense.

It really has. I actually found the variable and manually replaced it. The storage seems to be working normally (as far as I can tell).

Now It's registering "Withdraw", "Deposit", and "Available Space" thanks to those manual changes. I guess the variables are, for whatever reason, not saving or pointing accurately to the respective text data. Very odd. As long as it works, I can work with it. I would like to include removing the categories from the game, but your plugin isn't written (i guess) to operate with my other plugin that does just that. Any promising updates to your (already pretty awesome) plugin to include that functionality?

Thanks again for getting back to me. Like I said before, this is a fantastic plugin! I'll throw you a donation when I use it in my commercial project. At the moment, I'm working on a game for my wife, but the big game is 20% done and release date is expected to be July (late)!

Have a great day!

PrimeHover commented 8 years ago

That's very cool!

I'm planning to do an update this week to correct this bug you mention and apply some performance features. It's coming out soon! So, whats does your plugin do exactly? Maybe I can adapt the Warehouse plugin to fit with yours.

I hope your game can make a great success. Keep in touch!

hughrock23 commented 8 years ago

I actually have 2 plugins that would work beautifully if they can all work together. The first is at this link (by Shaz i think) http://mvplugins.com/plugin/Shaz/No%20Item%20Categories, and (by MrTrival) http://mvplugins.com/plugin/MrTrivel/Limited%20Inventory. I'm sure you can see how these would work in perfect unison (for those that don't care for the differentiation in item categories). The whole limit thing works well to compliment the need for the removal of that very differentiation. I've already tried. None of these plugins like to work together with yours. Though they don't seem to mind each other.

I get an error when I use your plugin with the no item categories. When I attempt the limited inventory, I tried to set the inv limit to 5 (for testing) and tried to put 10 potions from your storage function into that inv. I was able to "withdraw" all 10 potions despite the limit, but what's worse is that The limit still capped the number of potions in my inv. So basically, I withdrew 10 potions into an inv with only 5 slots, and resulted in 5 potions in my inv and 5 potions lost to the void.

I understand if that's a tall order. I'm still very new to javascript (I'm used to C and C++), so the ins and outs on what all is needed to accomplish this is outside of my field for the time being.

I can't wait for that update though! I appreciate the wish for success. I'll send you the first beta for my big game (after my wife of course) so you can see your plugin in action! The game will be for both the pc and android upon release, so take your pick on which one you want (or both. I don't really care after you helping me like this).

Thanks for getting back to me, and I look forward to hearing back from you again. Always a pleasure conversing with someone that rocks in the same general field as me (programming) that knows stuff I don't LOL.

Have a good one!

PrimeHover commented 8 years ago

@hughrock23 Done!

Now, it's totally compatible with these two plugins. In particular, to activate the no category function, change the parameter All Together to true. Don't forget to make sure that the JavaScript file has the name PH_Warehouse.js exactly that way.

Keep it up!

hughrock23 commented 8 years ago

That sounds awesome! I can't wait to try it out!

I'll test it as soon as I get home tomorrow. You have no idea how much this means to me!

Thanks again for doing this for me! You're the best!