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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
6 posts
• Page 1 of 1
yum13241
Posts: 537
Joined: Mon May 10, 2021 8:08 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): EndeavorOS (basically Arch)
Graphics Processor: Intel with Vulkan/Metal Support
ACTOR PowerGunsAkimbo : PowerWeaponLevel2
{
Powerup.Duration 0x7FFFFFFD //~2 years of guns akimbo.
Inventory.MaxAmount 3
Tag "$TAG_GUNSAKIMBO"
//Inventory.Icon "AKIMA0"
}
GunsAkimbo
Spoiler:
ACTOR GunsAkimbo : CustomInventory
{
+COUNTITEM
+INVENTORY.AUTOACTIVATE
+INVENTORY.BIGPOWERUP
+INVENTORY.ALWAYSPICKUP
+DONTGIB
+IGNORESKILL
Inventory.MaxAmount 3
Inventory.PickupSound "misc/p_pkup"
Inventory.PickupMessage "$TXT_GUNSAKIMBO"
Tag "$TAG_GUNSAKIMBO"
States
{
Spawn:
AKIM A -1
Stop
Pickup:
TNT1 A 0 A_GiveInventory("Clip", 50)
TNT1 A 0 A_GiveInventory("PowerGunsAkimbo")
Stop
Use:
TNT1 A 0 A_GiveInventory("PowerGunsAkimbo")
Stop
}
}
I want the CustomInventory item to be used instantly if the player hasn't picked up one on the map they are playing (the powerup lasts forever [OK, 2 years]) but I want the player to have it in their inventory for later use. (w/o giving clips) The problem is that it always gets activated. Since this is an addon for a mod I'm making, ZScript should be fine, since I'm not modifying an existing DECORATE actor. Maybe using the bFLAGNAME feature of ZScript?
SOLUTION: See Ac!d's post.
Last edited by yum13241 on Tue Dec 06, 2022 5:35 am, edited 2 times in total.
Your CustomInventory actor isn't being added to the inventory because you have the +AUTOACTIVATE flag set.
This means that it will run its Use state the moment it's added.
To fix this, you can try adding a conditional check in your Use state, like so:
Ac!d wrote: ↑Mon Dec 05, 2022 10:04 am
I remade your powerup in Zscript. Two lines are commented in order to prevent an automatic activation and the risk of waste.