eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 02:30 AM |
I'm going to put this in the Valkyrie post too, but I figured that people don't actually read the Valkyrie post so making a new post for this might be a good idea. Basically, if you want to make your own libraries then Valkyrie does support it and at some point I want to make a list of trusted 3rd party components and libraries that can be imported safely.
* What does the library do? The library is loaded into the function environment when Valkyrie:LoadLibrary(string Library) is called, wrapping everything to provide seamless modification of default Roblox behaviours
* What is the API? The library should be a modulescript which returns a function, or a single function Said function should take a single argument - The wrapper object. The wrapper object has the current members: - :Override(string Type) -> {:Instance(table Members),__call(table Metamethods)} -> nil | Overrides the metamethods for a type, or members of an Instance class | Examples: | Wrapper:Override "Color3" {__add = function(a,b) return Color3.new(a.r+b.r,a.g+b.g,a.b+b.b) end} | Wrapper:Override "Player":Instance {Kill = function(this) this.Character:BreakJoints() end}
- :OverrideGlobal(string GlobalName) -> function(var Override) -> nil | Replaces the global at GlobalName, retaining unmodified values. | Example: | Wrapper:OverrideGlobal "Vector3" {Zero=Vector3.new(0,0,0)}
- :wrap(var val) -> var WrappedValue | Returns a wrapped version of val. Not really recommended to use manually - :wrapAll(...) -> wrapped ... | Variadic version of :wrap
- :unwrap(var val) -> var UnwrappedValue | Returns an unwrapped version of val, or itself if it's already unwrapped. - :unwrapAll(...) -> unwrapped ... | Variadic version of :unwrap
- :GenExt(function f) -> function Ext | Creates an inverted wrapper of function f, which wraps arguments and unwraps returns
- .ulist | Table containing the unwrap targets for values [key] = target. __mode = 'k' - .wlist | Table containing the wrap targets for values [key] = target. __mode = 'v'
- :mod(var from, var ?to) | Sets wrap and unwrap targets to replace from with to, including nil.
- ._rawConvert | The raw bidirectional convert function, taking (table from, table to, table wrapper, val)
* What's the catch? Any tricks or things to avoid? Don't wrap or unwrap manually unless you know what you're doing - The mod and override methods do most of the wrapping automatically, and the other methods are a little more experimental. GenExt is for functions that reside in modules. Where normal functions go (...) -> unwrap -> f(...) -> wrap, inverted functions go (...) -> wrap -> f(...) -> unwrap, which allows you to keep the seamless behaviour inside of functions exposed to unwrapped environments. Ulist and wlist are wonderful for modifying behaviour if you can understand them. Ever wanted a custom data type that Roblox reads like a Color3? Set the unwrap target for it using ulist, and every time it is unwrapped it will be converted into that value. Very fun, I promise you. Don't use _rawConvert unless you have a very good reason for it. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 25 May 2015 02:32 AM |
| I thought Valkyrie included like cross-server chat and ban and all that, or is this the only stuff so far finished/part of API? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 02:39 AM |
| It will at some point but right now this is the API stuff and libraries are great fun and remarkably useful. Ask gskw; they're using the Design library for the overlay interface. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 06:12 AM |
| Nobody has posted anything in a while so I guess there's a bump due |
|
|
| Report Abuse |
|
|
|
| 25 May 2015 06:19 AM |
| Will valkyri be opensource? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 06:24 AM |
| No, but if you feel like it you can steal everything I need to replicate to the client. That said, I'd appreciate you don't steal the stuff I replicate to the client, because it's not really going to work very well without the Valkyrie server core. |
|
|
| Report Abuse |
|
|
|
| 25 May 2015 08:15 AM |
| Heh. Sorry. But I didn't really catch on this valkyrie stuff... What is it? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 08:22 AM |
http://www.roblox.com/Forum/ShowPost.aspx?PostID=157078247
I wanted to change the way that games were developed and connected by offering a uniform solution for it. I also wanted to let developers take less time messing with solutions by giving them libraries and a framework for modifying behaviours. |
|
|
| Report Abuse |
|
|
|
| 25 May 2015 08:29 AM |
| well. If you have any ideas on needed libraries I'm willing to help. So far I just have no clue what you already have, are planning to make your self, and need. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 08:54 AM |
I currently only have the Design library so far, containing tween definitions for Part and GuiObjects, a HSL based constructor using ulist to let the HSL values behave as Color3s on the Roblox side, the Google Material Design colour set inside of Color3, with a modified .new constructor to boot. Also has add, subtract, multiply, divide and soft blend operations as +, -, *, / and ^
I had util and linked, but I've not converted them over since I rewrote the wrapper. |
|
|
| Report Abuse |
|
|
|
| 25 May 2015 09:03 AM |
| Well, what libraries would you like to see? I could make a few :) |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 09:11 AM |
| What libraries would -you- like to see? It doesn't matter if I've made them already; the libraries can be mixed and matched and loaded over eachother. |
|
|
| Report Abuse |
|
|
|
| 25 May 2015 09:13 AM |
hmm...
well. I'm just going to upgrade Vector2, Vector3 and CFrame then :3 |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 09:17 AM |
| Alright, if you need help with the API then just ask. Also, when overriding metamethods with Override "RobloxType" {METAMETHODS}, note that the metamethod arguments are unwrapped and the returns are wrapped automatically. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 11:15 AM |
| It's off the front page so I guess that's bump time. |
|
|
| Report Abuse |
|
|
|
| 25 May 2015 11:24 AM |
| Oh. I haven't yet started. But if I wan't to test my library, what do I need? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 12:39 PM |
| If you need to test your library, PM me and I'll give you the wrapper and a test script with the environment setup in it. Unless gskw and I magically decide that we are ready for a more alpha than alpha private testing stage for libraries and components. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 25 May 2015 01:48 PM |
Off the front page, so... Bump. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
|
| 26 May 2015 06:31 AM |
Lel.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 26 May 2015 06:32 AM |
-Meanwhile, I'm still struggling to understand the basics of a wrapper.-
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 26 May 2015 07:00 AM |
Meanwhile, I'm attempting to delegate by getting people to write their own libraries using the Valkyrie wrapper instead of writing some myself.
On that note, I should totally be making another one myself... |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 26 May 2015 08:11 AM |
im not a wrapper im an adapter i can ajust |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 26 May 2015 08:14 AM |
| I'm also a cat but cats enjoy messing with wrappers because the wrappers make great noises if you paw them |
|
|
| Report Abuse |
|
|