Welcome, Guest. Please login or register.
Did you miss your activation email?
November 23, 2024, 05:14:33 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Lua error when using the DNA scanner
Pages: [1]
Author Topic: Lua error when using the DNA scanner  (Read 7197 times)
AtomicSpark
Poster

Posts: 5


« on: August 14, 2010, 05:22:56 AM »

When I open up the detectives DNA scanner, I get the following error in console:
weapons\weapon_ttt_wtester\shared.lua:556: attempt to call method 'LabelAsPercentage' (a nil value)


This causes the detective to not be able to close the DNA scanner's window. Has anyone else experienced this problem?

The only other addons I am using are the SVN version of ULX, ULib, and XGUI (the new menu for ULX).

I have ScriptEnforcer enabled and do not see any errors in the server console. I'm also using sv_downloadurl, but I know that's configured properly (or the gamemode wouldn't even load). This server is also running on Linux, which causes issues with file paths that have capital letters in it, but I do not believe this is the cause of the problem for this gamemode.

And yes, I've updated Garry's Mod using -verify_all.

Thanks for the help!
Raziaar
Poster

Posts: 3


Cow God


« Reply #1 on: August 14, 2010, 05:35:24 AM »

Yeah, I can't wait until we get this fixed. The one hurdle holding back the hl2.net server.


Also... were the zombie master forum accounts purged at some point? I used to have an account here, but no longer. Weird.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #2 on: August 14, 2010, 08:42:30 AM »

Could you try using this build:
http://dl.dropbox.com/u/79559/terrortown_v9hg639.zip

The file path issue makes me uneasy, but I agree it's unlikely to be the cause here. The only filename capitalisation is in scripts for interface elements, with which the server's only involvement is packing them into the Lua datapack that is sent to clients. Similar files included with GMod (and some in TTT) use it as well and those clearly work, or you'd be looking at far worse errors. There are no cases of the code referencing a lowercase filename while the actual filename is capitalised.

What I think is the issue here is a naming collision between interface elements. Why it would only manifest when playing on your server (or linux servers in general) I don't know, perhaps the datapack is packed differently resulting in a different load order of scripts... Either way, in the build linked above I've renamed things to avoid it. If problems persist, we'll get into the file capitalisation business.

One last thing: with this new build, the directory structure has changed. You may have to copy the contents of /gamemodes/terrortown/content/ to the sv_downloadurl server's /garrysmod/ directory for fastdl to work.
« Last Edit: August 14, 2010, 08:50:19 AM by Bad King Urgrain »
AtomicSpark
Poster

Posts: 5


« Reply #3 on: August 14, 2010, 10:25:34 PM »

The ULX devs had a similar issue. The function file.FindInLua() does not return files in alphabetical order on Linux (or Garry's implementation of). This unpredictable behavior caused a lot of issues for them at init time.

Rumor has it that in Garry's ProgressBar.lua, "LabelAsPecentage" is spelled incorrectly. Might want to look into that too.

Also, XGUI (the new menu for ULX) does use Garry's progress bar, which for some reason was being blocked by SE. The workaround they used is below:
--This is for servers with scriptenforcer enabled.
--It will force scriptenforcer to allow these files to be included on the client where they weren't included by default.
AddCSLuaFile( "menu/progressbar.lua" )
AddCSLuaFile( "sandbox/gamemode/spawnmenu/controls/CtrlColor.lua" )


I'm going to temporarily remove the XGUI addon to see if this is causing our issues.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #4 on: August 14, 2010, 10:38:25 PM »

Rumor has it that in Garry's ProgressBar.lua, "LabelAsPecentage" is spelled incorrectly. Might want to look into that too.

I know, it's an important reason why I copied out his progress bar to a script in TTT so I could meddle with it.

In the .zip I posted, no TTT code uses Garry's progress bar. All use my replacement. They were always supposed to, but because of the naming collision they used Garry's. Because I call the properly spelled LabelAsPercentage, this caused the errors.

So if you use that build, Garry's progress bar getting blocked or not will be irrelevant.
AtomicSpark
Poster

Posts: 5


« Reply #5 on: August 15, 2010, 01:15:11 AM »

Threw up that dev version on my dev server (ha) and it seems to work. The detective was able to open the DNA Scanner, scan a sample, and close the window (which was the issue).

Progress! :D

Unrelated note, the player who was the detective got the following error on the start of the next round:
entities\ttt_hat_deerstalker\shared.lua:102: bad argument #2 to '?' (Vector expected, got nil)
« Last Edit: August 15, 2010, 01:20:39 AM by AtomicSpark »
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #6 on: August 15, 2010, 01:33:01 AM »

Hat huh? That sounds like custom content.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
AtomicSpark
Poster

Posts: 5


« Reply #7 on: August 15, 2010, 01:34:04 AM »

Or new content.
Charles445
Build Tester
*
Posts: 2338


I LOVE THIS AVATAR


« Reply #8 on: August 15, 2010, 01:36:23 AM »

Or sideways error content.

del>Ok, so Bad King, you are just going to wait for Garry to fix?
What an idiotic thing to ask. Dammit weed.

Bookcases, Bookcases Everywhere
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #9 on: August 15, 2010, 01:42:05 AM »

Or new content.


I don't think that came with TTT so you won't get much help with custom content errors unless you pastebin it's code.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
AtomicSpark
Poster

Posts: 5


« Reply #10 on: August 15, 2010, 01:46:05 AM »

It was included with the terrortown v9 dev download Bad King Urgrain posted. It has nothing to do with my original problem/thread though. I was just giving him a heads up.
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #11 on: August 15, 2010, 01:51:35 AM »

Okay, guess it's some dev thing he's working on then. A hat for detectives? Damn man, you can do better than that BKU :p

But I imagine that error is because it can't find the player as detective afterwards (round new) and spits out an ugly error, won't know until j actually check on my machine, I'm on my iPod at 3am on the forums, dedication! Now off to bed for me.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #12 on: August 15, 2010, 08:45:08 AM »

No, the error was because a function for querying the position of a bone of a model can randomly return null (Source engine rulez). I've fixed it since, but the build I put up doesn't have that yet.

There's a few options to fix it:
1. Set ttt_detective_hats 0, until the next gmod update comes out and gives you the final v9.
2. Grab the latest version the gmod svn.
3. Make me put up a newer .zip for you (by asking).
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Lua error when using the DNA scanner « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.011 seconds with 17 queries.