Garry's Mod

Garry's Mod

Ei tarpeeksi arvosteluja
ULX Module for Randomat 2.0
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Content Type: Addon
Addon Type: ServerContent
Tiedostokoko
Julkaistu
Päivitetty
28.882 KB
14.5.2020 klo 18.54
26.5. klo 19.59
50 muutosilmoitusta ( näytä )

Tilaa ladataksesi
ULX Module for Randomat 2.0

Kuvaus
Thanks to Dem for the 'Randomat 2.0 ULX Menu' mod which this is an update to.

Edits (and replaces) the original version to support custom added events with little-to-no developer interaction

Chat Commands
!rdmt EventId - Starts an event with the given "EventId".
!srdmt EventId - Safely starts an event with the given "EventId". Will cause a server-side error if the event's conditions are not met.
!clearevent EventId/!stopevent EventId - Stops an event with the given "EventId". Will cause a server-side error if no event with that ID is running.
!clearevents/!stopevents - Stops all active events.
!rdmtnr EventId - Starts an event with the given "EventId" next round.
!srdmtnr EventId - Starts an event with the given "EventId" next round. Will cause a server-side error if the event's conditions are not met.
!clearnr - Clears the event scheduled for the next round, if there is one.

For Developers
This version of the ULX menu takes advantage of the fact that the list of Randomat events is globally available and uses that to add all custom events to the menu. Unfortunately the list of Randomat events does not contain their ConVars so I had to modify the Randomat event meta API slightly to support that.

Custom Event Compatibility
All custom events that work with the Randomat 2.0 will show in the Randomat ULX menu. However, without any code changes the only things available for these custom events will be the Enabled checkbox and the Trigger Event button.

Adding ConVar Support
To add ConVar support to a custom event, the GetConVars meta method must be implemented.
The GetConVars method returns three lists of ConVar information:
1. The list of ConVars which should be configured by a slider control (e.g. number ranges)
2. The list of ConVars which should be configured by a checkbox control (e.g. booleans)
3. The list of ConVars which should be configured by a textbox control

See the README file in the code repository[github.com] for an example of the GetConVars implementation

Special Thanks

Source Code
https://github.com/Malivil/TTT-Randomat-20-ULX
12 kommenttia
Malivil  [tekijä] 21.8.2021 klo 18.25 
Yea, it would use whatever you have "ttt_randomat_event_weight" set to
EnderSlayer366 21.8.2021 klo 18.09 
ok so -1 makes it use the default weight, if you have the default set to something other than 1, like 6 or something, would it do that instead
Malivil  [tekijä] 21.8.2021 klo 17.46 
A weight of -1 on an event makes it use the default weight of 1
EnderSlayer366 21.8.2021 klo 16.25 
What exactly does a weight of -1 do for the events? Does it just make it less likely or does it never happen? Does it do some other thing?
Malivil  [tekijä] 17.3.2021 klo 4.39 
I don't want to do that because some people (myself included) get the latest ULX and install it as a filesystem addon rather than through the workshop.
The Stig 16.3.2021 klo 23.01 
Hey it's been a while, just a small thing this time: Could ULX be added as a required mod? It would make things a little easier when getting others to install this.
Malivil  [tekijä] 26.1.2021 klo 10.42 
The first error is not related to this.

The second error means you don't have a Randomat 2.0 addon installed, or at least not a compatible one.
[KaP] Portres 26.1.2021 klo 10.28 
Yea its really strange but deleting this worked:
[ULib] HTTP failed - ISteamHTTP isn't available!

1. Fetch - lua/includes/modules/http.lua:42
2. fn - lua/ulib/shared/plugin.lua:186
3. unknown - lua/ulib/shared/hook.lua:109


[ULX Module for Randomat 2.0] lua/ulx/xgui/server/sv_randomat.lua:24: attempt to index global 'Randomat' (a nil value)
1. fn - lua/ulx/xgui/server/sv_randomat.lua:24
2. unknown - lua/ulib/shared/hook.lua:109
Malivil  [tekijä] 26.1.2021 klo 10.21 
What error messages?

This is a ULX plugin so it shouldn't affect the gamemode at all.
[KaP] Portres 26.1.2021 klo 9.51 
Broken with TTT2 getting Error messages and gamemode not starting