[QUOTE=raBBish;34142511]With the annoying crash fixed and Luabind integrated, I can start binding more stuff.
[lua]local clr = Color(255, 128, 0, 255)
local clr2 = Color(0, 128, 255, 255)
local vec_origin = math.Vector(0)
hook.add( "Paint", "test", function( str )
if not INGAME then return end
local c = vec_origin:ToScreen();
surface:SetColor( clr )
surface:DrawRect( 25, 25, 50, 50 )
surface:DrawOutlinedRect( 50, 50, 75, 75 )
if not c.behind then
surface:SetColor( clr2 )
surface:DrawOutlinedCircle( c.x - 10, c.y - 10, 10, 18 )
end
end )[/lua]
[thumb]http://cloud.steampowered.com/ugc/648750222914263516/854E11B11E99E90560A1C6EE11D3EB115D7ABFFC/[/thumb]
Should I keep posting updates even when the more hack-like content (ESP, aimbot, etc.) comes into play, or are people going to get upset?[/QUOTE]
Do what's best for science I say.
[QUOTE=raBBish;34141942]Holy shit that was the most annoying bug. I had the game crashing, cause being an invalid pointer (0xDDDDDDDD) in vstdlib.dll. I wasn't calling any functions from there or even linking it. The crash always happened after one of my functions returned. Otherwise it was completely random. It would happen in the menu, when I pressed a button or after a few seconds in-game. Sometimes it never happened.
I spent over an hour trying to debug the crash, did some tests and found out that it stopped when I commented out calls to my Lua hooks. I suspected the reason to be either luabind or the hook module not existing. However, it started again later, after I had rewritten the Lua hooks in C++. Again, I spent some time debugging, when it disappeared completely. I added the hooks back, played around with the code and the game didn't crash at all. Couple hours ago the crashing came back.
Well, this time I was determined to find the cause. I took out IDA, attached the debugger to GMod and launched. The crash was indeed in vstdlib.dll, the function was trying to use the invalid pointer. It was a virtual method of some class. I checked the vtable for hints, found "VCvarQuery001". I compared it to the vstdlib's Mac version (which contains debug info), and found out that the guilty method was ICvar::FindCommandBase. This was really helpful and I managed to fix the bug. The cause?
[lua]local lua_run = cvar.ConCommand( "ir_lua_run", lua_run_c )
local lua_open = cvar.ConCommand( "ir_lua_open", lua_open_c )[/lua]
Can you spot it? It took me a while.
I'm creating the ConCommands as locals. They get added to a linked list when created. The linked list is traversed by ICvar::FindCommandBase. Yep, the garbage collector got the concommands, Luabind deleted the C++ objects, but the destructor doesn't automatically remove it from the linked list.
The fix was simple, I just added a destructor to the ConCommand wrapper that unregisters the command from the list.[/QUOTE]
This is a random thought but: Source has support for local con-commands. I'm not sure how they link into the concommand bases though. I do understand this isn't your problem.
Bloom + that star shader from earlier...
[vid]http://dl.dropbox.com/u/3077939/star_2.webm[/vid]
Bloom makes everything better.
Needs more grain
[QUOTE=simie;34146197]Bloom + that star shader from earlier...
[vid]http://dl.dropbox.com/u/3077939/star_2.webm[/vid]
Bloom makes everything better.[/QUOTE]
Now [B]that's[/B] a cool star
What technique are you using for the bloom?
[QUOTE=slime73;34146345]What technique are you using for the bloom?[/QUOTE]
Pretty much this: [url]http://create.msdn.com/en-US/education/catalog/sample/bloom[/url]
I am working on a school project(ignore the Bulgarian language)
[video=youtube;mS7PcPLOLXY]http://www.youtube.com/watch?v=mS7PcPLOLXY[/video]
Thought I need some good pictures for all the planets.It is greatly unfinished and I need to add more stuff and fix some bugs.
I need a recommendation for an effect for "zooming in/out" and if someone knows or finds some good pictures for the planets tell me.
[QUOTE=raBBish;34142511]With the annoying crash fixed and Luabind integrated, I can start binding more stuff.
[lua]local clr = Color(255, 128, 0, 255)
local clr2 = Color(0, 128, 255, 255)
local vec_origin = math.Vector(0)
hook.add( "Paint", "test", function( str )
if not INGAME then return end
local c = vec_origin:ToScreen();
surface:SetColor( clr )
surface:DrawRect( 25, 25, 50, 50 )
surface:DrawOutlinedRect( 50, 50, 75, 75 )
if not c.behind then
surface:SetColor( clr2 )
surface:DrawOutlinedCircle( c.x - 10, c.y - 10, 10, 18 )
end
end )[/lua]
[thumb]http://cloud.steampowered.com/ugc/648750222914263516/854E11B11E99E90560A1C6EE11D3EB115D7ABFFC/[/thumb]
Should I keep posting updates even when the more hack-like content (ESP, aimbot, etc.) comes into play, or are people going to get upset?[/QUOTE]
I think as long as you explain the theory behind how you're doing stuff (instead of 'giev me teh coadz' responses), people can't get mad :v:
fucking space games
Today I was considering porting SteamRE to [del]Lua[/del] C++, then I looked at its codebase. Hoo boy, is that codebase a bit large. There are also some components of it that seem to be automatically generated.
It seems to me like it'll be a while before someone ports it to C++, because it would take someone of a bit of intelligence, and a lot of patience.
[editline]nobreakingmyautomerge[/editline]
I would go through with it myself if there was a big payoff, but I don't really see loads of people using it. There are only a handful of people using Open Steamworks and SteamRE as it is; those people with decent enough knowledge to know how to utilize it. That's not to say they're both extremely fantastic projects, but it would be nice if they were getting more attention. Maybe someone like Overv will do it. v0v
Been working on the programming side of things - strings are working, and procedures are now first-class values:
[img]http://i.imgur.com/G4YHu.png[/img]
[QUOTE=bobiniki;34146743]I am working on a school project(ignore the Bulgarian language)
[video=youtube;mS7PcPLOLXY]http://www.youtube.com/watch?v=mS7PcPLOLXY[/video]
Thought I need some good pictures for all the planets.It is greatly unfinished and I need to add more stuff and fix some bugs.
I need a recommendation for an effect for "zooming in/out" and if someone knows or finds some good pictures for the planets tell me.[/QUOTE]
Cool, I am working on something similar at the moment. Your program is much more advanced though, I am learning the workings of game programming while doing this.
[img]http://i.imgur.com/w3fOn.jpg[/img]
Do you actually calculate the planet movement as an n-body simulation or are you just faking it using sine and cosine like I am?
[QUOTE=Chandler;34146831]I think as long as you explain the theory behind how you're doing stuff (instead of 'giev me teh coadz' responses), people can't get mad :v:[/QUOTE]
Should be interesting. Pretty much everything beyond signature scanning and VMT hooking is new to me, so I'm still learning as I go.
[QUOTE=amcfaggot;34145182]-stuff-[/quote]
The Lua state stuff doesn't really apply. I'm using a single state for the game, not separating it into menu and game. It's created when Iris is first injected and destroyed in a VMT hook right before CHLClient::Shutdown is called. The Shutdown hook was one of the first problems too, since I didn't realize that most of the Source interfaces have been invalidated once Shutdown reaches client.dll. Took a while to solve the mysterious crashes on exit.
Using a single state instead of two was mostly a design choice. I started with two states, but it became annoying if I needed something available on both states, and made less sense when I started considering how Source works.
As for ConCommands, well... I'm rewriting the bindings right now. I've known about HL2SB for a while, I used it as a reference when I was making pre-Luabind ConCommand bindings. I'd quite like to keep the form similar to what I first had with Luabind, except with the C++ side owning the ConCommand objects to keep GC away from them. I've got some ideas which still need experimenting.
My current one is inheriting ConCommand to create a more Lua-friendly dispatch for the callbacks. I'd hide the actual constructors from Lua and allow creation and removal only through couple static functions. I did try almost the same method, except with direct class access, but then the ConCommands started disappearing.
Which is another mystery. I have no idea what caused it. The Lua objects still existed in-game, but the commands vanished from the list somewhere around LevelInitPostEntity. Re-registering didn't work, and I even breakpointed ICvar::UnregisterConCommand, which didn't get called at all until Shutdown. So the ConCommands just vanished from the command list. Any commands created through C++ persisted though.
If you want a look, I dumped the code [url=http://pastie.org/3162278]here[/url]. It's really messy, since I was just throwing stuff at it trying to get it working properly.
e: Oh boy, can't inherit ConVar. The private virtual methods don't have definitions, which happen to be quite important. I'll probably end up writing my own ConVars which are saved into Lua config files.
[QUOTE=Tobba;34146286]Needs more grain[/QUOTE]
[IMG]http://i.imgur.com/74kGd.png[/IMG]
Added initial physics and collisions, improved map class. Total commits: 6
Yep, I don't have much time to code, I need a laptop so I can work on it much more...
Tell me if I shouldn't post such small progress.
Didn't see that coming
I think it get's funnier after 16 times
[QUOTE=RyanDv3;34148873]Didn't see that coming
I think it get's funnier after 16 times[/QUOTE]
I just found this image in my Dropbox. I think that's how it ended up last time:
[img]http://dl.dropbox.com/u/1106779/SuperGame.png[/img]
(grain, bloom, grid, USA vs Russia, [I]realistic[/I] colors)
[QUOTE=Robber;34149054]I just found this image in my Dropbox. I think that's how it ended up last time:
[img]http://dl.dropbox.com/u/1106779/SuperGame.png[/img]
(grain, bloom, grid, USA vs Russia, [I]realistic[/I] colors)[/QUOTE]
[url]http://www.facepunch.com/threads/1000894?p=25266056&viewfull=1#post25266056[/url]
[QUOTE=raBBish;34148477]Should be interesting. Pretty much everything beyond signature scanning and VMT hooking is new to me, so I'm still learning as I go.
The Lua state stuff doesn't really apply. I'm using a single state for the game, not separating it into menu and game. It's created when Iris is first injected and destroyed in a VMT hook right before CHLClient::Shutdown is called. The Shutdown hook was one of the first problems too, since I didn't realize that most of the Source interfaces have been invalidated once Shutdown reaches client.dll. Took a while to solve the mysterious crashes on exit.
Using a single state instead of two was mostly a design choice. I started with two states, but it became annoying if I needed something available on both states, and made less sense when I started considering how Source works.
As for ConCommands, well... I'm rewriting the bindings right now. I've known about HL2SB for a while, I used it as a reference when I was making pre-Luabind ConCommand bindings. I'd quite like to keep the form similar to what I first had with Luabind, except with the C++ side owning the ConCommand objects to keep GC away from them. I've got some ideas which still need experimenting.
My current one is inheriting ConCommand to create a more Lua-friendly dispatch for the callbacks. I'd hide the actual constructors from Lua and allow creation and removal only through couple static functions. I did try almost the same method, except with direct class access, but then the ConCommands started disappearing.
Which is another mystery. I have no idea what caused it. The Lua objects still existed in-game, but the commands vanished from the list somewhere around LevelInitPostEntity. Re-registering didn't work, and I even breakpointed ICvar::UnregisterConCommand, which didn't get called at all until Shutdown. So the ConCommands just vanished from the command list. Any commands created through C++ persisted though.
If you want a look, I dumped the code [url=http://pastie.org/3162278]here[/url]. It's really messy, since I was just throwing stuff at it trying to get it working properly.
e: Oh boy, can't inherit ConVar. The private virtual methods don't have definitions, which happen to be quite important. I'll probably end up writing my own ConVars which are saved into Lua config files.[/QUOTE]
Please do inform me of your progress, I'm very interested in your work. Keep looking into it, you'll eventually find a way to make it work, I'm sure.
My bit about states wasn't about having multiple states (Menu (which is really just Client to some degree), Client, Server), it was about destroying and recreating them. You understand this as going to one GMod server, leaving, then starting your own server during the same session. You don't get variables and libraries and modules from that first server running on your server, because they're two different LevelInit/LevelShutdown calls. The state initializes once for that server, gets destroyed when you leave, and then again a second time again for your server.
The approach you're using right now is one that I first took when I was first working on HL2SB, and that is having two Lua states (client and server), which run for the entire game session. That means when you change servers, disconnect, load a new map, etc. you're still on the same Lua state, and stuff gets carried over.
I even noticed that you have a global INGAME as a result of this architecture. I'm not sure if that's your intent, but there are some dangers doing that that you have to compensate for in your bindings, such as making some of your bindings do nothing when you're not in-game. That is, unless you want to rely on your scripts being properly written where you wrap unsafe functions in INGAME conditional blocks.
You're right about keeping C++ side objects away from GC. Deco Da Man did mention a very clever way for them to work together, one that's actually more conforming to proper Lua handling, but in general, whether you used an approach like mine or Deco's (talk to him if you'd like his input, it's definitely worth reading) you need to be aware of where data is being stored, and manually take care of that memory yourself.
ConVars and ConCommands have this particular behavior in Source that requires it due its management in registering the commands and properly deleting the memory if you're creating them during run time.
[QUOTE=xxxkiller;34148148]Cool, I am working on something similar at the moment. Your program is much more advanced though, I am learning the workings of game programming while doing this.
[img]http://i.imgur.com/w3fOn.jpg[/img]
Do you actually calculate the planet movement as an n-body simulation or are you just faking it using sine and cosine like I am?[/QUOTE]
I do it with sine and cosine like you :V
I fixed the image a bit more:
[img]http://i.imgur.com/vy8wb.png[/img]
[QUOTE=amcfaggot;34149223]I even noticed that you have a global INGAME as a result of this architecture. I'm not sure if that's your intent, but there are some dangers doing that that you have to compensate for in your bindings, such as making some of your bindings do nothing when you're not in-game. That is, unless you want to rely on your scripts being properly written where you wrap unsafe functions in INGAME conditional blocks.[/QUOTE]
That global was the result of a small quirk in the hook I used for rendering (which, I believe, hasn't been found in public yet). TF2, CS:S and DoD only use it in-game, but GMod in menu too. Also, I have plans for state separation, which doesn't involve any INGAME blocks :v: But it's going to be managed through Lua.
[QUOTE=raBBish;34149491]That global was the result of a small quirk in the hook I used for rendering (which, I believe, hasn't been found in public yet). TF2, CS:S and DoD only use it in-game, but GMod in menu too. Also, I have plans for state separation, which doesn't involve any INGAME blocks :v: But it's going to be managed through Lua.[/QUOTE]
Remember LSS?
That had some potential until all the skids ruined it, well, maybe if they had a good dev and put effort into it.
[QUOTE=COBRAa;34149592]Remember LSS?
That had some potential until all the skids ruined it, well, maybe if they had a good dev and put effort into it.[/QUOTE]
You couldn't really do something like this when you are going to release it publicly since it would get blacklisted so fast
[QUOTE=COBRAa;34149592]Remember LSS?
That had some potential until all the skids ruined it, well, maybe if they had a good dev and put effort into it.[/QUOTE]
Well, sorry to disappoint, but I'm not planning to release this. I don't want any of my cheats to get into the hands of skiddies, plus it being private lowers the chance of detection greatly :v:
Well, maybe once it's defunct. I have nothing against other people possibly learning from my code.
Also, I apparently can inherit from ConVar! All the methods I needed are defined in tier1/convar.cpp, which I completely glanced over. This is a good thing, since I won't need two interfaces for interacting with normal CVars and my own ones.
[QUOTE=COBRAa;34149387]I fixed the image a bit more:
[img]http://i.imgur.com/vy8wb.png[/img][/QUOTE]
Killed it.
I released my Google Glype theme that I posted before on the Proxy.Org forums:
[url]http://proxy.org/forum/themes/7258-googlype-discreet-proxy-theme.html[/url]
[QUOTE=RyanDv3;34148873]
I think it get's funnier after 16 times[/QUOTE]
It does get us funnier after 16 times
[QUOTE=COBRAa;34149592]Remember LSS?
That had some potential until all the skids ruined it, well, maybe if they had a good dev and put effort into it.[/QUOTE]
LSS had no potential, and it was wasted from the start.
grain
Sorry, you need to Log In to post a reply to this thread.