Garry's Mod
84 voti
Light Break
   
Premio
Aggiungi ai preferiti
Preferito
Rimuovi dai preferiti
Content Type: Addon
Addon Type: Tool
Addon Tags: Scenic, Realism
Dimensioni del file
Pubblicato in data
Aggiornato in data
569.752 KB
9 gen 2022, ore 20:13
9 gen 2022, ore 21:48
2 note di rilascio ( visualizza )

Sottoscrivi per scaricare
Light Break

Descrizione
The closest approximation to breakable lights in this dinosaur of an engine
Either no one did this before or did it better but it never saw the light of day, but here's an attempt at making lights breakable. Not exactly breakable per se, but only an illusion by using entities (shootable_light especifically) and firing TurnOn/TurnOff inputs.

To make lights breakable, just type shootlight_setup in console and it'll set it up for you

Features
  • Hammer lights (light, light_dynamic and light_spot) can now be made breakable!
  • Gmod lights and lamps are also breakable!
  • Like... 8 convars
  • A lightweight map for testing the addon (light_break_testmap.bsp)
  • Future : Developer config file to add support for custom light entities

Problems (Developer Gobbledigook)
I didn't do this with some kind of super deep academic research mindset for other developers to solve these problems, but here are some (not necessarily bugs) that I encountered during the making of this :

  • If a map's light entity isn't dynamic and it isn't named, it won't register in the server's entity list, which means you can't fetch it through ents.GetAll(). Here's the doozy : Every. Single. ♥♥♥♥♥♥♥. Map. has 1 or 2 named lights at best and the rest is unnamed. Of course this is for peformance reasons, but it makes the addon nearly pointless unless a dark map with manually spawned lights or a custom suited map is used.
  • There is almost no way to circumvent these unregistered lights through scripts. I tried engine.LightStyle() but that messes up the whole map and most of the time doesn't work.

    I can only imagine being able to make a fully fledged breakable light system by abusing the absolute hell out of the render library or just straight up building a new engine

ConVars
If you forget what a convar does or was, just type its name and it will show you its helptext/default value

  • shootlight_mapents : Defines if light entities from the map (light, light_dynamic, etc) should be breakable
  • shootlight_ent_alpha : Defines shootable_light's visibility
  • shootlight_removeonbreak : Removes the shootable_light entity when the light breaks, not recommended unless peformance is bad (Make sure to refresh the map's lights with a cleanup/save if it was off and you turned it on again)
  • shootlight_ent_scale : Defines shootable_light's scale
  • shootlight_ent_model : Defines shootable_light's model
  • shootlight_ent_material : Defines shootable_light's material
  • shootlight_ent_hp : Defines shootable_light's minimum and maximum health, format : <min>,<max>
  • shootlight_debughalo : (DEBUG) Creates a blue halo around a shootable_light, admin-only (REQUIRES RESTART!)


Console Commands
  • shootlight_setup <arg1> : (Used in the video at the start) Creates shootable_light entities and connects them to compatible light entities, aka, makes them breakable. The optional first argument (arg1) can be either
    • clean : Only cleans up every shootable_light entity on the map
    • noclean : Creates shootable_light entities without cleaning existing ones first (Not recommended)
    Leaving arg1 blank will clean the map of shootable_lights and fill it up again with new ones

How long did this take you to do...?
One whole sunday :(

Credits
Code -Me
Map -Me
Discussioni più popolari Visualizza tutte (1)
2
24 gen 2022, ore 16:21
IN EVIDENZA: Bugs and Suggestions
SubwayJared
11 commenti
dommygutman 2 mag 2023, ore 7:21 
What are the supported maps?
wizard with a gun 22 dic 2022, ore 18:20 
aha, now i can make (almost) accurate rush
36R49 13 dic 2022, ore 1:59 
its okey, but steel thank you
SubwayJared  [autore] 12 dic 2022, ore 18:16 
@36R49 The problem is the Source Engine doesn't support the disabling of lights, especially static lights which are commonplace in 99% of maps. Sorry!
36R49 6 dic 2022, ore 4:45 
can you made tool what will be desable light on map or somthing close for that???
Marcus 23 ago 2022, ore 13:49 
Smooth gameplay
Kiralex 1 mar 2022, ore 11:25 
Niiiice
ඞ amogus ඞ 22 gen 2022, ore 3:31 
weird how N64 games had breakable lights.
hawky_ 15 gen 2022, ore 22:59 
showcase goes 1 fps
Yavuzhan 15 gen 2022, ore 10:45 
Not bad. Good job mate!