Team Spartan Cookies & Milk Forums
Modbridge Light Changer Lib(MLCL) - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Starfall (https://teamscm.co.uk/forum-7.html)
+--- Thread: Modbridge Light Changer Lib(MLCL) (/thread-2014.html)



Modbridge Light Changer Lib(MLCL) - TheOneAndOnlyTee - 02-11-2016

This isn't meant for non-coders, so do not expect this to do anything on it's own.

What is this?
This is a lib you can include that contains some handy functions for changing the lights submaterials in the modbridge corridor props on the ship that the chip running this is on.
It's rather easy to use at the downside that it only works for the lights on the corridor props and only those on your ship.
Should it encounter an error other than invalid material (atm) it will give you info on what happen and where it came from

oh cool so How can I use this?
before you go running the functions you of course need to add it as a dependency to your code via
--@dependency STEAM_0:1:35990257 t_stuff/MLCL.txt sv

Now that it's included you have access to the following functions;
  1. MLCL.Help() , this will print out the functions much like this section incase you forget.
  2. MLCL.getProps() , this finds the current props attached to the same ship as the chip (note:it will not work if there's more than 600 corridor props).
  3. MLCL.test() , this will do a quick test so you can see if it works provided you've run getProps() first.
  4. MLCL.setProps( material ) , this updates all stored props with the passed material.
  5. MLCL.setProp( entity, material ) , same as above but for the passed prop only. (unknown effect on non-modbridge corridor props)
  6. MLCL.revertProps() , if you've changed the material then this will change it back to the last material.
  7. MLCL.revertProp( entity ) , same as above but for the passed prop only. (unknown effect on non-modbridge corridor props)

Example chip
This is untested because i just wrote it in the browser but it should work just fine.

--@name MLCL Example Usage
--@author T-18
--@dependency STEAM_0:1:35990257 t_stuff/MLCL.txt sv
if SERVER then
MLCL.getProps()
MLCL.setProps( "glow/flash_yellow" )
timer.simple(5,function()
MLCL.revertProps()
end)
end

You need help?
If you need help using this then i'm reluctant to assist because it's really really easy to use so don't be surprised if i just ignore you
but if you're encountering a problem or have a good idea relating to this then i'm all ears.

Lastly @new SF coders, before you go granting someone tool perms to see your code for help be sure they know what they're doing.


RE: Modbridge Light Changer Lib(MLCL) - Red The Blue Color - 02-11-2016

Your mistake goes unnoticed.

[Image: unnoticedmistake.PNG]