Garry's Mod

Garry's Mod

173 ratings
TFL38's Random Events Mod
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Effects
Addon Tags: Fun, Roleplay
File Size
Posted
Updated
54.413 KB
May 25, 2023 @ 4:46am
May 25, 2023 @ 8:38am
3 Change Notes ( view )

Subscribe to download
TFL38's Random Events Mod

Description
READ THE DESCRIPTION TO FIND OUT HOW TO USE AND CUSTOMIZE!!!!!

(again, like my NPC spawner, probably not the most efficent or optimized, but it gets the job done for me.)

Do you want random events like terraria? Or random swarms like DRG? Well, this addon is for you then.
It makes it so at intervals, there's a chance for events to occur, like NPC invasions, Environmental disasters, or even just weird noises and coloration.

IF THE MAP HAS A NAVMESH OR IS FULLY AI NODED, THE NPC SPAWNING FUNCTION WILL WORK!

How to use and customize
It does not have or trigger events randomly by default (for possible server reasons). In order to make your map have random events and to make said events. Go to your addons folder in the Garry's Mod directory:

Create a folder, name it whatever you want.
Inside the folder, create a folder named "lua".
Inside THAT folder, create another folder but named: "tfl38_events".

To create an event, make a folder inside named: "events"
and inside that folder, create a txt and name it whatever you want your event to be named.
set its file type from .txt to .lua

To create a map with events, make a folder inside "tfl38_events" named: "map".
Inside that folder, create a txt file, name it after the map you're targetting (gm_construct for example).
again, set its file type to .lua

To make it so all maps (excluding the ones in the map folder) have events.
Inside the "tfl38_events", make a new txt file called "map_shared".
and change its file type to .lua

What the directories should look like:
garrysmod/addons/YOURMODNAME/lua/tfl38_events/events/EVENTNAME.lua
garrysmod/addons/YOURMODNAME/lua/tfl38_events/map/MAPNAME.lua
garrysmod/addons/YOURMODNAME/lua/tfl38_events/map_shared.lua

Information regarding what to put inside maps lua files is here:
Link to documentation[drive.google.com]

Information regarding what to put inside events lua files is here:
Link to documentation[drive.google.com]

Console Variables (the number is the default value):
events_npc_maxdistance 2000
events_npc_mindistance 100
events_enable 1

Read Variables (these are for other addons to read, otherwise does not change anything):
events_current ""
events_current_stage ""

Console Commands:
events_refresh (This'll reload whatever variables you have set for the map and events. So you do not have to change map whenever you change the values and configuration for the map.)
events_trigger "EVENTNAME" (If you have a valid event or something close to one, it'll force the event. Otherwise it will attempt a random event.)


It is compatible with ulx as well, with it being admin only by default.

ULX Commands:
ulx events_distance 100 2000
ulx events_refresh
ulx events_enable
ulx events_disable
ulx events_trigger


Planned features:
- Ingame customization & saving as txt file
25 Comments
baccabab May 14 @ 7:45am 
doesn tworking
baccabab May 14 @ 6:36am 
in "map" folder in .lua file i need to paste 1 script,
and in folder "events" in the .lua file i need to paste 2 script?
Right?
villenera80 Mar 24 @ 11:07am 
i want a simpler thing like a quick time event randomly
UriahTheWarrior Feb 4 @ 8:04pm 
Lua errors here:[TFL38's Random Events Mod] lua/autorun/tfl_eventshandle.lua:520: attempt to index a nil value
1. TFL38_Event_ChooseEvent - lua/autorun/tfl_eventshandle.lua:520
2. TFL38_Event_BeginEvent - lua/autorun/tfl_eventshandle.lua:557
3. v - lua/autorun/tfl_eventshandle.lua:146
4. unknown - lua/includes/modules/hook.lua:96
djjjj Jan 20 @ 1:18pm 
bruh i have been looking for this kind of mod for a decade
RIP VAN WINKLE Nov 24, 2023 @ 10:58am 
just add a fuckin in game menu i already pretty much spend shit ton of time on configurating other addons same as others and not everyone has the nerves or time to dig in files n shit
faboo978 Jun 26, 2023 @ 8:49am 
i'm honestly just dense, how does this work exactly? are there maps this works with by default, or will i have to do file shenanigans regardless?
Volt Jun 16, 2023 @ 4:04am 
add a menu to customize without having to dig into files
cyclical_thief45 Jun 9, 2023 @ 1:51am 
bro add a ingame customization. Its ok i can wait
CreeperSammyB Jun 1, 2023 @ 7:42pm 
autism mod : )