Jump to content
  • 0

Keeping Inventory Items After Using Them


Mad Dal 85

Question

I noticed that the "Ritual Knife" from R667 stays in the inventory even after you use it. How is that done?

I wish to use that method for other items in my mod such as the Summon Sphere but that keeps disappearing after use. So i just want to know how to keep them in the inventory when you use it? (ie, unlimited use of it)

 

Thanks

Share this post


Link to post

7 answers to this question

Recommended Posts

  • 0

You need to mark the item using as failed. Depends which type of actor the item is:

 

If it is a DECORATE CustomInventory actor, then finish the Use state with fail instead of stop.

If it is a ZScript Inventory actor, then return false from the Use virtual method.

Share this post


Link to post
  • 0
8 hours ago, jaeden said:

You need to mark the item using as failed. Depends which type of actor the item is:

 

If it is a DECORATE CustomInventory actor, then finish the Use state with fail instead of stop.

If it is a ZScript Inventory actor, then return false from the Use virtual method.

ok thanks.

 

i don't understand zscript to be honest. i tried looking for tutorial videos about zscripting on doom and found nothing. 

Share this post


Link to post
  • 0
7 hours ago, Mad Dal 85 said:

i don't understand zscript to be honest. i tried looking for tutorial videos about zscripting on doom and found nothing. 

 

Yeah, thats because you dont learn zscript from watching videos. You can learn zscript by using it. But not by watching videos.

Share this post


Link to post
  • 0
On 3/1/2023 at 2:49 PM, jaeden said:

You need to mark the item using as failed. Depends which type of actor the item is:

 

If it is a DECORATE CustomInventory actor, then finish the Use state with fail instead of stop.

If it is a ZScript Inventory actor, then return false from the Use virtual method.

it's not working. it keeps disappearing from the inventory

Share this post


Link to post
  • 0
On 3/2/2023 at 6:31 AM, ramon.dexter said:

 

Yeah, thats because you dont learn zscript from watching videos. You can learn zscript by using it. But not by watching videos.

yeah, i still don't understand zscript, not without any kind of tutorial anyway which what i am looking for, in case you misunderstood that little part.

Share this post


Link to post
  • 0
On 3/1/2023 at 2:49 PM, jaeden said:

You need to mark the item using as failed. Depends which type of actor the item is:

 

If it is a DECORATE CustomInventory actor, then finish the Use state with fail instead of stop.

If it is a ZScript Inventory actor, then return false from the Use virtual method.

sorted it. thanks again.

 

one last question: is there any way to put a cooldown effect on it so it can not be used again for a period of time?

Share this post


Link to post
  • 0
19 hours ago, Mad Dal 85 said:

sorted it. thanks again.

 

one last question: is there any way to put a cooldown effect on it so it can not be used again for a period of time?

 

I think you can make a dummy Powerup class that serves as a "timer", give it to the player when they use the item, and check if the "timer powerup" is in inventory when player tries to use the item.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...