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, 10:19 PM,
#3
Yuri6037 Offline
TSCM Member
***
Posts: 216
Threads: 45
Joined: Feb 2015
RE: getmetatable("Entity") and stragateUnstable
(06-11-2015, 07:04 PM)Person8880 Wrote:
(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?

Well it's not as simple I tend on replacing many methods I'm using. All the wire stuff is hardcoded on lanai so I want to redirect to an external lib so things are more clear and more easy for me to understand if I need to read back my code.

The next big step is a large upgrade of how ScreenEngine works and I will surely add the gui support directly in the ScreenEngine. And I think I will add better windowing support to it using my recently upgraded gl lib now implementing a few new functions : glCircle(x, y, angle, radius, quality), glPushMatrix, glPopMatrix, glTranslate and finally glScale (which unfortunately works only on glVertex/glDraw functions)
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:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.