how to log pickup messages by acs or otherwise

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.

how to log pickup messages by acs or otherwise

Postby Enkio » Tue Oct 05, 2021 7:01 pm

I'm trying to create log collection messages for items with different fonts and classes I also need the script to be callable in a decor actor,
in my tests, it happened that if the pickup state has an acs_namedexecute
will go to pickup state even if
inventory is full
I want to use it that way, but that the item be at least if there is space for that item
this is the example
actor test : custominventory
states
{
Spawn:
CLIP A 10
loop
pickup:
TNT1 TO 0
TNT1 A 0 ASC_NamedExecute("w1",0)
TNT1 A 0 A_GiveInventory("CLip",10)
User avatar
Enkio
 
Joined: 04 Oct 2021
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: Intel (Legacy GZDoom)

Re: how to log pickup messages by acs or otherwise

Postby Blue Shadow » Wed Oct 06, 2021 10:54 am

If I understand you correctly, you want the item to go in the inventory only if it's needed.

Code: Select allExpand view
Pickup:
    TNT1 A 0
    
{
        if (A_GiveInventory("Clip", 10))
        {
            ACS_NamedExecute("w1", 0);
        }
    }
    Stop
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: how to log pickup messages by acs or otherwise

Postby Enkio » Wed Oct 06, 2021 3:05 pm

Blue Shadow wrote:If I understand you correctly, you want the item to go in the inventory only if it's needed.

Code: Select allExpand view
Pickup:
    TNT1 A 0
    
{
        if (A_GiveInventory("Clip", 10))
        {
            ACS_NamedExecute("w1", 0);
        }
    }
    Stop

yes, the message only appears if you can get the item, but you can still get the item,
causing wasted ammunition
User avatar
Enkio
 
Joined: 04 Oct 2021
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: Intel (Legacy GZDoom)

Re: how to log pickup messages by acs or otherwise

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

Then the code above should work; if you do not have full Clip ammo, the item is picked up and the script is executed, otherwise the item remains and the script is not executed.
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 0 guests