Events are very unreliable. Did more testing, and these are my results:
Before we get into it, I'm using EVENT_TYPE_AMBIENT_CONTINUE to catch when a conversation ends. When I initiate the conversation I set the AMBIENT_SYSTEM_STATE on the NPC speaker to 1 (so that the event will actually fire when the conversation ends), and when I end the conversation I set the AMBIENT_SYSTEM_STATE back to 0 (to stop the event from being triggered when I don't want it to be). My reasons for doing this is that I will need my code to run at the end of EVERY conversation, so having a general solution like this makes it easier to add new conversations without having to make sure to set the OnConversationEnd script every time.
Anyways, back to my results:
1. I can signal any event other than EVENT_TYPE_CUSTOM_COMMAND_COMPLETE from within the EVENT_TYPE_AMBIENT_CONTINUE handler and they are processed perfectly no matter how long I wait in conversation mode.
2. If I try to signal an EVENT_TYPE_CUSTOM_COMMAND_COMPLETE event it will either work, or it won't. At first it seemed to depend on how long I waited in conversation mode, (rushing through made it work while waiting made it not work), but after a while it started working and not working randomly no matter how long I spent in conversation mode.
Edit: Signalling a random event from within the EVENT_TYPE_AMBIENT_CONTINUE handler, then having that random event signal a EVENT_TYPE_CUSTOM_COMMAND_COMPLETE also does not work. I've tested this by sending the random event first to the NPC speaker, then when that didn't work, to the Area.
3. I have not been able to pinpoint the exact circumstances, but it has happened multiple times where EVENT_TYPE_AMBIENT_CONTINUE does not fire at the end of a conversation, causing problems in my code because I can't set the local vars. This would also cause problems with the internal ambient behavior system as the NPC speaker would not get the signal to continue his/her behavior. Possible bug?
Modifié par SynysterLyfe, 17 juin 2010 - 05:47 .