Author Topic: ULib environment  (Read 1714 times)

0 Members and 1 Guest are viewing this topic.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 802
  • Karma: 58
ULib environment
« on: March 06, 2017, 08:37:32 AM »
Quick question, do you need to be in the ULib environment (lua/ulib/modules...) to use ULib functions/hooks? Such as ULibLocalPlayerReady and ULib.tsay(), etc. etc.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: ULib environment
« Reply #1 on: March 06, 2017, 08:52:27 AM »
No, you can use it from anywhere as long as ULib has been loaded first.

If you're using code that runs as soon as the server starts, you might want to add checks to make sure ULib has loaded before trying to call it or you might get errors. That's why we suggest using the modules folder before it always gets loaded after ULib, but you can use the code anywhere.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 802
  • Karma: 58
Re: ULib environment
« Reply #2 on: March 06, 2017, 08:55:43 AM »
Is there any way to setup a prioritization on which add-ons are loaded first? So that I can make sure mine loads afterwards?
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: ULib environment
« Reply #3 on: March 06, 2017, 11:59:24 AM »
Not really. But you could use some of the ULib callback hooks to load your code that requires ULib after ULib is initialized.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 802
  • Karma: 58
Re: ULib environment
« Reply #4 on: March 07, 2017, 07:44:36 AM »
Ah. I also have another question: how are you able to make it so that it's able to be called from anywhere? I'd like to integrate an addon I'm working on with HandsomeMatt's Pointshop, so how would I go about doing that?
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.