Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. macklebee

    Framewerk

    if it was something as simple as him uploading the shaders.pak, i would assume it would have been done by now... between simple functionality not working in the editor to programs crashing now that worked two days ago, this points to something more than just a shader problem... but without some kind of ackowledgement from the only person that knows what is going on, who can really say what the issue is or how long its going to take or how exactly the stuff you are working on right now is going to be affected by whatever it takes to fix the problems...
  2. Tyler, how are you preventing the old problem of the shot object from changing colors or getting streaks on it? what does your material file look like for the decal?
  3. macklebee

    LinePick

    well it returns the correct values for me whenever i use linepick... require("Scripts/constants/collision_const") require("Scripts/constants/engine_const") require("Scripts/LinkedList") require("Scripts/filesystem") require("Scripts/math/math") require("scripts/classes/bullet") --Variables dx=0.0 dy=0.0 camerapitch=0.0 camerayaw=0.0 move=0.0 strafe=0.0 --Create a player controller controller=CreateController(1.8,0.45,0.25,45) controller:SetCollisionType(COLLISION_CHARACTER,0) controller:SetPositionf(0,2,0,0) controller:SetMass(10) controller:SetPosition(fw.main.camera.position) camerapitch=fw.main.camera.rotation.x camerayaw=fw.main.camera.rotation.y controller:Move(Vec3(0,-0.9,0)) local gunscale=0.6 local vwep = LoadMesh("abstract::vwep_hands.gmf") LoadMesh("abstract::vwep_gun.gmf",vwep) vwep:SetParent(fw.main.camera,0) vwep:SetPosition(Vec3(-0.18*gunscale,-0.03*gunscale,0.37*gunscale),0) vwep:SetScale(Vec3(0.04*gunscale,0.04*gunscale,0.04*gunscale)) local gundisplayposition = vwep:GetPosition() sound_gunshot = LoadSound("abstract::gunshot.ogg") source_gunshot = CreateSource(sound_gunshot) source_gunshot:SetVolume(0.5) vwep :SetShadowMode(0,1) local displayposition=Vec3(-0.26/2.0,-0.03,0.19) local muzzleflash = CreatePointLight(3) muzzleflash:SetParent( vwep ) muzzleflash:SetColor(Vec4(1,0.6,0.0,1.0)) muzzleflash:SetPosition( displayposition ) muzzleflash:SetShadowMode(0) HideMouse() MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) FlushKeys() FlushMouse() local pick local camera = fw.main.camera local remainingtime local starttime=AppTime() local gameduration=2--length of game in minutes local gamemode=0 gunpos = vwep.position:Copy() local smoothedgunswayamplitude=0.0 local smoothedgunswayspeed =0.0 local guntime = 0.0 local recoil = 0.0 local lastfiretime=0.0 local smoothrecoil=0.0 local swaydamping=0.0 local smoothswaydamping=0.0 local lightsmoothing =0.0 local gunlight = 0.0 --Flashlight flashlight = {} flashlight.light = CreateSpotLight(8) flashlight.light:Hide() flashlight.sound_switch = LoadSound("abstract::switch.wav") flashlight.state=0 flashlight.light:SetConeAngles(30,35) flashlight.light:SetRotation(Vec3(5,0,0)) flashlight.light:SetShadowmapSize(512) flashlight.light:Paint(LoadMaterial("abstract::flashlight.mat")) function flashlight:SetState( state ) if state~=self.state then self.state=state if state==0 then self.light:Hide() else self.light:Show() end if self.sound_switch~=nil then self.sound_switch:Play() end end end function ShootBullet( position, direction ) -- local speed=100.0 -- local pick = LinePick( position, Vec3(position.x+direction.x * speed) ) end cube = CreateCube() MoveEntity(cube,Vec3(0,1,0)) --main function while KeyHit(KEY_ESCAPE)==0 do jump=KeyHit(KEY_SPACE)*6.0 if controller:IsAirborne()==1 then jump=0 end local time = AppTime()/3200.0 local frame = time*(179.0-96.0)+96.0 frame=clamp( frame, 96, 179 ) vwep:Animate(96,1,0,1) --Camera look gx=round(GraphicsWidth()/2) gy=round(GraphicsHeight()/2) dx=Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed()) dy=Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed()) MoveMouse(gx,gy) camerapitch=camerapitch+dy camerayaw=camerayaw-dx camerapitch=math.min(camerapitch,90) camerapitch=math.max(camerapitch,-90) fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1) movespeed=6 movesmoothing=10 if controller:IsAirborne()==1 then movesmoothing=200 end --Player movement move=Curve( (KeyDown(KEY_W)-KeyDown(KEY_S))*movespeed,move,movesmoothing) strafe=Curve( (KeyDown(KEY_D)-KeyDown(KEY_A))*movespeed,strafe,movesmoothing) --pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,1000.0),0,0) local pick = LinePick(EntityPosition(fw.main.camera, 1), EntityPosition(cube, 1), 0, 0) if pick~=nil then pick_posX=pick.position.x pick_posY=pick.position.y pick_posZ=pick.position.z pvalue = pick.entity:GetClass() end --Use objects if KeyHit(KEY_E)==1 then if pick~=nil then repeat if pick.entity:GetClass()==ENTITY_MODEL then break end pick.entity=pick.entity.parent until pick.entity==nil if pick.entity~=nil then pick.entity:SendMessage("use",controller,0) end end end --Update controller controller:Update(camerayaw,move,strafe,jump,40,10) fw:Update() if KeyHit(KEY_F)==1 then flashlight:SetState(1-flashlight.state) end --Position camera camera:SetPositionf(controller.position.x,controller.position.y+0.8,controller.position.z,1) time=AppTime() gunfirefrequency=80 gunswayspeed=0.001*20.0 gunoffset = gunpos:Copy() gunswayamplitude = 0.02 if KeyDown(KEY_W)==1 or KeyDown(KEY_D)==1 or KeyDown(KEY_A)==1 or KeyDown(KEY_S)==1 then gunswayamplitude = 0.03 gunswayspeed=0.005*20.0 end smoothedgunswayamplitude = Curve( gunswayamplitude, smoothedgunswayamplitude,8.0 ) smoothedgunswayspeed = Curve( gunswayspeed, smoothedgunswayspeed,8.0 ) if smoothrecoil<0.001 then guntime = guntime + AppSpeed() * smoothedgunswayspeed * math.max(0.0,1.0 - smoothswaydamping) end gunoffset.z = gunoffset.z - smoothrecoil * 0.05 --smoothedgunswayamplitude = smoothedgunswayamplitude * (1.0 - smoothswaydamping) gunoffset.x = gunoffset.x + math.sin( guntime ) * smoothedgunswayamplitude * gunscale gunoffset.y = gunoffset.y + (1.0-math.cos( guntime*2.0 )) * 0.005 * gunscale-- * math.min(1.0,1.0 - smoothswaydamping)) vwep:SetPosition( gunoffset ) recoil = recoil-0.1 swaydamping = math.max( swaydamping - 0.05, 0.0 ) recoil = math.max(recoil,0.0) smoothrecoil=Curve(recoil,smoothrecoil,3.0) smoothswaydamping = inc( swaydamping ,smoothswaydamping,0.01 ) gunlight = math.max( gunlight- 0.2, 0.0 ) lightsmoothing =gunlight-- Curve(gunlight,lightsmoothing,8.0) muzzleflash:SetColor(Vec4(1.0*lightsmoothing,0.6*lightsmoothing,0.0,1.0)) if lightsmoothing <0.01 then muzzleflash:Hide() end if MouseDown(1)==1 then if AppTime()-lastfiretime>gunfirefrequency then recoil = 1.0 lastfiretime=AppTime()+math.random(0,20) gunswayspeed=0.0 gunlight = 1.0 source_gunshot:Play() source_gunshot:SetPitch(1.0 + (math.random()-0.5)*0.05 ) swaydamping = 1.0 muzzleflash:Show() CreateBullet(vwep:GetPosition(1) , fw.main.camera.mat:K():Scale(300)) end end UpdateBullets() flashlight.light:SetPosition(fw.main.camera:GetPosition(1)) flashlight.light:SetRotationf( curveangle( fw.main.camera.rotation.x, flashlight.light.rotation.x, 3.0/AppSpeed() ), curveangle( fw.main.camera.rotation.y, flashlight.light.rotation.y, 3.0/AppSpeed() ) ) flashlight.light:Movef(-0.07,-0.04,0.02) fw:Render() DrawText(pick_posX,0,100) DrawText(pick_posY,0,120) DrawText(pick_posZ,0,140) DrawText(pvalue,0,160) Flip(0) end controller:Free() vwep:Free() ShowMouse() I don't know... without seeing useable code to see exactly what you are doing I am just guessing... maybe its a problem with your positioning if there is a collision, maybe its an issue with the unnecessary pivots? why not just parent the camera to the player and be done with it?
  4. macklebee

    LinePick

    yes terrain is considered with a linepick... so that just leaves your positioning of the camera thats causing the issue
  5. i have the same issue as well... and i just perform a clean install with whisper's SDk downloader a couple of hours ago...
  6. macklebee

    LinePick

    no its doesn't need to be painted... maybe its the type of pick itself? try this code that uses the CameraPick: require("Scripts/constants/collision_const") require("Scripts/constants/engine_const") require("Scripts/LinkedList") require("Scripts/filesystem") require("Scripts/math/math") require("scripts/classes/bullet") --Variables dx=0.0 dy=0.0 camerapitch=0.0 camerayaw=0.0 move=0.0 strafe=0.0 --Create a player controller controller=CreateController(1.8,0.45,0.25,45) controller:SetCollisionType(COLLISION_CHARACTER,0) controller:SetPositionf(0,2,0,0) controller:SetMass(10) controller:SetPosition(fw.main.camera.position) camerapitch=fw.main.camera.rotation.x camerayaw=fw.main.camera.rotation.y controller:Move(Vec3(0,-0.9,0)) local gunscale=0.6 local vwep = LoadMesh("abstract::vwep_hands.gmf") LoadMesh("abstract::vwep_gun.gmf",vwep) vwep:SetParent(fw.main.camera,0) vwep:SetPosition(Vec3(-0.18*gunscale,-0.03*gunscale,0.37*gunscale),0) vwep:SetScale(Vec3(0.04*gunscale,0.04*gunscale,0.04*gunscale)) local gundisplayposition = vwep:GetPosition() sound_gunshot = LoadSound("abstract::gunshot.ogg") source_gunshot = CreateSource(sound_gunshot) source_gunshot:SetVolume(0.5) vwep :SetShadowMode(0,1) local displayposition=Vec3(-0.26/2.0,-0.03,0.19) local muzzleflash = CreatePointLight(3) muzzleflash:SetParent( vwep ) muzzleflash:SetColor(Vec4(1,0.6,0.0,1.0)) muzzleflash:SetPosition( displayposition ) muzzleflash:SetShadowMode(0) HideMouse() MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) FlushKeys() FlushMouse() local pick local camera = fw.main.camera local remainingtime local starttime=AppTime() local gameduration=2--length of game in minutes local gamemode=0 gunpos = vwep.position:Copy() local smoothedgunswayamplitude=0.0 local smoothedgunswayspeed =0.0 local guntime = 0.0 local recoil = 0.0 local lastfiretime=0.0 local smoothrecoil=0.0 local swaydamping=0.0 local smoothswaydamping=0.0 local lightsmoothing =0.0 local gunlight = 0.0 --Flashlight flashlight = {} flashlight.light = CreateSpotLight(8) flashlight.light:Hide() flashlight.sound_switch = LoadSound("abstract::switch.wav") flashlight.state=0 flashlight.light:SetConeAngles(30,35) flashlight.light:SetRotation(Vec3(5,0,0)) flashlight.light:SetShadowmapSize(512) flashlight.light:Paint(LoadMaterial("abstract::flashlight.mat")) function flashlight:SetState( state ) if state~=self.state then self.state=state if state==0 then self.light:Hide() else self.light:Show() end if self.sound_switch~=nil then self.sound_switch:Play() end end end function ShootBullet( position, direction ) -- local speed=100.0 -- local pick = LinePick( position, Vec3(position.x+direction.x * speed) ) end --main function while KeyHit(KEY_ESCAPE)==0 do jump=KeyHit(KEY_SPACE)*6.0 if controller:IsAirborne()==1 then jump=0 end local time = AppTime()/3200.0 local frame = time*(179.0-96.0)+96.0 frame=clamp( frame, 96, 179 ) vwep:Animate(96,1,0,1) --Camera look gx=round(GraphicsWidth()/2) gy=round(GraphicsHeight()/2) dx=Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed()) dy=Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed()) MoveMouse(gx,gy) camerapitch=camerapitch+dy camerayaw=camerayaw-dx camerapitch=math.min(camerapitch,90) camerapitch=math.max(camerapitch,-90) fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1) movespeed=6 movesmoothing=10 if controller:IsAirborne()==1 then movesmoothing=200 end --Player movement move=Curve( (KeyDown(KEY_W)-KeyDown(KEY_S))*movespeed,move,movesmoothing) strafe=Curve( (KeyDown(KEY_D)-KeyDown(KEY_A))*movespeed,strafe,movesmoothing) pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,1000.0),0,0) if pick~=nil then pick_posX=pick.position.x pick_posY=pick.position.y pick_posZ=pick.position.z pvalue = pick.entity:GetClass() end --Use objects if KeyHit(KEY_E)==1 then if pick~=nil then repeat if pick.entity:GetClass()==ENTITY_MODEL then break end pick.entity=pick.entity.parent until pick.entity==nil if pick.entity~=nil then pick.entity:SendMessage("use",controller,0) end end end --Update controller controller:Update(camerayaw,move,strafe,jump,40,10) fw:Update() if KeyHit(KEY_F)==1 then flashlight:SetState(1-flashlight.state) end --Position camera camera:SetPositionf(controller.position.x,controller.position.y+0.8,controller.position.z,1) time=AppTime() gunfirefrequency=80 gunswayspeed=0.001*20.0 gunoffset = gunpos:Copy() gunswayamplitude = 0.02 if KeyDown(KEY_W)==1 or KeyDown(KEY_D)==1 or KeyDown(KEY_A)==1 or KeyDown(KEY_S)==1 then gunswayamplitude = 0.03 gunswayspeed=0.005*20.0 end smoothedgunswayamplitude = Curve( gunswayamplitude, smoothedgunswayamplitude,8.0 ) smoothedgunswayspeed = Curve( gunswayspeed, smoothedgunswayspeed,8.0 ) if smoothrecoil<0.001 then guntime = guntime + AppSpeed() * smoothedgunswayspeed * math.max(0.0,1.0 - smoothswaydamping) end gunoffset.z = gunoffset.z - smoothrecoil * 0.05 --smoothedgunswayamplitude = smoothedgunswayamplitude * (1.0 - smoothswaydamping) gunoffset.x = gunoffset.x + math.sin( guntime ) * smoothedgunswayamplitude * gunscale gunoffset.y = gunoffset.y + (1.0-math.cos( guntime*2.0 )) * 0.005 * gunscale-- * math.min(1.0,1.0 - smoothswaydamping)) vwep:SetPosition( gunoffset ) recoil = recoil-0.1 swaydamping = math.max( swaydamping - 0.05, 0.0 ) recoil = math.max(recoil,0.0) smoothrecoil=Curve(recoil,smoothrecoil,3.0) smoothswaydamping = inc( swaydamping ,smoothswaydamping,0.01 ) gunlight = math.max( gunlight- 0.2, 0.0 ) lightsmoothing =gunlight-- Curve(gunlight,lightsmoothing,8.0) muzzleflash:SetColor(Vec4(1.0*lightsmoothing,0.6*lightsmoothing,0.0,1.0)) if lightsmoothing <0.01 then muzzleflash:Hide() end if MouseDown(1)==1 then if AppTime()-lastfiretime>gunfirefrequency then recoil = 1.0 lastfiretime=AppTime()+math.random(0,20) gunswayspeed=0.0 gunlight = 1.0 source_gunshot:Play() source_gunshot:SetPitch(1.0 + (math.random()-0.5)*0.05 ) swaydamping = 1.0 muzzleflash:Show() CreateBullet(vwep:GetPosition(1) , fw.main.camera.mat:K():Scale(300)) end end UpdateBullets() flashlight.light:SetPosition(fw.main.camera:GetPosition(1)) flashlight.light:SetRotationf( curveangle( fw.main.camera.rotation.x, flashlight.light.rotation.x, 3.0/AppSpeed() ), curveangle( fw.main.camera.rotation.y, flashlight.light.rotation.y, 3.0/AppSpeed() ) ) flashlight.light:Movef(-0.07,-0.04,0.02) fw:Render() DrawText(pick_posX,0,100) DrawText(pick_posY,0,120) DrawText(pick_posZ,0,140) DrawText(pvalue,0,160) Flip(0) end controller:Free() vwep:Free() ShowMouse() this works for me... shows the terrain when its picked and a model
  7. macklebee

    LinePick

    do pvalue = p.entity:GetClass() and print out the value of pvalue when you are picking on a terrain... it should be 16 according to the engine_const.lua file
  8. macklebee

    LinePick

    im confused... its working now? whats the difference between that and what i showed? cuz it looks to be fundamentally the same...
  9. macklebee

    LinePick

    what does your pick command look like? because that code works for me... well at least it did the other day before the update...
  10. macklebee

    Framewerk

    yes, i am thinking that this might be the issue thats causing me to get my error in bmax as well as the errors everyone is getting in c++. The only difference is in bmax it doesn't show those shaders trying to be loaded. So I don't know if that means the bmx framewerk has been updated? but in any case whenever I get an error it says its in Josh's ShaderReference.bmx file. This occurs if I load a firepit into my scene. If I don't do that then I don't get errors, but then also emitters do not work. People have been posting about the shader issue since last night. Either a fix or at least some recognition from Josh that he is working on the problem would be nice, because as things stand the new update has LE broken right now.
  11. macklebee

    Framewerk

    anybody else having any luck with this? so far i have been having errors and crashes... and it looks like its pointing to shader issues... I have done a clean install 3 times now and still have the same problem. Has the new shader.pak been uploaded yet?
  12. macklebee

    2.3 Sync

    I am still getting GL_Invalid_Value errors whenever I try to load a map with a bmx program. It appears to be related to shaders. If I have a firepit in my scene, I get the error stating "A bug inside the file [C:\Documents and Settings\Josh\Desktop\Projects\Engine\Source\ShaderReference.bmx] can't be debugged because the original source is missing. Without the firepit, it appears to work ok from the small amount I have tested. But I also notice that a simple emitter doesn't show up either.
  13. hmmm... ok... i apparently was using the old 2.3 stuff when i said it was working because now its still failing with the occasional GL_INVALID_VALUE error...
  14. also just as a test I ran the program with the "old" 2.3 SDK stuff and it works correctly. edit-- ive tried that as well... and even putting characters in the default and checking for the character in the if-statement... its not working... i take the exact same program and use it with the old 2.3 and it works.
  15. i tried that already... I see nothing being returned as I would expect... but its still continuing with the code as if 'submersioncolor <> ""'
  16. Has something changed with the GetKey/GetEntityKey return of a default when a key isn't found when parsing a SBX file? The same code that I was using yesterday to set the sky and water no longer functions correctly now. It always tries to load the water no matter what, even if there isn't a waterplane in the SBX file. Function ProcessScene(scene:TEntity) For entity = EachIn scene.kids Local skymaterial:String = entity.GetKey("skymaterial", "") 'only the sky will have a skymaterial property If skymaterial <> "" skymaterial = "abstract::" + skymaterial fw.renderer.SetSkybox(LoadMaterial(skymaterial)) Local camrange:TVec2 = StringToVec2(entity.GetKey("camerarange", "0.1,1000.0")) CameraRange(fw.Main.camera, camrange.X, camrange.Y) Local fogmode:Int = entity.GetKey("fogmode", "0").ToInt() If fogmode = 1 fw.renderer.SetDistanceFog(fogmode) Local fogangle:TVec2 = StringToVec2(entity.GetKey("fogangle", "0.0,15.0"), 1.0) fw.renderer.SetDistanceFogAngle(fogangle) Local fogcolor:TVec4 = StringToVec4(entity.GetKey("fogcolor", "255,255,255,255"), 1.0 / 255) fw.renderer.SetDistanceFogColor(fogcolor) Local fogrange:TVec2 = StringToVec2(entity.GetKey("fogrange", "0.0,1000.0"), 1.0) fw.renderer.SetDistanceFogRange(fogrange) End If EndIf Local submersioncolor:String = GetEntityKey(entity, "submersioncolor", "") If submersioncolor <> "" fw.renderer.SetWater(1) 'because if there is a submersioncolor then there is water fw.renderer.SetCaustics(1) 'optional, but it looks really nice Local watercolor:TVec4 = StringToVec4(entity.getkey("color", "255,255,255,255"), 1.0 / 255) fw.renderer.SetWaterColor(watercolor, StringToVec4(submersioncolor, 1.0 / 255)) Local waterheight:TVec3 = EntityPosition(entity) 'get waterheight from the waterplane.gmf position fw.renderer.SetWaterHeight(waterheight.Y) Local softness:Float = entity.GetKey("softness", "1.0").ToFloat() fw.renderer.SetWaterSoftness(softness) Local visibility:TVec2 = StringToVec2(entity.getkey("visibility", "0,20"), 1.0) fw.renderer.SetWaterVisibility(visibility) Local wavespeed:Float = entity.GetKey("wavespeed", "1.0").ToFloat() fw.renderer.SetWaterWaveSpeed(wavespeed) End If Next End Function This code worked correctly before but now its like something is being returned as the default differently due to the new 2.3 update last night... I have tried it both ways with GetKey and GetEntityKey and it makes no difference.
  17. macklebee

    Framewerk

    never mind... i see that you have bmx... give me one second and i will forward the code to you as a PM
  18. macklebee

    Framewerk

    weird.. i don't get that error in bmax.
  19. don't know if i am following this correctly but couldn't you create a mesh at the size you want, then just get the AABB of the mesh using GetEntityAABB?
  20. macklebee

    Framewerk

    eh, i can't speak for the c++ program you are using... but in my bmax program i am not doing any postprocessing at the moment and i don't get that error. If you remove (or comment out) all of the postprocessing (not just turn it off) it should remove your reliance on these shaders for the moment. Im sure Josh will upload the new shader pack once he gets up. postprocessing might not be the correct term... i am referring to commenting out stuff like hdr, ssao, bloom, etc... that you set with framewerk.
  21. macklebee

    2.3 Sync

    yes... adding this to the 'function class:CreateObject(model)' inside firepit.lua allows me to see the heathaze and fire now in a bmax program. --Create emitters if world_transparency==nil then world_transparency=GetGlobalObject("world_transparency") end if world_main ==nil then world_main=GetGlobalObject("world_main") end as before this still requires that the worlds be set as globals inside the bmax program. SetGlobalObject("world_main", fw.Main.world) SetGlobalObject("world_transparency", fw.transparency.world)
  22. so you got it? i think everyone would like to see it
  23. did you update all of the files you need inside your game directory? like the engine.dll, the engine.h, engine.cpp?
×
×
  • Create New...