Mychaeel said:
Changing the default properties of a class will affect any future instances of that class.
Not in my experience. I have tried to make my TeamSpecificActors work that way.
What I tried: I made a custom Volume, which could send a localized message to the player on touch, with adjustable properties. I subclassed LocalMessage, just like _Lynx did. Then, when one touched the volume, the defaultproperties of the message subclass were overwritten with the properties set by the mapper. Then the localized message was sent to the player. This didn't work. It kept sending the localized message using the original defaultproperties of the message subclass.
This finally worked: I created a function within the message subclass to overwrite it's own defaultproperties. Like this:
Code:
function GetRequiredInfo(string myDisplayMessage, color myMessageColor, int myMessageLifeTime, bool mybFlash)
{
default.DisplayMessage = myDisplayMessage;
default.DrawColor = myMessageColor;
default.LifeTime = myMessageLifeTime;
default.bFlash = mybFlash;
}
To execute this function, I had to call it from the volume, so I inserted the following in the Touch() function:
Code:
local LocalMessageSubclass myLocalMessage;
myLocalMessage = Spawn(class'LocalMessageSubclass'); //Needed to access function
myLocalMessage.GetRequiredInfo(var1, var2, var3, var4); //Modify properties. Using class'LocalMessageSubclass'.default.bFlash = True/False didnt work
Player.ReceiveLocalizedMessage(class'LocalMessageSubclass',,,,); //Send message
And it works like an absolute charm.
To get back on topic: I think preventing the message from showing up is a better way to not send the message to the player than by sending a blank string. That would just be unnecessairy imo.