I don't know the exact point at which gAction is set to nil, but I'm pretty sure you're right that it's before any daemoms are run. I also don't know of anywhere where the last action is stored as standard. In my current WIP I do roughly what you've tried, namely add a lastAction property to the me object and then modify Action thus:
Code:
modify Action
beforeActionMain()
{
if(gActor == me && !isImplicit && !ofKind(SystemAction))
me.lastAction = self;
}
;
You may or may not want to include the check for excluding the storing of implicit actions depending what you want to use the stored information for.
Storing the complete action in this way (rather than just setting a flag) allows you to get at the complete set of details about the immediate past action (I'm using it in connection with a series of ExtraHints, of the kind we put in
Mrs Pepper's Nasty Secret), for which purpose I also defined a number of convenient macros:
Quote:
#define gActionWas(action)\
(me.lastAction != nil && me.lastAction.actionOfKind(action##Action))
#define gLastDobj (me.lastAction.getDobj())
#define gLastIobj (me.lastAction.getIobj())
#define gLastTopic (me.lastAction.getTopic())
#define gLastTopicText (gLastTopic.getTopicText.toLower())
Hopefully there's something here you can adapt for your own use.
-- Eric