What Are You Working On? V10 -- April 2012 Edition
313 replies, posted
these name popups are really nice share code plz? <3
I generally am a closed source guy but whatever, enjoy!
[lua]
/*
* Project - VOIDLink
* Source code released publicly on facepunch by maurits150.
*/
surface.CreateFont("Arial", 16, 700, true, false, "VOIDLink_NamesFont")
local iWhite = surface.GetTextureID("VGUI/white")
local function DrawBubble(iPosX, iPosY, strText, iAlpha)
surface.SetFont("VOIDLink_NamesFont")
local w, h = surface.GetTextSize(strText)
iPosY = iPosY - 20
iPosX = iPosX + 10
draw.RoundedBox(4, iPosX - 6, iPosY - 4 - h, w + 12, h + 8, Color(40, 40, 40, iAlpha))
draw.RoundedBox(4, iPosX - 4, iPosY - 2 - h, w + 8, h + 4, Color(112, 149, 53, iAlpha))
iPosY = iPosY + 20
iPosX = iPosX - 10
surface.SetTexture(iWhite)
surface.SetDrawColor(Color(0, 0, 0, iAlpha))
surface.DrawPoly(
{
[1] = {
x = iPosX + 6,
y = iPosY - 18,
u = 0,
v = 0,
},
[2] = {
x = iPosX + 26,
y = iPosY - 18,
u = 1,
v = 0,
},
[3] = {
x = iPosX - 2,
y = iPosY + 4,
u = 0,
v = 1,
},
}
)
surface.SetDrawColor(Color(112, 149, 53, iAlpha))
surface.DrawPoly(
{
[1] = {
x = iPosX + 8,
y = iPosY - 19,
u = 0,
v = 0,
},
[2] = {
x = iPosX + 24,
y = iPosY - 19,
u = 1,
v = 0,
},
[3] = {
x = iPosX,
y = iPosY,
u = 0,
v = 1,
},
}
)
iPosY = iPosY - 20
iPosX = iPosX + 10
surface.SetTextColor(Color(0, 0, 0, iAlpha))
surface.SetTextPos(iPosX - 1, iPosY - h - 1 + 1)
surface.DrawText(strText)
surface.SetTextColor(Color(255, 255, 255, iAlpha))
surface.SetTextPos(iPosX, iPosY - h + 1)
surface.DrawText(strText)
end
function VOIDLink_Names()
for k, v in pairs(player.GetAll()) do
if v == LocalPlayer() then continue end
local b = v:LookupBone("ValveBiped.Bip01_Head1")
local vPos = (b && v:GetBonePosition(b)) || v:GetPos()
vPos = vPos + Vector(0, 0, 5)
local x, y = vPos:ToScreen().x, vPos:ToScreen().y
local iAlpha = 255 - math.Clamp(v:GetPos():Distance(LocalPlayer():GetPos()) * 0.1, 100, 200)
DrawBubble(x, y, v:Nick(), iAlpha)
end
end
hook.Add("HUDPaint", "VOIDLink.Names()", VOIDLink_Names)
[/lua]
[QUOTE=Hentie;35652237]Hey man how else are you going to demonstrate cannabis?
I just saw all the shitty cannabis mods in RP servers and see how fucking inaccurate they all are, I just thought I'd recreate it as someone who actually took some first hand.[/QUOTE]
I thought he was farting or something. The way he lifts his leg then black gas coming out the next second. I never connected cannabis to that video, just a fat dutch who ate a donut farting.
[media]http://www.youtube.com/watch?v=I928ie6HOLg[/media]
I changed the melon :D
Flesh balls?
Meatballs!
[editline]penis[/editline]
Did anyone else get a problem where you couldn't call a scripted npc's user-defined functions if you grab the npc from ents.GetAll()?
I had to fix that by running this:
[lua]
NPCMETA = _R[ "NPC" ]
NPCMETA__index = NPCMETA__index or NPCMETA.__index;
NPCMETA.__index = function( self, key )
local ret = NPCMETA__index( self, key );
if not ret then
local class = scripted_ents.Get( self:GetClass() );
if ( ValidEntity( self ) and class and class[key] ) then
return class[key];
end
end
return ret;
end
[/lua]
I was bored so I made this script that loads the lrc file for a song, nothing special.
[media]http://www.youtube.com/watch?v=2TIW7N3gVss[/media]
[code]
[00:00.01]Take On Me
[00:04.02]A-Ha
[00:08.04]..........
[00:34.36]We're talking away
[00:37.46]I don't know what
[00:39.14]I'm to say I'll say it anyway
[00:43.13]Today's another day to find you
[00:46.42]Shying away
[00:49.27]I'll be coming for your love, OK?
[00:51.89]Take on me (take on me)
[00:57.57]Take me on (take on me)
[01:03.23]I'll be gone
[01:08.10]In a day or two
[01:14.05]So needless to say
[01:17.20]I'm odds and ends
[01:18.102]But I'll be stumbling away
[01:23.03]Slowly learning that life is OK.
[01:25.97]Say after me
[01:29.08]It's no better to be safe than sorry
[01:31.63]Take on me (take on me)
[01:37.40]Take me on (take on me)
[01:42.94]I'll be gone
[01:47.62]In a day or two
[02:33.71]Oh the things that you say
[02:36.93]Is it live or
[02:38.44]Just to play my worries away
[02:42.40]You're all the things I've got to remember
[02:45.65]You're shying away
[02:48.62]I'll be coming for you anyway
[02:51.16]Take on me (take on me)
[02:56.79]Take me on (take on me)
[03:02.54]I'll be gone
[03:07.47]In a day
[03:12.41]Take on me (take me one)
[03:19.51]I'll be gone (take on me)
[03:24.46]In a day
[/code]
Watch out! Singstar gamemodes are coming.
[QUOTE=Thermadyle;35674558]I was bored so I made this script that loads the lrc file for a song, nothing special.
[media]http://www.youtube.com/watch?v=2TIW7N3gVss[/media]
[code]
[00:00.01]Take On Me
[00:04.02]A-Ha
[00:08.04]..........
[00:34.36]We're talking away
[00:37.46]I don't know what
[00:39.14]I'm to say I'll say it anyway
[00:43.13]Today's another day to find you
[00:46.42]Shying away
[00:49.27]I'll be coming for your love, OK?
[00:51.89]Take on me (take on me)
[00:57.57]Take me on (take on me)
[01:03.23]I'll be gone
[01:08.10]In a day or two
[01:14.05]So needless to say
[01:17.20]I'm odds and ends
[01:18.102]But I'll be stumbling away
[01:23.03]Slowly learning that life is OK.
[01:25.97]Say after me
[01:29.08]It's no better to be safe than sorry
[01:31.63]Take on me (take on me)
[01:37.40]Take me on (take on me)
[01:42.94]I'll be gone
[01:47.62]In a day or two
[02:33.71]Oh the things that you say
[02:36.93]Is it live or
[02:38.44]Just to play my worries away
[02:42.40]You're all the things I've got to remember
[02:45.65]You're shying away
[02:48.62]I'll be coming for you anyway
[02:51.16]Take on me (take on me)
[02:56.79]Take me on (take on me)
[03:02.54]I'll be gone
[03:07.47]In a day
[03:12.41]Take on me (take me one)
[03:19.51]I'll be gone (take on me)
[03:24.46]In a day
[/code][/QUOTE]
Needs progress marker on the text(clip + draw text twice).
[QUOTE=Wizard of Ass;35675597]Needs progress marker on the text(clip + draw text twice).[/QUOTE]
[media]http://www.youtube.com/watch?v=i-v7t2fWSzQ[/media]
I can not make it perfect since the lrc files does not contain enough information.
I am only using the time difference to the next line.
Your avatar that song something awful fishy is going on here.
[QUOTE=Thermadyle;35678346][media]http://www.youtube.com/watch?v=i-v7t2fWSzQ[/media]
I can not make it perfect since the lrc files does not contain enough information.
I am only using the time difference to the next line.[/QUOTE]
I suggest having the next line come up under the current one a second before the current one is replaced, that way the reader is able to get ready for the next line if it occurs directly afterwards.
So you guys know how the tank's animations are recycled from dog right?
[media]http://www.youtube.com/watch?v=cb5Judl3zQw&feature=youtu.be[/media]
It's going to look great once I bone merge a zombie model on there :P
Tickers look different now as well.
[img]http://puu.sh/r254[/img]
Is that coaster controlled with shadow physics, or is it just lerped positions?
Shadow physics, so it collides with things/kills things too.
Why are you using the pull chain sound all the time?
EDIT: Actually I'm unsure because of the music.. but it sounds like you are. :S
I'm not, only on the track part with the cable material. It's just a bit louder than the normal ride sound.
[QUOTE=FoohyAB;35681714]Shadow physics, so it collides with things/kills things too.[/QUOTE]
Only thing that's kinda missing is rolling.
I had an idea for an indicator that would be helpful for exactly this.
It would include using dynamic mashes to indicate the orientation.
[QUOTE=FoohyAB;35681614][video=youtube;153MKcWLveU]http://www.youtube.com/watch?v=153MKcWLveU[/video][/QUOTE]
What happened to that Double Jump and Flip you coded ages ago? *curious*
Also, awesome rollercoasters.
The RCT music made it more awesome.
[QUOTE=GameAdict;35686493]What happened to that Double Jump and Flip you coded ages ago? *curious*
Also, awesome rollercoasters.[/QUOTE]
Oh, didn't know anyone actually wanted it :v:, I have this bad habit of not releasing things because I have a low coding-quality esteem.
But that's old enough I can make the excuse of old habits, so here you go: [url]http://dl.dropbox.com/u/1179448/Files/ratchet_flip.lua[/url]
[editline]23rd April 2012[/editline]
[QUOTE=Wizard of Ass;35686247]Only thing that's kinda missing is rolling.
I had an idea for an indicator that would be helpful for exactly this.
It would include using dynamic mashes to indicate the orientation.[/QUOTE]
I [i]really[/i] want to make a dynamicly generated mesh track, but I don't really know enough about meshes/assembling them to look like a track to do it.
[QUOTE=GeekDeer;35660890]Wow thanks for remaking this, I fuck**g love you !
if you want I can be a beta tester for this !
And please add more feature from imagination it would be verry cool ![/QUOTE]
...
o_q you don't say.
Anyway, I've made great strides with it, actually. All that I really need to fix to be ready to release the [del]first[/del] fourth version is to somehow change the length of the constraint that the climb rope uses (and move the attach point so it doesn't look like you're hanging yourself >_>')
Here's a list of features: (oh lord how do make lists)
Ragdolization (the term used for turning into a RM ragdoll) on damage, speed, fall, command.
PP and CoD killcam-esque Afterdeath mode during death.
Kill-counter that resets on spawn (part of Afterdeath).
Damage fixer (ex. attempts to replace inflicter with attacker's weapon if applicable) that also fixes damage while ragdolized
Hold W to crawl, S to act a fool and seizure about.
Oxygen with depletion/repletion.
1 in 10 chance of catching on fire when exploded.
Misc other fixes for bugs that the original RagMod v3b had.
Climb Rope SWep (currently does not work to its full capacity (should be able to be reeled in and out but I can't find out how to do that T_T)).
Light decapitation system that looks silly because you can decap bones with non-decapped bones still attached.
Effects (rm_Decapitation, rm_HeadDecapitation, rm_BloodSpurt, rm_BloodDrip).
A cvar for pretty much [i]everything[/i]. I swear, there's almost too many.
...
That's all I can think of atm
Can you fellows think of any more features, effects, etc. that I could/should add? I want RM 2 v4 to be really impressive :u
Also I've pretty much added all the features of RagMod v3 besides prop surfing because that just seems extraordinarily silly to me. The Climb Rope SWep kinda defeats the purpose anyway. I might port/fix prop surfing if it's wanted enough, idk.
[editline]Somedate lol1[/editline]
[QUOTE=FoohyAB;35689944][url]http://dl.dropbox.com/u/1179448/Files/ratchet_flip.lua[/url][/QUOTE]
I noticed you are quite good at the luas. You wouldn't happen to know if it's possible to get child bones from parent bones, would you? i.e. getting the left foot bone from the left calf bone. I need to know how to do this so I can decap bones less sloppily. And I can't make this just for player models, I may implement NPC decapping and stuff later.
Thanks in advance!
[editline]Somedate lol2[/editline]
I made threads for [url=http://facepunch.com/threads/1178026]this[/url] [url=http://facepunch.com/threads/1177914]stuff[/url].
[editline]Somedate lol3[/editline]
I edit my posts too much and they get jumbled up asduhsdgfhdsf
I just r- fuu I forgot what I was going to type...
Oh yeah!
What is the function to kick/punch/shake/whatevers a player's camera, or am I going to have to make my own functionality?
[editline]Somedate lol4[/editline]
Also I should record a professional video organizing these features instead of that steaming pile I recorded for a friend
[editline]Somedate lol5[/editline]
werewolf0020 is a fag
[QUOTE=DarkShadow6;35692292]
I noticed you are quite good at the luas. You wouldn't happen to know if it's possible to get child bones from parent bones, would you? i.e. getting the left foot bone from the left calf bone. I need to know how to do this so I can decap bones less sloppily. And I can't make this just for player models, I may implement NPC decapping and stuff later.
Thanks in advance!
[/QUOTE]
Sorry, I don't really know a lot about bones and child bones. [img]http://sae.tweek.us/static/images/emoticons/frown.gif[/img]
Use my code:
[lua]
function tbone( ent )
local tbones = {};
for i = 1, ent:GetBoneCount() do
local p = ent:GetBoneParent( i );
tbones[p] = tbones[p] or {};
table.insert( tbones[p], i );
end
return tbones;
end
[/lua]
Then call something like
[lua]local tbones = tbone( ent );[/lua]
And getting the child bones is just
[lua]local tbones[bone_number_here];[/lua]
you get a table.
also don't mind the name "tbone"
I was just hungry.
[editline]23rd April 2012[/editline]
yay I finally got an official server with actual FTP access
helpzombies.nuclearfallout.net:27015
[QUOTE=FoohyAB;35692971]Sorry, I don't really know a lot about bones and child bones. [img]http://sae.tweek.us/static/images/emoticons/frown.gif[/img][/QUOTE]
I saw SetupBones and grasped at a straw; it's okey.
[QUOTE=Hentie;35693134]ent:GetBoneParent([/QUOTE]
*headdesk*
Why did I not try that.
I feel stupid now.
Thanks for this. Now I can just move my code into a function and decap each parent bone. We'll see how this goes.
[editline]No date! D:[/editline]
Also, do you know how to use constraints, or what methods they have? I was able to do pretty much everything else in RM successfully via my "fumble around, find something that works" method of scripting, but constraints elude me. I was going to just get all the methods using 4 nested for loops but then I remembered facepunch existed.
[QUOTE=Hentie;35693632][b][url=http://luasearch.netau.net/?list=constraint+libmatch&func=constraint.Weld]constraint.Weld [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b][/QUOTE]
local Constraint, Rope = constraint.Rope(Ply.rm_Ragdoll, Hook, 1, 0, Vector(8, 2, 0), Vector(0, 4, 21), RopeLength, 0, 0, 1, "cable/rope", false)
[url]http://facepunch.com/threads/1177914[/url]
[QUOTE=DarkShadow6;35693521]or what methods they have?[/QUOTE]
Specifically I don't know how to [i]use[/i] the Constraint or Rope entities that are returned, and there seems to be no documentation on such.
What ever happened to that I/O system that someone was making?
I forgot all about it and just remembered today, it was looking so good, but I completely forgot its name and who was making it.
[QUOTE=meazum;35693912]What ever happened to that I/O system that someone was making?
I forgot all about it and just remembered today, it was looking so good, but I completely forgot its name and who was making it.[/QUOTE]
I too would love to see it finished! It looked so much smoother than Wiremod. I think it was called chump'em or something.
Sorry, you need to Log In to post a reply to this thread.