This is not a function or a statement; it's actually a value that can be taken on by any MUDL variable. MUDL treats nulls in a fancier way than most other programming languages. The reason is that MUDL does not act in isolation, but is coupled to a dynamic MUD with other actors wandering around in it doing things. You might issue an innocuous MUDL statement like
cmd(%1,'north')causing the being indicated by the variable %1 to move one room north. But there was a pit trap there! Full of spikes! And %1 fell into it, and DIED! And not only that, but since he wasn't a player the memory his data was occupying has now been FREED and REUSED! All before your poor MUDL script even gets to execute the next statement...
Internally what will happen at this point is that the value of %1 will automatically become null. Say that your next statement was
msg_character(%1,'You are done walking north.')MUDL will see that you are calling the msg_character function, and that one of the arguments is null. It will then short-circuit that call: it won't even bother to call the function, because it never calls system functions with null arguments. That means that the message won't get sent, which is good, because if it was sent it would have crashed the MUD.
Nulls in operations (like +) propagate their nullity. That is, null + 3 is null.
The only time nulls don't leave a swath of destruction, short-circuiting everything around them and leaving more nulls everywhere, is when they are used as booleans. If MUDL is expecting a boolean somewhere and gets a null, the null is treated as 'false'. Conversely, if it's expecting a boolean and gets something that isn't a boolean and isn't null, then it's treated like 'true'.
Say that you wanted to tell %a about it after %1 successfully walked north; you could use this script:
cmd(%1,'north'), if(%1,msg_character(%a,'$N calls back ~`It seems to be safe over here!~`')If %1 died while walking north, then come the if statement %1 would be null, which would be equivalent to false, and so the if wouldn't do anything.