Jump to content

havenphillip

Members
  • Posts

    556
  • Joined

  • Last visited

Everything posted by havenphillip

  1. I have a camera pick I'm using the pickInfo.entity mode to signal the counter to add a kill but it doesn't stop at 1. I tried a table but it just reiterates the table until the camera moves away from the entity. What's the best way to count just 1 kill per enemy? This is my current: function Script:UpdateWorld() local pickInfo = PickInfo() self.proj = window:GetMousePosition() if self.camera:Pick(self.proj.x, self.proj.y, pickInfo, self.pickradius, true,2) then if pickInfo.entity:GetKeyValue("type") == "enemy" then if pickInfo.entity.script.mode ~= "dying" and pickInfo.entity.script.mode ~= "dead" then self.camPick = true elseif pickInfo.entity.script.mode == "dying" then --this is the problem. But what do I reference that will count just once? for i = 1,1,1 do self.kills = self.kills + i System:Print(i) end end end else self.camPick = false end end
  2. Nice. If it's not interacting the only things I can think of is whether the model has any physics set on it, and if Nav obstacle is set to true, and I think mass affects it, too.
  3. What's happening, specifically? Is it not even picking prop types? Or is it not allowing you to lift them on the mouse click, or what? Maybe there's something funky about using Vec3 p or something like the p.z needs to be greater or something? The index example just uses "GetMousePosition." If it's not picking prop types I've sometimes seen it written like: if (camera:Pick(p.x,p.y,pickinfo,pickradius,true,Collision.Prop)) then... local p = window:GetMousePosition() if (camera:Pick(p.x,p.y,pickinfo,pickradius,true)) then
  4. lol Yeah double post. I typed out a whole other bit of "helpful" nonsense but for some reason...
  5. I don't know C++ really well but if it's similar to Lua it looks like you have your pick radius set to 0? (cam->Pick(p.x, p.y, pickinfo, 0, true))
  6. I don't know C++ really well but if it's similar to Lua it looks like you have your pick radius set to 0? (cam->Pick(p.x, p.y, pickinfo, 0, true))
  7. I'm getting an error "txt" not allowed. I don't know what that's about.
  8. Those were pretty good. I did get that far.
  9. I looked for it I think maybe its been removed. Cool looking shader, though. Where do I go to learn how to make something like that?
  10. Nice little shader tutorial series I found. First four videos are just about setting it up so can skip. The shaders configured for Leadwerks below: Lewis Lepton.zip
  11. havenphillip

    Pawn

    Looks good, man. I dig that skybox, too.
  12. havenphillip

    Pawn

    That's cool, man. I like the lightning bolt. Something in this direction might look cool. I made this battery and wrote this up from an idea I got from a Shadmar post. Battery.zip
  13. havenphillip

    Pawn

    It looks cool but you gotta make a better battery.
  14. This is rad. Do it. I'll buy it.
  15. This is looking pretty cool. I kind of want to join this project.
  16. If you're childing a pivot to a foot, you could maybe add a script to it that uses Cabeza = self.entity:GetParent() and set the collision type etc. from there. Then you could reference it from your script above.
  17. havenphillip

    Vehicle

    https://steamcommunity.com/sharedfiles/filedetails/?id=345315752&searchtext=
  18. havenphillip

    Vehicle

    I've seen a few vehicle scripts in the workshop. Here's a few: https://steamcommunity.com/sharedfiles/filedetails/?id=1662222417
  19. havenphillip

    Pawn

    Dude how'd you get that reflective gloss on everything? That looks great.
  20. Thanks, dude. You got me started off in the right direction. #version 400 //Ma-Shell + //https://www.shadertoy.com/view/ldsGDn + //https://www.shadertoy.com/view/XdBBzh uniform sampler2D texture1; uniform float currenttime; uniform vec2 buffersize; uniform bool isbackbuffer; uniform mat4 projectioncameramatrix; float time=currenttime/1000.0; out vec4 fragData0; vec2 hash22(vec2 p){ vec2 p2 = fract(p * vec2(.1031,.1030)); p2 += dot(p2, p2.yx+19.19); return fract((p2.x+p2.y)*p2); } #define round(x) floor( (x) + .5 ) vec2 wetGlass(vec2 p) { p += p * 0.1; // distort drops float t = time; p *= vec2(.025, .025 * .25); p.y += t * .25; // make drops fall vec2 rp = round(p); vec2 dropPos = p - rp; vec2 noise = hash22(rp);//randomizes drop placement dropPos.y *= 4.; t = t * noise.y + (noise.x*6.28); vec2 trailPos = vec2(dropPos.x, fract((dropPos.y-t)*2.) * .5 - .25 ); dropPos.y += cos( t + cos(t) ); // make speed vary float trailMask = clamp(dropPos.y*2.5+.5,0.,1.); // hide trail in front of drop float dropSize = dot(dropPos,dropPos); float trailSize = clamp(trailMask*dropPos.y-0.5,0.,1.) + 0.5; trailSize = dot(trailPos,trailPos) * trailSize * trailSize; float drop = clamp(dropSize * -60.+ 3.*noise.y, 0., 1.); float trail = clamp(trailSize * -60.+ .5*noise.y, 0., 1.); trail *= trailMask; // hide trail in front of drop return drop * dropPos + trailPos * trail; } float rain(vec2 uv, float scale, float time) { float w=smoothstep(1.0,0.0,-uv.y*(scale/10.0)); if(w<0.2)return 0.0; uv+=time/scale; uv.y+=time*2.0/scale; uv.x+=sin(uv.y+time*.5)/scale; uv*=scale; vec2 s=floor(uv),f=fract(uv),p; float k=3.0,d; p=.5+.35*sin(11.0*fract(sin((s+scale)*mat2(vec2(7,3),vec2(6,5)))*7.0))-f; d=length(p); k=min(d,k); k=smoothstep(0.003,k,sin(f.x+f.y)*0.01); //particle size sort of return k*w; } void main(void) { vec2 uv=(gl_FragCoord.xy/buffersize); if (isbackbuffer) uv.y = 1.0 - uv.y; vec2 position = ( gl_FragCoord.xy - buffersize.xy* 0.5 ) / buffersize.x; position.y+=projectioncameramatrix[1][3]; position.y-=1.0; float angle = atan(position.y,position.x)/(0.5*3.14159265359); vec4 color = texture(texture1,uv); float c=smoothstep(1.0,0.3,clamp(uv.y*.3+.8,0.0,.75)); c+=rain(uv,20.0*angle,time)*.5; c+=rain(uv-5,15.0*angle,time)*.8; c+=rain(uv+5,10.0*angle,time); c+=rain(uv+7,8.0*angle,time); c+=rain(uv-5,6.0*angle,time); c+=rain(uv,4.0*angle,time); vec3 rainfall=(vec3(c)); uv += wetGlass(gl_FragCoord.xy/1.5); fragData0 = texture(texture1, uv)/1.5+vec4( rainfall.r+color )*.3; }
  21. I guess I should have clarified. I'm thinking in terms of using shaders on the terrain. For instance if I want it to rain and I want the dirt to change colors and gain a cubemap-like glossiness I could theoretically use a shader to do that attached to a material. Using textures is limited in that regard. Seems like it would be useful.
×
×
  • Create New...