Safety Mechanism For Custom Inventory

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Safety Mechanism For Custom Inventory

Postby hima3009 » Wed Oct 06, 2021 6:06 pm

I've Made/collected this inventory items for my zandronum server but the problem is the items keep overriding themselves every time i press the use button which can easily happen accidentally.
Is there anything i can do to prevent using the items prematurely?
You do not have the required permissions to view the files attached to this post.
hima3009
 
Joined: 06 Oct 2021

Re: Safety Mechanism For Custom Inventory

Postby Blue Shadow » Thu Oct 07, 2021 10:12 pm

There are multiple items in that WAD you posted. Which item are you having trouble with?
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Safety Mechanism For Custom Inventory

Postby hima3009 » Fri Oct 08, 2021 8:41 am

All of them..
When you tybe "give all" command , you will get them with their maximum amout , but you can reactivate them all by the activation key even before their activation time has finished which will lead to accidental use and ultimately deplete them all.
hima3009
 
Joined: 06 Oct 2021

Re: Safety Mechanism For Custom Inventory

Postby Blue Shadow » Fri Oct 08, 2021 11:55 pm

Here's the fixed version of the WAD: https://www.dropbox.com/s/ucnr6hnq8damn ... a.zip?dl=1

What I did:
  • Medikit - Changed from CustomInventory to HealthPickup.
  • BlurSphereST and PowerStim - Changed from CustomInventory to PowerupGiver.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Safety Mechanism For Custom Inventory

Postby hima3009 » Sat Oct 09, 2021 9:10 am

Thank you very much, this is exactly what i wanted.
this was bugging me for the last 2 month yet i couldn't figure out what i should do, thought it needed some ACS fancy stuff.

Edit : let me know if I can execute ACS in PowerUpGiver.
hima3009
 
Joined: 06 Oct 2021

Re: Safety Mechanism For Custom Inventory

Postby Blue Shadow » Sat Oct 09, 2021 10:56 pm

hima3009 wrote: Edit : let me know if I can execute ACS in PowerUpGiver.

No, you can't. Not by using DECORATE, anyway. You need ZScript for that. If DECORATE is your only choice, which I imagine it is since Zandronum doesn't have ZScript, then you're going to have to change them back to CustomInventory if you want to do something extra, like executing an ACS script. However, doing so might send you back to square one with the problem you were having.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Safety Mechanism For Custom Inventory

Postby hima3009 » Sun Oct 10, 2021 6:37 am

It's my fault i didn't state my plans first, so what i was planning to do is when you activate the item a timer is shown up somewhere in the screen to display how much time left before the item is depleted.
so probably what i'll do in the future is revert back Custominventory when every i learn about "Checkinventory" in ACS script.
hima3009
 
Joined: 06 Oct 2021

Re: Safety Mechanism For Custom Inventory

Postby Blue Shadow » Sun Oct 10, 2021 8:47 pm

Instead of fiddling around with the item, you could run a looping ACS script which gets the time of the powerup in question and prints it on the screen. If you use an ENTER-type script, then you don't need to execute it from any item, as it's executed when the player enters the map.

Code: Select allExpand view
script "DrawPowerupsTime" Enter
{
    while (true)
    {
        // Do stuff here...

        Delay(1);
    }
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest