ActionDoCommand() turns a functioncall into an action on the ActionQueue
eg.
ActionMoveToLocation(lDest);
ActionDoCommand(SendMessageToPC(GetFirstPC(), "tada, OBJECT_SELF arrived at lDest"));
AssignCommand() on the other hand makes oActor the owner of a functioncall: oActor becomes OBJECT_SELF for the purpose of the function.
eg.
AssignCommand(oActor, ActionMoveToLocation(lDest));
AssignCommand(oActor, ActionDoCommand(SendMessageToPC(GetFirstPC(), "tada, oActor arrived at lDest")));
Â
( neither function, iirc, accepts anything other than a void return for the aAction arg. So if you want to assign or do a non-void-returning function, it needs to be wrapped in a void-returning helper function first )
In your examples
AssignCommand(oActor, ActionDoCommand(SendMessageToPC(GetFirstPC(), "Message")));
assigns oActor as OBJECT_SELF for the purpose of the ActionDoCommand(). If oActor has an empty ActionQueue the SendMessageToPC() executes right away. But if oActor already has some stuff in the ActionQueue, those actions need to finish before the message will be sent.
AssignCommand(oActor, SendMessageToPC(GetFirstPC(), "Message"));
This executes the SendMessage immediately, and wrapping it with AssignCommand is irrelevant since it doesn’t matter what OBJECT_SELF is, as far as SendMessageToPC() is concerned.
Â
both are essential, in the right places …