A better way to give an item no pickup message?

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.
Locked
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

A better way to give an item no pickup message?

Post by wildweasel »

Okay, I'm working on a new weapon mod. A major part of this weapon mod is that there is a large number of small pickup items that the player can pick up (we'll just call them Points for now, because I'm not quite ready to reveal the mod yet). Because I don't want to flood the console with hundreds of the same pickup message every time one of these little things is collected, I want to get rid of the Inventory.PickupMessage.

Currently I have it like this:

Code: Select all

ACTOR Points : CustomInventory
{
Inventory.PickupMessage ""
+ALWAYSPICKUP
}
This certainly does supress the default "You got a pickup" message, but it still prints a line to the console every time one is picked up (albeit a blank one), and also affects other pickup messages that occur at the same time by inserting a blank line between them. So is there a better way to remove the pickup message?
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Re: A better way to give an item no pickup message?

Post by DBThanatos »

+INVENTORY.QUIET

That must work
User avatar
Ichor
Posts: 1784
Joined: Wed Jul 23, 2003 9:22 pm

Re: A better way to give an item no pickup message?

Post by Ichor »

That just makes it play no sound when it's picked up.

I saw this (about halfway down) a while ago. I've never tried to do that on purpose, but maybe that will work.
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Re: A better way to give an item no pickup message?

Post by DBThanatos »

Ichor wrote:That just makes it play no sound when it's picked up...
... and remove the pickup message ;)

Try this
actor thing1 : BlurSphere
{
}
actor thing2 : BlurSphere
{
+inventory.quiet
}
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: A better way to give an item no pickup message?

Post by wildweasel »

This is actually my current code:

Code: Select all

ACTOR SmallStylePoints : CustomInventory
{
	Inventory.PickupMessage ""
	Inventory.PickupSound "items/stylepoints"
	RenderStyle Add
	Scale 0.125
	+INVENTORY.ALWAYSPICKUP
	States
	{
	Spawn:
		EBLL ABCDEFGHIJ 1
		Loop
	Pickup:
		TNT1 A 0 A_GiveInventory("StylePoints",1)
		TNT1 A 0 A_ChangeFlag ("ACTLIKEBRIDGE", 0)
		Stop
	}
}
I actually need the pickup sounds, so Inventory.Quiet is not an option at this point...though I just had a thought, so I'll test out my theory first.

[edit] And yes, the theory does work out...if you want no pickup messages, but a pickup sound, do something like this:

Code: Select all

ACTOR SmallStylePoints : CustomInventory
{
	RenderStyle Add
	Scale 0.125
	+INVENTORY.ALWAYSPICKUP
	+Inventory.Quiet
	States
	{
	Spawn:
		EBLL ABCDEFGHIJ 1
		Loop
	Pickup:
		TNT1 A 0 A_PlaySoundEx("items/stylepoints","SoundSlot7")
		TNT1 A 0 A_GiveInventory("StylePoints",1)
		TNT1 A 0 A_ChangeFlag ("ACTLIKEBRIDGE", 0)
		Stop
	}
}
Last edited by wildweasel on Sat Apr 05, 2008 8:50 pm, edited 1 time in total.
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Re: A better way to give an item no pickup message?

Post by DBThanatos »

Im shooting in the dark, but can you play a sound in the Pickup state? that'd do it (i guess :P )
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: A better way to give an item no pickup message?

Post by wildweasel »

DBThanatos wrote:Im shooting in the dark, but can you play a sound in the Pickup state? that'd do it (i guess :P )
Uh, yeah, apparently that does work - I edited my post with that information at about the same time you posted. Confusing.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A better way to give an item no pickup message?

Post by Graf Zahl »

I changed the code so that empty pickup messages are no longer printed. Empty means "", not " " as I have seen on occasion.
Locked

Return to “Editing (Archive)”