Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Gameplay.ActionGetMessageValue


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
class ActionGetMessageValue extends Scripting.Action;

var() editcombotype(messageProperties) Name property;

// messageProperties
function messageProperties(Engine.LevelInfo level, out Array<Name> s)
{
	local Name propName;

	if (parentScript.messageClass == None)
	{
		logError("This script does not have a message class set for it");
		return;
	}
	
	ForEach AllProperties(parentScript.messageClass, class'Message', propName)
	{
		s[s.Length] = propName;
	}
}

// execute
latent function Variable execute()
{
	local Message currMessage;
	local class<Variable> varClass;
	local Variable v;
	local string val;

	currMessage = parentScript.triggeringMessage();

	if (currMessage == None)
		return None;

	val = currMessage.GetPropertyText(string(property));

	class'Variable'.static.bestVariableClass(val, varClass);

   	v = newTemporaryVariable(varClass);
	v.SetPropertyText("value", val);
	
	return v;
}

// editorDisplayString
function editorDisplayString(out string s)
{
	s = parentScript.messageClass.Name $ "." $ propertyDisplayString('property');
}

defaultproperties
{
	actionDisplayName	= "Get Message Value"
	actionHelp			= "Gets a value from the message that triggered the script"
	returnType			= class'Variable'
	category			= "Script"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 15:53:24.000 - Creation time: st 23.5.2018 00:10:40.285 - Created with UnCodeX