Well, by now we know the drill, so let's declare a string!
Change our float declaration to this:
var string DeathMessage;
By default, strings are empty. We can see this... or not see this, rather, by changing our
PostBeginPlay
function:function PostBeginPlay() { 'log("Death message:" @ DeathMessage); }
Compile and test to see that nothing shows up:
[0007.74] ScriptLog: Death message:
Well that doesn't help much. Let's change that.
Add this line to our PostBeginPlay function:
DeathMessage = "Tom Stewart killed me!";
Now it looks like this:
function PostBeginPlay() { DeathMessage = "Tom Stewart killed me!"; 'log("Death message:" @ DeathMessage); }
Compile and run the code, and check the log.
[0007.67] ScriptLog: Death message: Tom Stewart killed me!