• Project SourceLua
    130 replies, posted
[QUOTE=haushippo;23032783][IMG_thumb]http://imgur.com/V9B2Y.png[/IMG_thumb][/QUOTE] Cool, I know how to use Prt Scrn, too. [img]http://i944.photobucket.com/albums/ad281/andrewmcwatters/steamcommunitycom_id_andrewmcwatter.png[/img]
[QUOTE=amcwatters;23032909]Cool, I know how to use Prt Scrn, too.[/QUOTE] [url]http://www.facepunch.com/showthread.php?t=836849[/url] i wouldn't even bother at this point.
I don't understand why you bother at all. Stop derailing the thread.
[QUOTE=haushippo;23032963][url]http://www.facepunch.com/showthread.php?t=836849[/url] i wouldn't even bother at this point.[/QUOTE] Whoa a thread in which someone essentially tried remaking Garrysmod. This is so intensely relevant to this thread that I'm at a loss of words really.
Stop derailing. Looks interesting, will keep peering in from time to time.
This was massively derailed actually since the side questions. [QUOTE=amcwatters;23006276]I'm here to ask you guys a question: What functions and methods should I sigscan for to give us more flexibility? What hooks?[/QUOTE] I may need your help, Chris, with the hook implementation. The current hooks are only based on functions available within the VSP-based classes, and KeyValues from events (the latter not implemented yet). The nice thing is, implementing hooks within available functions is fun and easy. [code]//--------------------------------------------------------------------------------- // Purpose: called when a client spawns into a server (i.e as they begin to play) //--------------------------------------------------------------------------------- void CSourceLuaPlugin::ClientActive( edict_t *pEntity ) { BEGIN_LUA_CALL_HOOK( "ClientActive" ); CBasePlayer *pPlayer = (CBasePlayer *)CBaseEntity_Instance( pEntity ); lua_pushplayer( L, pPlayer ); END_LUA_CALL_HOOK( 1, 0 ); } [/code]
I really wish I could believe this project will become great, but so far a wrapper for metamod will probably be all this will become.
What do you mean?
Well, in order for you to completely receive the full potentials of the Source engine through Lua, either you make it your own game or you start learning Assembly.
Obviously there's detours and sigscanning involved at the core of the project. I don't see a problem with this. It's a simple equation a small percentage of people use Metamod: Source and SourceMod because hardly anyone gets around to using SourcePawn, which is unpopular in comparison to GMod's proven implementation of Lua. You open gateways when you allow developers to write code for other games that they normally wouldn't based on a language alone.
You're using a plugin that makes the hooks for you. To receive full potential, you'll need to learn about x86 assembly and start detouring.
Yeah, that's what I'm working on. Signature scanning is fun, but the work is done for you through CSigScan. Detouring is something I haven't started on. I don't see what's so bad about detouring.
Nothing, but it's good to have knowledge of how it works, else you can get into some deep problems if you do it wrong.
Definitely. I'd easily take on the challenge though. Most people here sit around and do nothing but Lua for years.
I'm glad you're taking the initiative. If you need help, Im sure Chris and I could help you.
[QUOTE=Gbps;23035307]I'm glad you're taking the initiative. If you need help, Im sure Chris and I could help you.[/QUOTE] What's the emote for a heart? I haven't been here in a while :wink:
[img]http://www.facepunch.com/fp/rating/heart.png[/img] That works.
:love: works too. :v:
[QUOTE=amcwatters;23035351]What's the emote for a heart? I haven't been here in a while :wink:[/QUOTE] [noparse]:love:[/noparse] :love: or [noparse]:h:[/noparse] :h:
Well then, [img]http://www.facepunch.com/fp/rating/heart.png[/img], :love:, and :h:. Glad to speak with you guys again.
:v: [highlight](User was banned for this post ("Why reply?" - SteveUK))[/highlight]
[QUOTE=raBBish;23007118]It looks pretty good, although I would suggest [url=http://hl2sb.googlecode.com/svn/trunk/serverplugin_lua/lua/includes/modules/hook.lua]following your own style guide[/url] (:v:). Also, creating 10 locals in hook.Call, which gets called often isn't a good practice (assuming you're going to have a Tick hook or something similar). Instead of r1-r8 you should use one table defined outside the function. [lua]ret = { pcall( v, ... ) } bError = ret[1] table.remove( ret, 1 )[/lua] [editline]07:20PM[/editline] Yes, although server-side only.[/QUOTE] That code is stolen from Garry's Mod. He didn't author that, garry (presumably) did. Also, you should really use a tuple instead of a table there, it's both faster and doesn't create strange problems with nil values and such. For example: [lua] return (function(bError, err, ...) if bError == false then Warning(table.concat{"Hook '", tostring(k), "' (", tostring(strEventName), ") Failed: ", tostring(err), "\n"}) tHooks[k] = nil elseif err ~= nil then return err, ... end end)(pcall(v, ...)) [/lua] (made some other minor changes, too) Although that requires a slight restructuring of the rest of the function as well (dearly needed, anyway).
If you write up a patch, I'll commit it.
I would if the code wasn't shamelessly stolen from Garry. Give proper credit or write your own code.
[QUOTE=jA_cOp;23073904]I would if the code wasn't shamelessly stolen from Garry. Give proper credit or write your own code.[/QUOTE] Erm, what?
[QUOTE=Jimmg;23077654]Erm, what?[/QUOTE] He has copy-pasted hook.lua from Garry's Mod, then added his own header with no mention of its author. Do you honestly have a problem with me not fancying that?
[QUOTE=jA_cOp;23077810]He has copy-pasted hook.lua from Garry's Mod, then added his own header with no mention of its author. Do you honestly have a problem with me not fancying that?[/QUOTE] Ahh, I understand now.
Why not Pawn? Lua is a horrible scripting language for games.
[QUOTE=Darkimmortal;23090038]Lua is a horrible scripting language for games.[/QUOTE] Aha! That must be why it's used in [I]almost every game[/I] with scripting capabilities.
Pawn is not object orientated, at all. It'd be awful. You wouldn't be able to use any of these; [quote]Core objects such as CBaseEntity, CBasePlayer, CBaseCombatWeapon, and Vector and QAngle have already been implemented from it's derived project.[/quote] And since that's the whole point of this basically, Pawn is not appropriate.
Sorry, you need to Log In to post a reply to this thread.