Animation when objects were picked up?!

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Animation when objects were picked up?!

Post by Tormentor667 »

Well, I tried something today and it just doesn't seem to work somehow, but take a look at the code before:

Code: Select all

actor ScoreDiamond : CustomInventory 31099
{
  inventory.pickupmessage "Blood Diamond"
  inventory.pickupsound "S_BONUS"
  +COUNTITEM
  +NOGRAVITY
  +FLOATBOB
  states
  {
  Spawn:
    DIAM A -1
    stop
  Pickup:
    DIAM B 2 ACS_ExecuteAlways(704, 0, 0)
    DIAM C 2
    DIAM D 2
    DIAM E 2
    DIAM F 2
    TNT0 A -1
    stop
  }
}
It's actually a Diamond pickup that should play a "Death Animation" when it gets picked up but unfortunately it simply disappears after dying, so I think it's an engine limitation conc. that code. So, is there any other way how to do this?
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Animation when objects were picked up?!

Post by Ryan Cordell »

Unfortunately, one of them is to use A_SpawnItemEx or such, but that'll have it's own set of stupid problems too.

EDIT: And geez, shorten the DIAM frames to DIAM CDEF 2. :P
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: Animation when objects were picked up?!

Post by Cutmanmike »

Pickups are picked up and removed so only the first line will be used. The only way is to spawn something where it was.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Animation when objects were picked up?!

Post by Ryan Cordell »

I tried something akin to that; It spawned at the player's position instead.
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: Animation when objects were picked up?!

Post by CaptainToenail »

Don't the Heretic items do this? How does that work?
User avatar
Enjay
 
 
Posts: 27356
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Animation when objects were picked up?!

Post by Enjay »

CaptainToenail wrote:Don't the Heretic items do this? How does that work?
You mean the blue flash when you pick something up? That's a specific actor called "PickupFlash" which gets spawned when the item gets picked up.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Animation when objects were picked up?!

Post by Tormentor667 »

So can you emulate this somehow in Doom for certain items?
User avatar
Enjay
 
 
Posts: 27356
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Animation when objects were picked up?!

Post by Enjay »

There is this actor flag

+INVENTORY.PICKUPFLASH

and that certainly works to spawn the flash for inventory items. All you need to do is provide the graphics (ACLOA0-E0 from Heretic or Hexen.wad). Or you could replace the PickupFlash actor via your decorate.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Animation when objects were picked up?!

Post by Tormentor667 »

Thx, that helps :)
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Animation when objects were picked up?!

Post by Ryan Cordell »

Enjay wrote:There is this actor flag

+INVENTORY.PICKUPFLASH

and that certainly works to spawn the flash for inventory items. All you need to do is provide the graphics (ACLOA0-E0 from Heretic or Hexen.wad). Or you could replace the PickupFlash actor via your decorate.
Would be much better to be able to have custom frames and such for disappearing pickups. I don't want to be limited to only using Heretic's darn artiflash.
User avatar
Ichor
Posts: 1784
Joined: Wed Jul 23, 2003 9:22 pm

Re: Animation when objects were picked up?!

Post by Ichor »

How about if the item was a normal thing that can't be picked up, but dies when something touches it? The item would then be added to the inventory using decorate instead of as a pickup.
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: Animation when objects were picked up?!

Post by Cutmanmike »

Blade Nightflame wrote:Would be much better to be able to have custom frames and such for disappearing pickups. I don't want to be limited to only using Heretic's darn artiflash.
Quite. Request it ;) Imagine having some crazy sparkle effects spawn around you when you pick stuff up? That would be a nice touch.
User avatar
Enjay
 
 
Posts: 27356
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Animation when objects were picked up?!

Post by Enjay »

Of course, you can "replace" the PickupFlash with any actor you care to define - but it would be a universal change for all actors that use PickupFlash.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Animation when objects were picked up?!

Post by Tormentor667 »

Which state do I have to alter for the animation? The "Death" state?
User avatar
Enjay
 
 
Posts: 27356
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Animation when objects were picked up?!

Post by Enjay »

For the PicupFlash? Just the spawn state I think. It appears, goes through its animation then disappears again. Must just be a spawn thing.

Edit:

Yeah, this is all it has in the source as far as I can see:

Code: Select all

// Pickup flash -------------------------------------------------------------

class APickupFlash : public AActor
{
	DECLARE_ACTOR (APickupFlash, AActor)
};

FState APickupFlash::States[] =
{
	S_NORMAL (ACLO, 'D',    3, NULL                         , &States[1]),
	S_NORMAL (ACLO, 'C',    3, NULL                         , &States[2]),
	S_NORMAL (ACLO, 'D',    3, NULL                         , &States[3]),
	S_NORMAL (ACLO, 'C',    3, NULL                         , &States[4]),
	S_NORMAL (ACLO, 'B',    3, NULL                         , &States[5]),
	S_NORMAL (ACLO, 'C',    3, NULL                         , &States[6]),
	S_NORMAL (ACLO, 'B',    3, NULL                         , &States[7]),
	S_NORMAL (ACLO, 'A',    3, NULL                         , &States[8]),
	S_NORMAL (ACLO, 'B',    3, NULL                         , &States[9]),
	S_NORMAL (ACLO, 'A',    3, NULL                         , NULL)
};

IMPLEMENT_ACTOR (APickupFlash, Raven, -1, 0)
	PROP_SpawnState (0)
	PROP_Flags (MF_NOGRAVITY)
END_DEFAULTS
Locked

Return to “Editing (Archive)”