Thread Tools Display Modes
12-22-05, 08:00 AM   #1
Mokaikai
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 5
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:

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".

Last edited by Mokaikai : 12-22-05 at 08:03 AM. Reason: Included wow error.
  Reply With Quote
12-22-05, 08:33 AM   #2
Mokaikai
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 5
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?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Crashing to desktop. Clueless.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off