There's a bug with sending messages from squirrel scripts in NewDark 1.26 (I think I encountered it previously in 1.25 also, but I didn't stop to investigate it at the time). The five-parameter (three data) version of the function messes up the data arguments. Specifically, the received message's data 1 property is fine; its data2 property is what was send as data3; and its data3 property is null.
Putting the following script on an object, and linking a button to it with ControlDevice:
Code:
class SendMessageTest extends SqRootScript
{
function OnTurnOn()
{
SendMessage(self, "Foo");
SendMessage(self, "Foo", 1);
SendMessage(self, "Foo", 1, 2);
SendMessage(self, "Foo", 1, 2, 3);
}
function OnFoo() {
print("Foo! data is: " + message().data + ", " + message().data2 + ", " + message().data3);
}
}
The output printed to the monolog is:
Code:
SQUIRREL> Foo! data is: (null : 0x00000000), (null : 0x00000000), (null : 0x00000000)
SQUIRREL> Foo! data is: 1, (null : 0x00000000), (null : 0x00000000)
SQUIRREL> Foo! data is: 1, 2, (null : 0x00000000)
SQUIRREL> Foo! data is: 1, 3, (null : 0x00000000)