I'm currently trying to override event id 95, EVENT_TYPE_CHAR_RECORD_OPENED, in the single player module_core, with the engineevents M2DA.
I have verified that the event was not getting overridden, and did not get handled by my script at all. It was still passed on to the single player module_core.
I believe it can be one of the two reaons:
1. You cannot override module_core events? Unless you change the single player module property to pass the event to your script first?
2. The events.xls file did not have event id 95. I had to create the entry. Could this be the problem?
Any help regarding this would be greartly appreciated. I should add that, in the same addin module, other event overrides (of player_core and rules_core) are working, just not this one.
Overriding single player module_core events?
Débuté par
SuperD-710
, janv. 02 2010 12:53
#1
Posté 02 janvier 2010 - 12:53
#2
Posté 02 janvier 2010 - 01:12
Yep, you cannot override this event.
You cannot override events handle by scripts in folder named "Core Scripts". (not "_Core Scripts").
Solution 1) You can export a local copy of module_core, make your modification and save it
Solution 2) If your mod is a standalone module, you can creature your own module_core file and associate it to your module.
Solution 3) If your mod is not a standalone module, you have to replace the module_core associated to the current module with the one you want (a copy of module_core with you modifications).
I don't have any idea if you can change the event script of a module "like this", but the function SetEventScript may help you :
SetEventScript(GetModule(), R"my_module_core");
You cannot override events handle by scripts in folder named "Core Scripts". (not "_Core Scripts").
Solution 1) You can export a local copy of module_core, make your modification and save it
Solution 2) If your mod is a standalone module, you can creature your own module_core file and associate it to your module.
Solution 3) If your mod is not a standalone module, you have to replace the module_core associated to the current module with the one you want (a copy of module_core with you modifications).
I don't have any idea if you can change the event script of a module "like this", but the function SetEventScript may help you :
SetEventScript(GetModule(), R"my_module_core");
Modifié par anakin5, 02 janvier 2010 - 01:14 .
#3
Posté 02 janvier 2010 - 01:18
Thanks for the help Anakin. Still eagerly waiting for AT2.7 btw 
*Sigh* Guess I will have to override module_core directly. I only want to handle that event, and changing the single player module event handle looks like it would cause more problems and have even worse compatibilities than overriding the ncs directly
*Sigh* Guess I will have to override module_core directly. I only want to handle that event, and changing the single player module event handle looks like it would cause more problems and have even worse compatibilities than overriding the ncs directly
#4
Posté 02 janvier 2010 - 01:34
oh, I missed the solution 4) which is the right one.
Create a file my_module_core which handle only EVENT_TYPE_CHAR_RECORD_OPENED and associate it to your module.
Do not call HandleEvent at the end of this script.
It should work (I read this somewhere on this forum)
Create a file my_module_core which handle only EVENT_TYPE_CHAR_RECORD_OPENED and associate it to your module.
Do not call HandleEvent at the end of this script.
It should work (I read this somewhere on this forum)
Modifié par anakin5, 02 janvier 2010 - 01:35 .
#5
Posté 02 janvier 2010 - 06:29
Thanks a lot! Works like a charm





Retour en haut






