• Print

Author Topic: ulx module/ulx help  (Read 17910 times)

0 Members and 1 Guest are viewing this topic.

Offline lampman13

  • Jr. Member
  • **
  • Posts: 71
  • Karma: -10
ulx module/ulx help
« on: February 23, 2014, 07:36:45 am »
ok so i love ulx it makes the server so easy to manage but there are some things that i want to add and stuff like that but i dont know how to make something work as a ulx module i know how to code but not sure how to do anything out side of lua\autorun\client. if anyone could send me a very simple module to kind of look at so i understand or just explain that'd be great

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ulx module/ulx help
« Reply #1 on: February 23, 2014, 08:04:12 am »
See the first three posts, which are pinned/sticky to never move from top of the section, of our Developers corner forum area.
One of them is a ULib documentation site, explaining the command input checks that can be used.
You may find the (several years now) old vs new ULX command structure comparison that I wrote of some use too.
(Look for bold 'New stuff here' section that is really most relevant now) - /index.php/topic,4464.0.html#msg17838 />
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline lampman13

  • Jr. Member
  • **
  • Posts: 71
  • Karma: -10
Re: ulx module/ulx help
« Reply #2 on: February 23, 2014, 08:06:16 am »
ok but how do i make it a module just make a lua file and code it with ulx stuff and put it in the modules.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ulx module/ulx help
« Reply #3 on: February 23, 2014, 08:17:27 am »
/addons/<your_addon_name>/lua/ulx/modules/<root||cl||sh>/<your_file(s)>.lua
/addons/<your_addon_name>/addon.txt
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline lampman13

  • Jr. Member
  • **
  • Posts: 71
  • Karma: -10
Re: ulx module/ulx help
« Reply #4 on: February 23, 2014, 09:01:53 am »
what do i do with that sorry im a noob :P

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: ulx module/ulx help
« Reply #5 on: February 23, 2014, 09:15:46 am »
 :-\ That's the file path...
Out of the Garry's Mod business.

Offline lampman13

  • Jr. Member
  • **
  • Posts: 71
  • Karma: -10
Re: ulx module/ulx help
« Reply #6 on: February 23, 2014, 11:18:32 am »
haha lol im a noob

Offline lampman13

  • Jr. Member
  • **
  • Posts: 71
  • Karma: -10
Re: ulx module/ulx help
« Reply #7 on: February 24, 2014, 03:56:23 pm »
uhm i dont really understand the server|client|root thing in the first path

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ulx module/ulx help
« Reply #8 on: February 24, 2014, 04:31:33 pm »
You said you know how to code, so I figured you'd know code short hand.
In that example, <> = variable and || = OR
/addons/<your_addon_name>/lua/ulx/modules/<your_file(s)>.lua
OR
/addons/<your_addon_name>/lua/ulx/modules/cl/<your_file(s)>.lua
OR
/addons/<your_addon_name>/lua/ulx/modules/sh/<your_file(s)>.lua
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline lampman13

  • Jr. Member
  • **
  • Posts: 71
  • Karma: -10
Re: ulx module/ulx help
« Reply #9 on: February 24, 2014, 05:09:43 pm »
yeah sorry i know coding but im still kinda new so probably shoulda specified :P so i need 2 dir one ulx and the other my addon?

Offline lampman13

  • Jr. Member
  • **
  • Posts: 71
  • Karma: -10
Re: ulx module/ulx help
« Reply #10 on: February 24, 2014, 05:12:14 pm »
wait lol i think i got it if not i will come back :P but why doesnt this work
Code: Lua
  1.         TextEntry.OnEnter = function()
  2.                 chat.AddText( Color( 0, 255, 0 ), "(ADMIN)", Color( 0, 255, 0 ), ..TextEntry:GetText )
  3.                 chat.PlaySound()
  4.                 BackGround:SetVisible()
  5.         end

Offline lampman13

  • Jr. Member
  • **
  • Posts: 71
  • Karma: -10
Re: ulx module/ulx help
« Reply #11 on: February 24, 2014, 05:24:46 pm »
i get this error
[ERROR] addons/ucast/lua/autorun/client/menu.lua:24: unexpected symbol near '..'
  1. unknown - addons/ucast/lua/autorun/client/menu.lua:0


Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: ulx module/ulx help
« Reply #12 on: February 24, 2014, 07:14:52 pm »
i get this error
[ERROR] addons/ucast/lua/autorun/client/menu.lua:24: unexpected symbol near '..'
  1. unknown - addons/ucast/lua/autorun/client/menu.lua:0


Pretty sure you have an extra comma near the string concentrator- try getting rid of either it or the string concentrator (..), in that order.
bw81@ulysses-forums ~ % whoami
Homepage

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ulx module/ulx help
« Reply #13 on: February 24, 2014, 07:43:34 pm »
lampman, every error you've ever posted gives you the reason, and line number, for where/why the error is happening.
While learning Lua for Gmod, you should also learn how to read the error messages.

We're also going far past 'help for ULib and ulx', and into 'how do I ... <any code question you can think of with only 1% related to Ulib or ULX>?', so I'm moving this thread to developers corner.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: ulx module/ulx help
« Reply #14 on: February 24, 2014, 08:34:40 pm »
Pretty sure you have an extra comma near the string concentrator- try getting rid of either it or the string concentrator (..), in that order.
You really should stop replying to these things, it's pretty clear that you don't know what you're talking about. He has a .. where he doesn't need one. The comma stays because it's chat.AddText and that's how chat.AddText works.

  • Print