Author Topic: How to make a ULX convar  (Read 2122 times)

0 Members and 1 Guest are viewing this topic.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
How to make a ULX convar
« on: April 02, 2015, 05:59:23 AM »
Ok so i searched the website for "make convar" and found nothing... how would i make a convar like ulx_votekickSuccessratio

What file would i put this in so i can make a convar like ulx_voterestartSuccessratio

Thanks!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: How to make a ULX convar
« Reply #1 on: April 03, 2015, 07:51:23 PM »
https://github.com/Nayruden/Ulysses/blob/a72cb4dfc6a91c25d53baf7bd59da0f06caa5553/ulx/lua/ulx/base.lua#L21
ulx.convar
You can also search the repo for various convars in our code to find out how we set them.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: How to make a ULX convar
« Reply #2 on: April 03, 2015, 09:22:28 PM »
I must be blind... I never realized you could search the repository on github until now.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: How to make a ULX convar
« Reply #3 on: April 04, 2015, 11:59:06 AM »
It's a pain to search sometimes because it strips punctuation like periods and other common non-alphanumeric characters, which comprise a huge chunk of variable and function names in almost any code, not just Lua.
But, it's better than trying to find just the needle in the haystack.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming