Jump to content
  • 0

Trying to add an power-up use Delay in DECORATE


HolyHominid

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
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
  • 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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...