Thread Tools Display Modes
07-20-10, 01:44 PM   #1
TrotskyIcepick
A Warpwood Thunder Caller
Join Date: Mar 2010
Posts: 92
KGPanels Vehicle Script not working

Hi All,

I have the following in my kgpanels.lua:

["LOAD"] = "self:RegisterEvent(\"UNIT_ENTERED_VEHICLE");n
self:RegisterEvent(\"UNIT_ENTERING_VEHICLE");n
self:RegisterEvent(\"UNIT_EXITING_VEHICLE");n
self:RegisterEvent(\"UNIT_EXITED_VEHICLE\");",

["EVENT"] = "if (event == \"UNIT_ENTERED_VEHICLE\") then\n
if ( arg1 == \"player\" ) then\n
self.hide = true;\n
end\n
else if ( event == \"UNIT_EXITED_VEHICLE\" ) then\n
if ( arg1 == \"player\" ) then\n
self.show = true;\n
end\n
end\n

When I enter a vehicle, nothing happens. When I added the scripts to the onLoad and onEvent settings for the panel they were accepted as being valid.

Anybody got any ideas as to why this isn't working?

Thanks In Advance.
end"
  Reply With Quote
07-21-10, 06:49 PM   #2
TrotskyIcepick
A Warpwood Thunder Caller
Join Date: Mar 2010
Posts: 92
Tried moving the RegisterEvents to the onEvent setting for the kgpanel but still doesn't work.

Does nobody have any ideas?
  Reply With Quote
07-21-10, 07:06 PM   #3
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
It's just self:Hide() not self.hide = true, self:Show() etc.

Edit: typo, colons not "."

Last edited by suicidalkatt : 07-21-10 at 07:20 PM.
  Reply With Quote
07-22-10, 12:19 PM   #4
TrotskyIcepick
A Warpwood Thunder Caller
Join Date: Mar 2010
Posts: 92
Thanks for that, I'll give it a try tonight ;-)
  Reply With Quote
07-26-10, 05:12 PM   #5
TrotskyIcepick
A Warpwood Thunder Caller
Join Date: Mar 2010
Posts: 92
Originally Posted by suicidalkatt View Post
It's just self:Hide() not self.hide = true, self:Show() etc.

Edit: typo, colons not "."
Nope, that produces the following errors:

Date: 2010-07-27 00:09:27
ID: 2
Error occured in: Global
Count: 1
Message: [string "HUD_OnEvent"] line 11:
attempt to call method 'show' (a nil value)
Debug:
[C]: show()
[string "HUD_OnEvent"]:11:
[string "HUD_OnEvent"]:1

Pretty much the same error occurs on both vehicle entry and exit.
  Reply With Quote
07-26-10, 05:16 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
show is not the same as Show
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-27-10, 10:56 AM   #7
TrotskyIcepick
A Warpwood Thunder Caller
Join Date: Mar 2010
Posts: 92
You are absolutely right....I didn't realise LUA was case sensitive, will try later.

Someone should update the KGPanels website, which is where I got my script from in the first place.

Thanks.
  Reply With Quote
07-27-10, 03:09 PM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
It's also Lua (the Portuguese word for 'moon') and not LUA. But that's a different topic.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » KGPanels Vehicle Script not working

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