Does anyone know of a function that is called straight after a loading screen is disabled. I tried hooking the end of LoadingScreenDisable but that function doesn't seem to actually remove the loading screen.
Does anyone know of a function that is called straight after a loading screen is disabled. I tried hooking the end of LoadingScreenDisable but that function doesn't seem to actually remove the loading screen.
Can't give you an example function because I'm not at home, but you could call ClntObjMgrGetActivePlayerObj() in your pulse function and check if the ptr changed from zero to non zero. Also WoW should add some console lines after the loading screen (not 100% sure about this),so you can compare the strings or check where the call came from.
Last edited by culino2; 08-19-2013 at 05:30 PM.
CGGameUI::EnterWorld is called when the loading is done and the object manager is in a correct state (although sometimes the loading screen will still be up for a couple of seconds).
Thanks for the reply but ClntObjMgrGetActivePlayerObj() doesn't do the trick, I should have mentioned that I've tried this before. CGPlayer_C__Initialize() is called before the loading screen is made invisible so the player object will be non zero before the loading screen is removed. Also, using the global that is set in LoadingScreenDisable (I believe people call it IsLoadingOrConnecting) is also not a very accurate way to tell if a loading screen is active because the loading screen will still be active very shortly after IsLoadingOrConnecting is set to 0 (no loading screen active).
It is those few seconds or even milliseconds in some cases that are causing the trouble for me. The functions I am trying to call must be done outside a loading screen or the game will crash, I had actually tried using that function as well earlier today with no success.
What function do you want to call?![]()
I was trying to get my morph program to support persisting through loading screens but whenever I set the player or mount display id during a loading screen the game will crash once the loading screen ends for some reason. It works fine outside of a loading screen. A few patches ago I found the functions that reset the mount and player display ids during a loading screen and hooking those functions did exactly what I needed so I may just have to go looking for those again.
Last edited by oldmanofmen; 08-20-2013 at 05:41 AM.
If you just want persistence why don't you hook UpdateDisplayInfo/OnMountDisplayChanged ... That way you won't have any competition from game trying to override your displayIDs.
Check if "this" unitPtr in ecx is activeplayer ptr and have some flag global var indicating whether you initiated the change.
Yep, just tested, hooking that functions only persist through in-zone load screens like from /reload, not ones like change of continent.
Well it's logical that functions don't help in this case as models aren't updated but initiated/instantiated... You could probably memory-bp displayID and find out culprit writer function, but there's simpler way
I looked for some nice event that would work, tried PLAYER_ENTER_WORLD but that gets overwritten if you do displayID change at that time, then there's "WORLD_MAP_UPDATE"...
Since i expose morph functions to WoW lua i just do
You probably hook FrameScript_SignalEvent and find out the spot where it's called with param, EVENT_WORLD_MAP_UPDATE = 0x166, may not be up to date with retail but getting eventID isn't that hard. That's your spot where you can safely call displayID functions and not only they won't crash but will override displayIDs.Code:if myMorphFrame==nil then myMorphFrame=CreateFrame("Frame"); end; function myMorphEventHandler() SetUnitDisplayID("player",20318) SetUnitMountDisplayID("player",17890) end myMorphFrame:RegisterEvent("WORLD_MAP_UPDATE") myMorphFrame:SetScript("OnEvent", myMorphEventHandler)