Blockland Forums > Modification Help
Is this possible with Inventory items/weapons?
(1/4) > >>
xS K I D z:
Alright so I'll try to explain my thought process as best as I can but there's a lot flowing through me right now. I appreciate all the tips on this one as I'm not sure if it's possible but I feel like it is I just don't have a clue how to go about it.
------------------------------------------------------------------------------------------------------------------------------

Q1: Is it possible to require an item in your (default) BL inventory in order to use another? For example, if I had a lock item in my inventory, I wouldn't be able to right-click to open it without first having a key item in my inventory. But I wouldn't select the key, I would only need to have it in my inventory.

    - Then can I delete the key item from my inventory? Or automagically drop it and have it instantly de-spawn or something or another?

Q2: Is it possible to have "durability" or ammo usage for an item in my inventory. For example, if I had a gun item in my inventory as well as an ammo pack item, obviously "using/shooting" (left-click) the gun would use ammo or "durability" on the separate item and then removing the ammo pack item from my inventory and I wouldn't be able to use the gun without then picking up another ammo pack item.

Q3: Is it possible to change a snippet of code or how an item is used by "using" (right-clicking?) a different item in my inventory? For example, if I had a gun item, and also a "gun upgrade" (or something) item, and if I "used" (right-clicked) the upgrade item and it disappeared but then increased my gun firing rate by 1.5x or something and would be a permanent upgrade until I removed the gun item from my inventory.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

Just some ideas I had, if any of this is do-able please enlighten me :) Thanks!
PhantOS:
all of this is doable. it's mostly just triggers and values stored on the player
xS K I D z:

--- Quote from: PhantOS on September 17, 2017, 02:58:49 PM ---all of this is doable. it's mostly just triggers and values stored on the player

--- End quote ---

eyyyyyy well that's good to hear! I don't really have any experience with "values stored on player" but I'm sure some digging will uncover some useful stuffs. Would like to see some other responses on this as well tho of course.
PhantOS:
player.value = 5;

that's what it means. you store stuff like player.durability[itemname] = 10; and then you can access it for that specific item or its id
Shift Kitty:
Yes, yes, and  yes.

The first one is simple. Loop through the player's items and check if they have the other one. Remove it if necessary.

Second one is a little more complicated. There were a set of guns that actually required you to have ammo in your items to use them. Though I'm sure for simplicity's sake you can probably again just loop through the inventory till the thing is found.

Third one is similar to the first one. Make a separate datablock for the upgraded gun. When the upgrade item is used, search the player's inventory for the gun, if it's found, remove the upgrade from the inventory, and replace the gun with the upgraded gun.
Navigation
Message Index
Next page

Go to full version