Ulysses

Ulysses Stuff => Releases => Ulysses Release Archives => Topic started by: DrTight on March 25, 2009, 11:37:22 AM

Title: Automatic Votemap
Post by: DrTight on March 25, 2009, 11:37:22 AM
This is my full automatic votemap system.
You can add maps to a pool which are used for votes.
(http://www.garrysmod.org/img/?t=dll&id=65287) (http://www.garrysmod.org/downloads/?a=view&id=65287)

Its very usefull, if you want a mapcycle where the players can choose the nextmap.
It works like the Metamod addon for TF2 or Css

Ulx is required to run this module.
Extract the lua to your ulx/lua/modules folder and extract the mapcycle.txt to your data folder.
Restart the server.

Have fun
DrTight
Title: Re: Automatic Votemap
Post by: benbrooks on March 27, 2009, 02:40:56 PM
When you say 'ulx/lua/modules', well, There isn't one.

There are however these;

'ulx/lua/ULib/modules'
'ulx/lua/ulx/modules'

I suspect that it's ulx, since that's where most of the other 'plugins' are like fun commands and stuff. Just thought i'd let you know ;)
Title: Re: Automatic Votemap
Post by: DrTight on March 27, 2009, 03:49:12 PM
Oh sry, i forgot, its ulx/modules :D
Title: Re: Automatic Votemap
Post by: BBgamer on May 15, 2009, 02:00:30 PM
Thankyou, perfect for my Gjail server! Now i can have votes to change to ba_jail_mars or ba_jail_v4!
Title: Autovotemap Error
Post by: DeimosTK on March 19, 2010, 08:31:24 PM
Last week, DrTight's Automapvote script was working fine and dandy in my server on an older version of ULX. I recently decided to update to the SVN version, so the automapvote script similarly decided to not work anymore. It's giving the following error:
Code: [Select]
Warning: vgui.Create failed to create the VGUI component (DFrame)
ulx/modules/cl/cl_automapvote.lua:37: attempt to index local 'main' (a nil value)

This is the piece of code in question:
Code: [Select]
local function PaintClockFrame()
local main = vgui.Create( "DFrame" )
main:SetSize(250,60)
main:SetPos(ScrW() /2 - (main:GetWide() /2),ScrH() - main:GetTall())
main:ShowCloseButton(false)
main:SetDraggable(false)
main:SetTitle("")
main:ShowCloseButton(false)

function main:Paint()
local str = timeToStr(timeleft)
local nxtmp = "Next Map: "..nextmap
local votestr = "Changing in: "..str
if !votedone then
nxtmp = "Current Map: "..nextmap
votestr = "Next Vote: "..str
end
local h,w = main:GetWide(), main:GetTall()
surface.SetDrawColor( 255, 255, 255, 120 )
surface.DrawRect( 1, 1,h-1 ,w-1)
surface.SetDrawColor( 100, 100, 255, 240 )
surface.DrawOutlinedRect( 0,0,h,w )
draw.SimpleText(votestr,"ScoreboardText",10,5,Color(100,0,0,200))
draw.SimpleText("Votes Left: "..votesleft,"ScoreboardText",10,20,Color(0,0,0,200))
draw.SimpleText(nxtmp,"ScoreboardText",10,35,Color(0,0,0,200))
end
return main
end


Now seeing as the script itself was unchanged, it's also entirely possible that I simply put the files in the wrong folders after updating ULX. They're in the following locations:
Code: [Select]
garrysmod/addons/ulx/lua/ulx/modules/sv_automapvote.lua
garrysmod/addons/ulx/lua/ulx/modules/cl/cl_automapvote.lua

Anyone have any ideas?
Title: Re: Automatic Votemap
Post by: JamminR on March 19, 2010, 09:47:06 PM
1) It's possible the original code isn't compatible with SVN.
Much of SVN of ULib and it's module ULX command structure has been rewritten. Imagine the differences between Windows XP and Windows 7... many things can be converted, but, they have to be converted.

2) Your comment of location.
Extract the lua to your ulx/lua/modules folder and extract the mapcycle.txt to your data folder.
No idea how to set up mapcycle.txt, as I can't see his original code, but it would go in gmod/data
So;
gmod/data/mapcycle.txt
gmod/addons/ulx/lua/ulx/modules/cl_automapvote.lua
gmod/addons/ulx/lua/ulx/modules/sv_automapvote.lua
Would be your best bet

Again though, even some file structure of ULX has changed in SVN.
Title: Re: Automatic Votemap
Post by: Megiddo on March 19, 2010, 10:25:05 PM
What line is line 37?
Title: Re: Automatic Votemap
Post by: DeimosTK on March 20, 2010, 12:47:34 AM
gmod/addons/ulx/lua/ulx/modules/cl_automapvote.lua
So cl_ goes into the main modules folder instead of the modules/cl/ one?

What line is line 37?
Code: [Select]
36  local main = vgui.Create( "DFrame" )
37 main:SetSize(250,60)
38 main:SetPos(ScrW() /2 - (main:GetWide() /2),ScrH() - main:GetTall())
39 main:ShowCloseButton(false)
40 main:SetDraggable(false)
41 main:SetTitle("")
42 main:ShowCloseButton(false)
It's the main.SetSize one immediately after main is set up
Title: Re: Automatic Votemap
Post by: Megiddo on March 20, 2010, 12:04:59 PM
Do you still have the derma folder under addons? It looks like derma is completely broken for you.
Title: Re: Automatic Votemap
Post by: DeimosTK on March 20, 2010, 01:31:39 PM
Nope, derma is still there, and other plugins utilizing vgui (UTime, UMaps) are working fine :[
Title: Re: Automatic Votemap
Post by: Megiddo on March 20, 2010, 03:04:04 PM
Don't know about UMaps, but I'm fairly certain that UTime doesn't use derma. Does the file "garrysmod\addons\derma\lua\vgui\dframe.lua" exist?
Title: Re: Automatic Votemap
Post by: DeimosTK on March 21, 2010, 12:33:39 AM
Oh my mistake, I guess I was confusing vgui with derma. And yes, that "dframe.lua" file is there.
Title: Re: Automatic Votemap
Post by: PowerHouse on August 28, 2010, 02:08:37 PM
Is this discontinued? Because the link renders a "File not Found" error.
Title: Re: Automatic Votemap
Post by: JamminR on August 28, 2010, 04:32:12 PM
Most likely.

DrTight -
Last Active:
    April 04, 2009, 11:13:16 AM

Next release of ULib (and ULX) is coming soon.
Might be a good project for those learning Glua and Ulib to convert to current Glua and ULib code structures.