• Print

Author Topic: Where is the modules folder?  (Read 5712 times)

0 Members and 1 Guest are viewing this topic.

Offline Stephen304

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 0
Where is the modules folder?
« on: July 15, 2009, 03:58:57 pm »
I know this is a relatively easy question, but there are a lot of folders called modules.

I'm trying to add in my lua file of wire variables but after trying a couple module folders i can't seem to find the right one. Where is the folder i should use?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Where is the modules folder?
« Reply #1 on: July 15, 2009, 04:43:06 pm »
ulx\lua\ulx\modules
Experiencing God's grace one day at a time.

Offline Stephen304

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 0
Re: Where is the modules folder?
« Reply #2 on: July 15, 2009, 05:19:11 pm »
For some reason i see no difference in the menu before i placed the .lua file in there and after i placed the file there.

Is this correct?

Code: [Select]
ulx.addToMenu( ulx.ID_MADMIN, Max Wire Pods :, { max=100, cvar="sbox_maxwire_pods " } )
I have one of those for each variable i added with just the variable and the name changed from line to line. Is that how its supposed to be?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Where is the modules folder?
« Reply #3 on: July 15, 2009, 05:32:21 pm »
Off the top of my head, remove the space between pods and the quote, and you need "Max Wire Pods:" within quotes. Also, watch your console for errors. They'll help.
Experiencing God's grace one day at a time.

Offline Stephen304

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 0
Re: Where is the modules folder?
« Reply #4 on: July 15, 2009, 06:53:06 pm »
Ok i tried that and now every lien in the lua file looks similar to this:

Code: [Select]
ulx.addToMenu( ulx.ID_MADMIN, Max Lights:, { max=100, cvar="sbox_maxlights" } )
And no errors in the server console or the client console. Nothing seems changed at all in the admin menu.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Where is the modules folder?
« Reply #5 on: July 15, 2009, 08:34:09 pm »
and you need "Max Wire Pods:" within quotes.

ulx.addToMenu( ulx.ID_MADMIN, "Name Of Slider", { max=100, cvar="actual name of convar" } )
« Last Edit: July 15, 2009, 08:35:51 pm by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Stephen304

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 0
Re: Where is the modules folder?
« Reply #6 on: July 16, 2009, 10:46:18 am »
Whoops missed that.

Thanks now it works great and everything's in the menu.

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Where is the modules folder?
« Reply #7 on: July 16, 2009, 12:18:26 pm »
Another way you can do this would be:
Code: Lua
  1. Menu_Items = { "Max Wire Pods:" = "sbox_maxwire_pods", "Max Lights:" = "sbox_maxlights" }
  2. for title, command in pairs( Menu_Items ) do
  3.         ulx.addToMenu( ulx.ID_MADMIN, title, { max=100, cvar=command } )
  4. end    
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

  • Print