Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
HolyHominid

Trying to add an power-up use Delay in DECORATE

Question

This might be a simple question but I can't quite wrap my head around how to execute this. I'm trying to make it so if a player picks up my custom power-up they can't pick it up again, or at least it won't activate, for around fifteen seconds. I'm open to any suggestions, I've been struggling with solutions for hours now and can't seem to figure it out. Thanks in advance for any help! 

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0

CustomInventory can be a tricky thing.

 

Such item only lasts until picked up, and ignores any frame durations in the pickup/use state. You can't give timers to CustomInventory.

 

However you can create a dummy Powerup class, which will serve as a timer, and the CustomInventory item would check presence of that "powerup" to prevent being picked up. 

Share this post


Link to post
  • 1

Have you tried not giving it the ALWAYSPICKUP tag and playing with Inventory.MaxAmount?

Share this post


Link to post
  • 0
14 minutes ago, Kan3 said:

Have you tried not giving it the ALWAYSPICKUP tag and playing with Inventory.MaxAmount?

actor TestItem : CustomInventory 10492
{
	+COUNTITEM
	Inventory.Amount 1
	Inventory.MaxAmount 1
	
	States
	{
	Pickup:
		ABCD B 10 A_FireMissile
		stop	
		
	Spawn:
		SOUL ABCDCB 6 Bright
		Loop
	}
}

Here's what I have it set at right now. I've been tweaking small things over and over and the results are the same. Every time I pick up or am given the TestItem it picks it up and fires my test missile. I must be overlooking something. 

Share this post


Link to post
  • 0

Maybe it's because the action of the TestItem only lasts as long as touching the item and the missile firing? Maybe because it's not active like a Berzerk it doesn't count it as being in my inventory after us? Not sure if that's how that works, just a guess.

Share this post


Link to post
  • 0

Update: The first time I use the item it picks it up and fires a missile, the second time I pick it up it doesn't collect the item, therefore firing a zillion missiles. So, after the inventory is maxed out it still uses the item without collecting it. Not sure exactly what to do with that information but it's a starting point at least.

Share this post


Link to post
  • 0
2 hours ago, HolyHominid said:

Update: The first time I use the item it picks it up and fires a missile, the second time I pick it up it doesn't collect the item, therefore firing a zillion missiles. So, after the inventory is maxed out it still uses the item without collecting it. Not sure exactly what to do with that information but it's a starting point at least.

Bizzarre.

 

I could suggest you to try giving the item a duration with Powerup.Duration (that needs to be set in a different class), so that you'll shoot when picked up, but then you (should) have to wait until it expire.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×