Pick Up Messages

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
Loose Cannon
Skilled
Posts: 165
Joined: Tue Jan 19, 2016 4:17 am

Pick Up Messages

Post by Loose Cannon »

Hello all:

I'm trying to change the pick up message on some default items. For example, I changed the body armor from green to gold and I want the message to say, "You found Golden Armor". I was able to change the armors color to gold and I also went into the actor class browser, right clicked on the armor and changed the pickup message from "you got the body armor" to "you found the golden armor" but it's not working.....what am I missing??

Thanks!
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Pick Up Messages

Post by Barbie »

See this:

Code: Select all

class Inventory extends Actor abstract native nativereplication;
...
	function Touch( actor Other ) {
	...
		if ( PickupMessageClass == None )
			Pawn(Other).ClientMessage(PickupMessage, 'Pickup');
		else
			Pawn(Other).ReceiveLocalizedMessage( PickupMessageClass, 0, None, None, Self.Class );
	...
It means that the pickup message is retrieved from the class, not from the class instance itself.
Solution: Sub class your custom Inventory, set the new pickup message in the defaults and add these to your map.
<EDIT>
Added a link to the wiki for Sub class
</EDIT>
Last edited by Barbie on Sat Feb 11, 2017 5:29 pm, edited 1 time in total.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Pick Up Messages

Post by Barbie »

Or have a look at the attached test map. ;o)
Screenshot
TestPickupMessages.jpg
Attachments
TestPickupMessages.unr.7z
(10.08 KiB) Downloaded 54 times
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: Pick Up Messages

Post by Chamberly »

@Barbie that's what I did and it didn't even save. Not even after rebuildall.
Image
Image
Image Edit: Why does my sig not work anymore?
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Pick Up Messages

Post by Barbie »

Chamberly wrote:that's what I did and it didn't even save.
I'm not sure what you mean here. Have you changed the pickup message of an object of the default package or of a "MyLevel" object? If the latter it should work. If former: Never change default packages!
Loose Cannon wrote:I also went into the actor class browser, right clicked on the armor and changed the pickup message
Sorry, I misunderstood this in first reading. It looks like you wanted to change the pickup message in the stock package (BotPack, UnrealShare, ...): never do such (see above warning).
Last edited by Barbie on Sat Feb 11, 2017 8:24 pm, edited 1 time in total.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: Pick Up Messages

Post by Chamberly »

Barbie wrote:
Chamberly wrote:that's what I did and it didn't even save.
I'm not sure what you mean here. Have you changed the pickup message of an object of the default package or of a "MyLevel" object? If the latter it should work. If former: Never change default packages!
Like what you posted with the pic.
Image
Image
Image Edit: Why does my sig not work anymore?
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Pick Up Messages

Post by Barbie »

Chamberly wrote:Like what you posted with the pic.
Then I assume you have created a sub class of an existing Actor, put it into package "MyLevel" and changed some attributes or code of that new created class.
Have you also created an instance of this class? Because UnrealEd throws away all objects that are not referenced in a way when saving the map. If you reopen the map that MyLevel-Actor will have been gone.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Post Reply