[QUOTE=amcfaggot;34131545][url]http://lua-users.org/wiki/LuaInterpreterInLua[/url]
[editline]9th January 2012[/editline]
people think of everything, don't they
[editline]9th January 2012[/editline]
I also remember someone writing a Lua module to use Lua in Lua, you could open states in Lua, etc. Crazy shit.[/QUOTE]
That's just an implementation of the interpreter application, not the Lua lexer/parser/interpreter.
[editline]bla[/editline]
After open.gl maybe.
You could have it interpret its own code, Luaception.
[QUOTE=ralle105;34131658]Write a Lua VM in Lua and I'll be impressed:v:[/QUOTE]
or LuaJIT in Lua, then ask Garry to implement it into that game of his and watch it still break
[QUOTE=BlkDucky;34131266]complete with the classic nige artstyle.[/QUOTE]
I believe the kids these days are calling it post-nigé.
[QUOTE=Maurice;34017096]I'm so productive.
[img]http://i.imgur.com/CipeT.gif[/img][/QUOTE]
Would you mind if I stole your graphics? (ie can you upload them)
I need some placeholder graphics and i love the portal stuff in mari0
Nothing to show in screenshots...
I didn't have much time today to code, so I made a map class and a mapfile interpreter quickly, added new (very useful) functions for the base class, setup-ed a git repo, already having 5 commits in the experimental branch, and updated the makefile so it compiles with the oh-so useful debug symbols.
Basicaly it just works.
(Eventualy, the helper functions of the child classes will contain a lot of if-else statements, this is the best design I can think of yet)
[QUOTE=Richy19;34133051]Would you mind if I stole your graphics? (ie can you upload them)
I need some placeholder graphics and i love the portal stuff in mari0[/QUOTE]
[B]His[/B] graphics?
[QUOTE=Darwin226;34133152][B]His[/B] graphics?[/QUOTE]
Well I know the portal stuff wasnt done y him, but i dont know who did it and he is the easiest person to ask
Mwahaha. The first time my planets have looked actually 3d!
[IMG]http://dl.dropbox.com/u/33076954/Winner.PNG[/IMG]
[QUOTE=Tezzanator92;34131342]Reminds me of skyroads.[/QUOTE]
suddenly nostalgia. That game was amazing.
Blake stone, too.
I'd love to make a game with Mode 13 style graphics or similar.
I made a Lua hook system in C++. I did this when I realized that my old method of calling "call" function from a Lua module went between C++ and Lua five times for each call. (get "require", call require("hook"), get "hook.call", call hook.call("event", args))
[cpp]class hook
{
static std::map<std::string, std::map<std::string, luabind::object>> hooks_;
public:
static void add(std::string const &event, std::string const &id,
luabind::object const &fun)
{
hooks_[event][id] = fun;
}
static void remove(std::string const &event, std::string const &id)
{
hooks_[event].erase(id);
}
static void clear()
{
hooks_.clear();
}
static int call(lua_State *L, std::string const &event)
{
int top = lua_gettop(L);
auto ev_list = hooks_[event];
for (auto it = ev_list.cbegin(); it != ev_list.cend(); ++it)
{
it->second.push(L);
// We don't need the event name
for (int i = 2; i <= top; ++i)
{
lua_pushvalue(L, i);
}
int r = lua_pcall(L, top - 1, LUA_MULTRET, 0);
if (r != 0)
{
msg << warning << "Error in hook: "
<< lua_tostring(L, -1) << std::endl;
continue;
}
int nres = lua_gettop(L) - top;
if (nres > 0)
{
return nres;
}
}
return 0;
}
};[/cpp]
I can't wait until variadic templates become more popular (and actually implemented in VS), so I wouldn't need to use Lua for multiple arguments.
e: Usage:
[cpp]lua_pushstring(L, "hi");
iris::lua::hook::call(L, "Paint");[/cpp]
[lua]hook.add( "Paint", "test", function( str )
print( "hi" )
end )[/lua]
[QUOTE=raBBish;34133527]I made a Lua hook system in C++. I did this when I realized that my old method of calling "call" function from a Lua module went between C++ and Lua five times for each call. (get "require", call require("hook"), get "hook.call", call hook.call("event", args))
[cpp]class hook
{
static std::map<std::string, std::map<std::string, luabind::object>> hooks_;
public:
static void add(std::string const &event, std::string const &id,
luabind::object const &fun)
{
hooks_[event][id] = fun;
}
static void remove(std::string const &event, std::string const &id)
{
hooks_[event].erase(id);
}
static void clear()
{
hooks_.clear();
}
static int call(lua_State *L, std::string const &event)
{
// We don't need the event name
int top = lua_gettop(L) - 1;
auto ev_list = hooks_[event];
for (auto it = ev_list.cbegin(); it != ev_list.cend(); ++it)
{
it->second.push(L);
for (int i = 1; i <= top; ++i)
{
lua_pushvalue(L, i);
}
int r = lua_pcall(L, top, LUA_MULTRET, 0);
if (r != 0)
{
msg << warning << "Error in hook: "
<< lua_tostring(L, -1) << std::endl;
continue;
}
int nres = lua_gettop(L) - top;
if (nres > 0)
{
return nres;
}
}
return 0;
}
};[/cpp]
I can't wait until variadic templates become more popular (and actually implemented in VS), so I wouldn't need to use Lua for multiple arguments.
e: Usage:
[cpp]lua_pushstring(L, "hi");
iris::lua::hook::call(L, "Paint");[/cpp]
[lua]hook.add( "Paint", "test", function( str )
print( "hi" )
end )[/lua][/QUOTE]
Nice.
I got my buildbot for minecraft finished, pulls changesets and compiles the jar on linux!
[QUOTE=amcfaggot;34124215]I don't really know regex, but I fooled around on [url]http://regexpal.com/[/url] and it looks like I would've had to have used this to get the same output:
[code][^TestFormat:](.+)[/code][/QUOTE]
This is wrong. That regex is basically
First character:
not 'T' or 'e' or 's' or 't' or 'F' or 'o' or 'r' or 'm' or 'a' or 't' or ':'
Then all the other characters.
It skips until it finds any one of those characters, followed by any character that isn't in that set, then copies everything after it.
By dumb luck it works for some inputs, but it isn't too hard to break.
Accurate 3d per pixel lighting hooray
[IMG]http://dl.dropbox.com/u/33076954/accurate.PNG[/IMG]
For the curious, while within the circle:
[code]
double mz=sqrt(radius*radius - mi*mi - mj*mj);
double qcirc=0.5*M_PI*mz;
double iqcirc=0.5*M_PI*radius;
double f=qcirc/iqcirc; ///this was the old lighting in the last post
double x1, y1, z1;
x1=radius*sin(angle);
y1=radius*cos(angle);
z1=radius/4.0;
double x2, y2, z2;
x2=mi;
y2=mj;
z2=mz;
double light=
(x1*x2 + y1*y2 + z1*z2)/
(sqrt((x1*x1 + y1*y1 + z1*z1) * (x2*x2 + y2*y2 + z2*z2)));
light+=fabs(light);
light/=2.0;
data[i][j]=vmult(data[i][j], light);
[/code]
For the more curious, vmult is vertical multiply, ie multiply the rgb components of the colour stored in data[i][j]
Feel like inventing a project just to use the name "[B]lua[/B]bricant"
[QUOTE=Icedshot;34134157]Accurate 3d per pixel lighting hooray
[IMG]http://dl.dropbox.com/u/33076954/accurate.PNG[/IMG]
For the curious, while within the circle:
[code]
//code
[/code]
For the more curious, vmult is vertical multiply, ie multiply the rgb components of the colour stored in data[i][j][/QUOTE]
Why is it we happen to be working on the exact same project?
Do something for LOVE. It'll fit in [url=http://love2d.org/wiki/Category:Libraries]with the rest of the library names[/url].
[QUOTE=Lexic;34134426]Do something for LOVE. It'll fit in [url=http://love2d.org/wiki/Category:Libraries]with the rest of the library names[/url].[/QUOTE]
Especially so since LUBE has already been taken.
[QUOTE=Smashmaster;34134406]Why is it we happen to be working on the exact same project?[/QUOTE]
[del]It's because I find you attractive[/del]
This has been my pet project for millions of years. Why are you working on it?
[QUOTE=Icedshot;34134489][del]I find you attractive[/del]
This has been my pet project for millions of years. Why are you working on it?[/QUOTE]
Pet project for about 6 months.
[QUOTE=garry;34134345]Feel like inventing a project just to use the name "[B]lua[/B]bricant"[/QUOTE]
Something to speed up Lua development?
[QUOTE=amcfaggot;34134510]Something to speed up Lua development?[/QUOTE]
Make it a library that allows you to quickly make lua apps, and make it so you have to wrap your project in somehting like:
[lua]
local app=luabricant.UnpackCondom("Test App")--Start app creation
app.Girl="Michelle"--the apps title
app.ThrustSpeed=30--the fps to run at
app.Power=true--Enable/disable tick syncing with the framerate
luabricant.PutOnCondom(app)--Finalize app creation
luabricant.Luagasm(app)--Launch app
--When you're done, you can:
luabricant.SighWithRelief(app)--Close the app and destroy any extra "resources"
[/lua]
Just an idea though.
[editline]9th January 2012[/editline]
Also, look at this: [url]http://yueliang.luaforge.net/[/url]
Generic star:
[img]http://img688.imageshack.us/img688/7315/sunb.png[/img]
Kinda crappy, but it's animated so that's cool. Will look better with a massive glow shader around it.
Finished (what I'm calling) v0.2 of my media/torrent application:
[img]http://dl.dropbox.com/u/39921754/fabella_look3.png[/img]
v0.3 will add torrent capabilities, so as of now, it's just vlc with less features and settings... But if you'd like to download and tell me what you think, here's the release file:
[url]http://dl.dropbox.com/u/39921754/Fabella_release_0.2.zip[/url]
Note: You can fullscreen the video by double-clicking the output panel (And un-fullscreen).
A little premature to release now I'll admit, but I'm feeling very good about this project; it's only the 4th day of work!* I will of course take any criticism or ideas, but be aware that I'm trying to avoid polish related work until all the individual parts are in place (I think that happens at v0.4).
Also, here's the source if you're interested: [url]http://dl.dropbox.com/u/39921754/Fabella_0.2.zip[/url]
*I made a prototype version of this already for a course, and I'm using class libraries I wrote for that previous version, so don't think I did ALL of this (research, planning, backend code, etc.) in just 4 days.
[QUOTE=Smashmaster;34134959]Generic star:
Kinda crappy, but it's animated so that's cool. Will look better with a massive glow shader around it.[/QUOTE]
We're gonna need to see that animation :v:
[QUOTE=Smashmaster;34134959]Generic star:
[img]http://img688.imageshack.us/img688/7315/sunb.png[/img]
Kinda crappy, but it's animated so that's cool. Will look better with a massive glow shader around it.[/QUOTE]
Don't stars tend to be more orange
[QUOTE=esalaka;34135113]Don't stars tend to be more orange[/QUOTE]
[url]http://en.wikipedia.org/wiki/White_dwarf[/url]
Sorry, you need to Log In to post a reply to this thread.