How to automatically trigger ArtiTeleport from a PowerupGiver

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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!)
Post Reply
User avatar
Roebloz
Posts: 5
Joined: Fri Aug 12, 2022 11:29 pm
Contact:

How to automatically trigger ArtiTeleport from a PowerupGiver

Post by Roebloz »

Hey all, this is my first post here. I've registered mainly because I'm making a new gameplay mod for ZDoom and I'd like to release it here, so there's that. However, one of the weapons I want to have is an automatically-triggering ArtiTeleport (Aka the Chaos Device, which brings you back to one of the player spawns.) once you fire a certain weapon. (You fire it, it consumes ammo and it gives you the modified ArtiTeleport)
However, despite me including +Inventory.AutoActivate in DECORATE, it doesn't work! Does anyone have any idea how to fix this, or have an alternative method of having a way to teleport back to the player spawn thanks to a weapon?
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: How to automatically trigger ArtiTeleport from a PowerupGiver

Post by Player701 »

ArtiTeleport is not a powerup, so it cannot be used with a PowerupGiver. It's not even clear from your post where a PowerupGiver is actually supposed to come into play; however, that's a moot point anyway because you don't need one in the first place. Just inherit from ArtiTeleport directly instead.

Code: Select all

actor ArtiTeleportTest : ArtiTeleport
{
    +INVENTORY.AUTOACTIVATE
}
This certainly works as intended because I've just tested it myself by typing "give ArtiTeleportTest" in the console - the player immediately gets teleported to the spawn point.
User avatar
Roebloz
Posts: 5
Joined: Fri Aug 12, 2022 11:29 pm
Contact:

Re: How to automatically trigger ArtiTeleport from a PowerupGiver

Post by Roebloz »

Oh, thank you! Also I meant A_GiveInventory yeah. I'll implement it now. Thank you for your help!
Post Reply

Return to “Scripting”