Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 10 11 12 13 14 … 18 Next »
getmetatable("Entity") and stragateUnstable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
getmetatable("Entity") and stragateUnstable
06-11-2015, 07:04 PM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: getmetatable("Entity") and stragateUnstable
(06-11-2015, 08:28 AM)Yuri6037 Wrote: Hey Person,

I have a few requests about Starfall. The first one would be about a function I found on the original stargate starfall lib on main CAP github : stargateUnstable. Is there any way you can add this function ? For example on my last screen I wanted to make the vortex gl.glCircle red instead of green when the vortex is unstable.
This has now been added as stargate.unstable( Gate ).

(06-11-2015, 08:28 AM)Yuri6037 Wrote: And for the second request well I'm not sure you can do that, what I'd like to have is a getmetatable("Entity"). So, you might ask me why ? And is it realy nessessary ?
Look up GetTypeDef.

(06-11-2015, 08:28 AM)Yuri6037 Wrote: Well to answer the first question, I plan on recreating the wire lib and interface because it's too complex to use.

...

This way I could make ent:GetWirelink():SetInt/SetBool/SetString/SetBin/SetNum/GetInt/GetBool/GetString/GetBin/GetNum
And I could also do ent:GetWirelink():SetOutputListener(OutputName, Callback).
How is the wire library complicated, and how is a dozen different methods for typed get/set better?

Compare what you want to this:
Wirelink.OutputName = OutputValue
local InputValue = Wirelink.Input
A user of the normal wirelinks has to remember only the input/output name, and how to read/write from a table.

Adding a dozen different typed set/get methods is wasteful and akin to this:
function AddStringToTable( Table, Key, String )
assert( type( String ) == "string" )
Table[ Key ] = String
end
function AddIntToTable( Table, Key, Int )
assert( type( Int ) == "number" )
Table[ Key ] = Int
end
-- and so on...
Do you see how silly that is?
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
getmetatable("Entity") and stragateUnstable - by Yuri6037 - 06-11-2015, 08:28 AM
RE: getmetatable("Entity") and stragateUnstable - by Person8880 - 06-11-2015, 07:04 PM
RE: getmetatable("Entity") and stragateUnstable - by Yuri6037 - 06-11-2015, 10:19 PM

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.