WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Crashing to desktop. Clueless. (https://www.wowinterface.com/forums/showthread.php?t=2710)

Mokaikai 12-22-05 08:00 AM

Crashing to desktop. Clueless.
 
So a long time ago I created a mod based off dodgeding. Real simple mod. However recently I wanted to make it friendly for classes other than hunter. The basic premise is When a hunter dodges or parries they get a screen splash and audio signal they need to active mongoose bite or counter attack respectively. Since i was going through the steps to ensure it did nothing for other classes. I decided to add in functionality for warriors with overpower and rogues with disarm. However now this incredibly simple mod crashes to desktop whenever its triggered by event. I can't see why or how its not a very complex mod.

Any help would be greatly appreciated.

LUA script :

Code:

function MM_OnLoad()
        this:RegisterEvent("UNIT_COMBAT")
end

function MM_OnEvent(event)
        local playerClass, englishClass = UnitClass("player")
        if ( playerClass == "Hunter" ) then
                if (( event=="UNIT_COMBAT" ) and ( arg1=="player" ) and ( arg2=="DODGE" )) then
                        PlaySoundFile("interface\\addons\\mongoosemania\\waves\\dodge.wav")
                        MMMsgFrame:AddMessage(format("Mongoose Bite!"), 1, 1, 0, 1, 2)
                elseif (( event=="UNIT_COMBAT" ) and ( arg1=="player" ) and ( arg2=="PARRY" )) then
                        PlaySoundFile("interface\\addons\\mongoosemania\\waves\\parry.wav")
                        MMMsgFrame:AddMessage(format("Counter Attack!"), 1, 1, 0, 1, 2)
                end
        end
        if ( playerClass == "Warrior" ) then
                if (( event=="UNIT_COMBAT" ) and ( arg1=="target" ) and ( arg2=="DODGE" )) then
                        PlaySoundFile("interface\\addons\\mongoosemania\\waves\\dodge.wav")
                        MMMsgFrame:AddMessage(format("Overpower!"), 1, 1, 0, 1, 2)
                end
        end
        if ( playerClass == "Rogue" ) then
                if (( event=="UNIT_COMBAT" ) and ( arg1=="target" ) and ( arg2=="PARRY" )) then
                        PlaySoundFile("interface\\addons\\mongoosemania\\waves\\parry.wav")
                        MMMsgFrame:AddMessage(format("Disarm!"), 1, 1, 0, 1, 2)
                end
        end
end

XML file :


Code:

<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
        <Script file="MongooseMania.lua"/>
        <Frame name="MMAudioFrame">
                <Scripts>
                        <OnLoad>
                                MM_OnLoad()
                        </OnLoad>                       
                </Scripts>
        </Frame>
        <MessageFrame name="MMMsgFrame" insertMode="TOP" parent="UIParent" frameStrata="LOW" toplevel="true">
              <Size>
                        <AbsDimension x="512" y="60"/>
                </Size>
                <Anchors>
                                <Anchor point="CENTER">
                                        <Offset>
                                                <AbsDimension x="0" y="0"/>
                                        </Offset>
                                </Anchor>
                        </Anchors>
                        <Scripts>
                                <OnLoad>
                                        MM_OnLoad()
                                </OnLoad>
                                <OnEvent>
                                        MM_OnEvent(event, arg1, arg2)
                                </OnEvent>
                        </Scripts>               
                <FontString inherits="GameFontNormalHuge" justifyH="CENTER"/>
        </MessageFrame>       
</Ui>

WOW error:

Quote:

This application has encountered a critical error:

ERROR #132 (0x85100084) Fatal Exception
Program: C:\Program Files\World of Warcraft\WoW.exe
Exception: 0xC0000005 (ACCESS_VIOLATION) at 001B:00739967

The instruction at "0x00739967" referenced memory at "0xFFFFFFFC".
The memory could not be "read".

Mokaikai 12-22-05 08:33 AM

OK I managed to fix the crashing problem. Something silly about using onload twice in the XML "Who knew" ;) . Now however it causes a hell of a memory leak when its running. the UI memory usages creeps up by .01 per tick and does not stop until you leave combat. I'm sure no one will thank me for hitting thier garbage collector in the middle of a huge fight.

Thoughts?


All times are GMT -6. The time now is 07:24 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI