• What are you working on? January 2012
    3,401 replies, posted
[QUOTE=amcfaggot;34204185]I don't use mercurial, but doesn't it have revert? This doesn't seem like a good reason to prefer X over Y to me.[/QUOTE] Mercurial's... "thing" is that it tries to keep history intact, always. There are of course ways to undo commits and edit history, but they're generally not recommended. [editline]14th January 2012[/editline] I've kept a couple days' break from iris, since I've been sick and had to deal with university stuff. I've created basic entity wrappers and bindings. I'm wrapping Source entities in my own classes, since the headers are outdated and trying to rebuild them from vtables is horrible due to multiple inheritance (different compilers handle it differently. I generally use mac binaries for vtables, since they contain some debug info) I'm not using recvprops yet, so I'll write about them later. Right now my wrappers can only list entities and identify player entities. I've hooked OnEntityCreated and OnEntityDeleted from a Source interface, which I use for building a list of entities. I could use Source's own entity lists, but that would require more work every time you query the list, whereas Luabind supports binding STL iterators as tables, so I can just return the internal list. So that my post isn't all text, have this: [thumb]http://puu.sh/dlAF[/thumb] [lua]local clr2 = Color(0, 128, 255, 255) hook.add( "Paint", "test", function( str ) if not INGAME then return end local c surface:SetColor( clr2 ) for ent in entity.GetAll() do if ent:IsPlayer() then c = ent:GetAbsOrigin():ToScreen(); if not c.behind then surface:DrawOutlinedCircle( c.x - 5, c.y - 5, 5, 18 ) end end end end )[/lua]
fuck yeah! [img]http://i.imgur.com/IGDsU.png[/img] Baby steps...
[QUOTE=Chandler;34204115]Look into git filter-branch. Actual ways in which to fix this are [url=http://stackoverflow.com/questions/750172/how-do-i-change-the-author-of-a-commit-in-git]here[/url][/QUOTE] Thanks, but I'd have to set up Git to do this. It's only two commits and the author should is set, so it's not that bad. Hg has something similar, but it's impossible to push a remove branch to a remote repository. (I only noticed it after pushing to GitHub.) [editline]14th January 2012[/editline] I'll test if it works now in a test repository before making more commits... [editline]fake editline to rule out automerge breaking[/editline] It works. Hg usernames are usually "User <Email>", wich is translated correctly by hg-git.
[QUOTE=swift and shift;34205331]fuck yeah! [img]http://i.imgur.com/IGDsU.png[/img] Baby steps...[/QUOTE] Is that Kari or are you making anther functional language?
[QUOTE=Darwin226;34205885]Is that Kari or are you making anther functional language?[/QUOTE] haskell dude! [editline]14th January 2012[/editline] The equivalent in Kari would be: [code] (a -> (b -> (n -> if eq n 0 (a) (fib_ b + a b - n 1)))) => fib_ (n -> if lt n 2 (1) (fib_ 1 1 n)) => fib [/code]
[QUOTE=swift and shift;34205938]haskell dude! [editline]14th January 2012[/editline] The equivalent in Kari would be: [code] (a -> (b -> (n -> if eq n 0 (a) (fib_ b + a b - n 1)))) => fib_ (n -> if lt n 2 (1) (fib_ 1 1 n)) => fib [/code][/QUOTE] Don't blame me! All the functional languages look alike. So you're learning haskell? I thought making a haskell interpreter would be more along your skill set.
[QUOTE=swift and shift;34205938] [code] (a -> (b -> (n -> if eq n 0 (a) (fib_ b + a b - n 1)))) => fib_ (n -> if lt n 2 (1) (fib_ 1 1 n)) => fib [/code][/QUOTE] how on earth can one's brain parse that [editline]14th January 2012[/editline] and i thought understanding perl was a milestone
[QUOTE=Perl;34206048]how on earth can one's brain parse that[/QUOTE] the funny thing is, kari itself has no idea what that code means until runtime!
You can assign into arrays now :) (indexed assignments) [img]http://i.imgur.com/MxBrl.png[/img] Just have to get that working for multiple assignments, and then fix parametrics (which I broke by changing the assignment representation/logic) [editline]14th January 2012[/editline] [QUOTE=swift and shift;34206062]the funny thing is, kari itself has no idea what that code means until runtime![/QUOTE] I'm pretty sure it doesn't know what it means at runtime either? Unless that's some deeper comment about how the language is parsed/executed. [editline]14th January 2012[/editline] Also, I have to consciously avoid referring to your language as "she" :v:
[QUOTE=r0b0tsquid;34207312]I'm pretty sure it doesn't know what it means at runtime either? Unless that's some deeper comment about how the language is parsed/executed.[/QUOTE] I think he means the whole currying thing. Functions building functions that build other functions, etc.
Thread's up: [url]http://www.facepunch.com/threads/1155483?p=34208000[/url] I'm back at Uni tomorrow so I won't be able to work on it much for a couple of days as I get organised.
Just a small app that will pop up every time the [url=http://teefury.com]TeeFury[/url] T shirt changes. It grabs the current design from the site. Click it and it goes away. [img]http://i.imgur.com/dhotg.png[/img]
[img]http://i.imgur.com/WHa4a.png[/img] Got a test item of every sort now, Weapon - Potion - Armor - Quest Item - Misc Item - Key The art is not mine, it's from google.
Wrote a brainfuck interpreter in graphscript: [img]http://i.imgur.com/CoRfa.png[/img] It supports nested loops too! I guess that this proves my grapher's Turing complete? :v: [editline]14th January 2012[/editline] The red line is a visualization of the memory buffer: it's just a plot of the relation "y = mem[x]" :)
Now write a grapher (with graphscript) in graphscript that can load a grapher (with graphscript) written in graphscript... A certain early 80s sci-fi film springs to mind.
[QUOTE=r0b0tsquid;34208822]Wrote a brainfuck interpreter in graphscript: [img]http://i.imgur.com/CoRfa.png[/img] It supports nested loops too! I guess that this proves my grapher's Turing complete? :v: [editline]14th January 2012[/editline] The red line is a visualization of the memory buffer: it's just a plot of the relation "y = mem[x]" :)[/QUOTE] Idea! Let it access the system information and plot the graph of current CPU usage.
So, RecvProps. They're one of Source's networking methods for entities. Entities can declare a [url=https://developer.valvesoftware.com/wiki/Networking_Entities#Network_Data_Tables]data table[/url], which is shared between the server and client. It's used to serialize and unserialize the entity's data for networking. Since it's declared on client, there's naturally a way to access the tables, and it's IBaseClientDLL::GetAllClasses, which returns the first element of a linked list of data tables, also called ClientClass. Each class contains the entity's tables, which in turn can contain properties and more tables. [url=http://pastebin.com/RgTCSrBE]Example dump[/url] from TF2. Now, why are these data tables important? Because they contain offsets to the members they declare. So, if you have a C_BaseEntity and you want to get its origin, you'll either have to rely on outdated headers or use offsets. We can parse the data tables during runtime and get the offsets, then use the data strings to get the offset when we need the member data. I use them like this: [cpp]int source::player::health() const { return offset_map.get<int>(entity_, "DT_BasePlayer->m_iHealth"); }[/cpp] offset_map.get just gets the offset of the given data string and adds it to the pointer, then casts it. Since we now have a method (besides outdated headers) to get entity data, we can expand the entity and player wrappers. And so, I have this. [thumb]http://puu.sh/dnqe[/thumb] [lua]local hp_green = Color( 80, 255, 80 ) local hp_background = Color( 180, 180, 180 ) local col_shadow = Color( 40, 40, 40 ) local function get_distance_alpha( ply ) local dist = entity.localplayer().origin:distance( ply.origin ) local a = 255/(dist/1000) if a < 0 then a = 0 end if a > 255 then a = 255 end return a end local function draw_hp( fr, x, y, w, h, a ) x = x - (w/2) hp_green.a = a surface:set_color( hp_green ) surface:draw_rect( x + 1, y + 1, x + (fr * w) - 1, y + h - 1 ) hp_background.a = a/2 surface:set_color( hp_background ) surface:draw_rect( x, y, x + w, y + h ) surface:set_color( col_shadow ) surface:draw_outlined_rect( x, y, x + w, y + h ) end local function ply_paint( ply ) local h = ply.health local max = ply.max_health or 100 if GAME == "tf" and h > max then max = math.floor(max * 1.5) end --local col_team = team.get_color( ply.team ) local pos = ply.origin:to_screen() if not pos.behind then pos.y = pos.y + 7 draw_hp( h/max > 1 and 1 or h/max, pos.x, pos.y, 50, 10, get_distance_alpha( ply ) ) end end local function esp_paint() for ent in entity.get_all() do if ent:is_player() and ent ~= entity.localplayer() and ent.alive then ply_paint( ent ) end end end hook.add( "Paint", "esp", esp_paint )[/lua]
Make sure you keep posting what you do with that; it's interesting.
[QUOTE=Staneh;34208756]:image: Got a test item of every sort now, Weapon - Potion - Armor - Quest Item - Misc Item - Key The art is not mine, it's from google.[/QUOTE] What font are you using for the version, health etc?
Here's a small Roguelike thing I'm working on using C++ and Libtcod. Graphics may or may not follow once all the other important things have been fully developed. [IMG]http://dl.dropbox.com/u/10657252/Dev/RoguelikeDev2.PNG[/IMG]
[QUOTE=r0b0tsquid;34207312]Also, I have to consciously avoid referring to your language as "she" :v:[/QUOTE] Exactly the opposite for me; Kari is a Finnish male name
[QUOTE=Doohl;34209508]Here's a small Roguelike thing I'm working on using C++ and Libtcod. Graphics may or may not follow once all the other important things have been fully developed. [IMG]http://dl.dropbox.com/u/10657252/Dev/RoguelikeDev2.PNG[/IMG][/QUOTE] Mind sharing the source? It would help me.
[QUOTE=Funley;34209456]What font are you using for the version, health etc?[/QUOTE] [URL="http://www.urbanfonts.com/download.php?file=alphabeta1.zip"]Alpha Beta BRK[/URL]
Working on a ray-caster because why the fuck not? [img]http://i53.tinypic.com/20kxis9.png[/img]
[QUOTE=i300;34210698]Working on a ray-caster because why the fuck not? [img]http://i53.tinypic.com/20kxis9.png[/img][/QUOTE] lodev.org?
[QUOTE=BlkDucky;34210729]lodev.org?[/QUOTE] Yeah, I took the map and read the whole document. My code structure is a shit ton different from theirs though (i.e. using vectors instead of int dirX; int dirY;). Really helpful site.
[QUOTE=Asgard;34209994]Mind sharing the source? It would help me.[/QUOTE] Sure! I haven't actually shared this with anyone so don't mind any ugliness. However I generally make it a rule for myself to comment everything, so you hopefully shouldn't have a problem figuring the stuff out. [URL="http://dl.dropbox.com/u/10657252/Libtcodtesting.rar"]Here's the download[/URL]. I use CodeBlocks and I didn't feel like removing all the irrelevant files, so just ignore them if you don't need them. If you don't feel like compiling the code, just go to bin/debug and the executable there should be ready to go.
Got bored and made this in a few minutes. Not even nearly close to as cool as r0b0tsquid's, but it's fun to mess around in. [IMG]http://i.imgur.com/KofZi.gif[/IMG]
[QUOTE=Doohl;34210871]Sure! I haven't actually shared this with anyone so don't mind any ugliness. However I generally make it a rule for myself to comment everything, so you hopefully shouldn't have a problem figuring the stuff out. [URL="http://dl.dropbox.com/u/10657252/Libtcodtesting.rar"]Here's the download[/URL]. I use CodeBlocks and I didn't feel like removing all the irrelevant files, so just ignore them if you don't need them. If you don't feel like compiling the code, just go to bin/debug and the executable there should be ready to go.[/QUOTE] I also use CodeBlocks, thanks a lot!
Wrote up some primitive input methods and a login 'random'. If you're unfamiliar with rs bot terminology, there are these locations known as randoms which the player would be abducted to at random times and made to complete a challenge which was purposely made difficult for a bot. These 'random' scripts had a method which was called periodically (every few seconds) in an attempt to detect this random. A login script was usually also made a random due to its similar nature, somewhat. [img]http://puu.sh/dogI[/img] Yeah, I should probably make it move the mouse instead of teleporting it sometime soon.
Sorry, you need to Log In to post a reply to this thread.