dinhkarate Posted March 30, 2022 Share Posted March 30, 2022 I found this eventannouncer from the original source script/widgets/eventannouncer And I want to change the way it announce when a player dead and ressurrect from this to this but the problem is I caneventannouncer.lua't make it like a mods. I ever tried some way like turn eventannouncer.lua to modmain.lua but it isn't work. Please if you know help me!! Thank so much! Link to comment https://forums.kleientertainment.com/forums/topic/138740-solved-help-with-eventannouncerlua-replacing-the-widgetseventannouncerlua-in-original-source-game/ Share on other sites More sharing options...
Rickzzs Posted March 31, 2022 Share Posted March 31, 2022 it is a mod thing, so maybe better seen in the mod subforum. I think AddClassPostConstruct('widgets/eventannouncer',fn) will help you inject code into this class. Link to comment https://forums.kleientertainment.com/forums/topic/138740-solved-help-with-eventannouncerlua-replacing-the-widgetseventannouncerlua-in-original-source-game/#findComment-1554004 Share on other sites More sharing options...
dinhkarate Posted April 3, 2022 Author Share Posted April 3, 2022 @Mr.Rickzzs I've already solved it but I have the other problem When I created it in the new modmain.lua (nothing inside except 2 line), it will work AddClassPostConstruct("widgets/eventannouncer", function(self) --Now we have access like with AddComponentPostInit("component", fn(self))end) But the problem is, when I combine it into my mod (Character mod) modmain.lua, then it isn't work. I already tried to use modimport Link to comment https://forums.kleientertainment.com/forums/topic/138740-solved-help-with-eventannouncerlua-replacing-the-widgetseventannouncerlua-in-original-source-game/#findComment-1555001 Share on other sites More sharing options...
dinhkarate Posted April 3, 2022 Author Share Posted April 3, 2022 I've tried to use modimport again and it work!!! modimport("scripts/thongbao") Link to comment https://forums.kleientertainment.com/forums/topic/138740-solved-help-with-eventannouncerlua-replacing-the-widgetseventannouncerlua-in-original-source-game/#findComment-1555006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.