-
Posts
3,946 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by macklebee
-
-
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?
-
Oh so your using CameraPick to pick the terrain and not LinePick to see if the terrain comes between 2 points. I assume that's different. This did work in older versions of LE because I'm copying the code I used in a C++ program I made.
So can anyone verify that the terrain is considered in LinePick?
yes terrain is considered with a linepick... so that just leaves your positioning of the camera thats causing the issue
-
i have the same issue as well... and i just perform a clean install with whisper's SDk downloader a couple of hours ago...
-
Well the thing is above it never hit the notify. So I did this:
local p = LinePick(EntityPosition(object.playerPivot, 1), EntityPosition(object.cameraPivot, 1), 0, 0) if p ~= nil then Notify(p.entity:GetClass()) end
This returns 1 for the barrel and it never hits the Notify() at all for the terrain. So LinePick is return a nil for picking the terrain. Do I need to do something with the terrain? It's not painted or anything.
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
-
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
-
This works if the barrel gets in the way between the playerPivot and cameraPivot.
if EntityVisible(object.playerPivot, object.cameraPivot) == 0 then local p = LinePick(EntityPosition(object.playerPivot, 1), EntityPosition(object.cameraPivot, 1), 0, 0) if p ~= nil then if p.entity:GetClass()==ENTITY_TERRAIN then Notify("Terrain") end PositionEntity(object.cameraPivot, Vec3(p.position.x, p.position.y, p.position.z), 1) PointEntity(object.cameraPivot, object.playerPivot, 3, 1, 0) MoveEntity(object.cameraPivot, Vec3(0, 0, 1)) end end
im confused... its working now? whats the difference between that and what i showed? cuz it looks to be fundamentally the same...
-
if pick.entity:GetClass()==ENTITY_TERRAIN then
Doesn't work for me. As it seems now the picking doesn't seem to work for me for the terrain. Any thoughts?
what does your pick command look like? because that code works for me... well at least it did the other day before the update...
-
beat me to it MG
-
As far I know those *_adjust.* shader files have never been published yet, and even I don't have them, but Framewerk uses them. Josh just needs to upload them to the sync.
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.
-
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?
-
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.
-
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...
-
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.
-
Why don't you print out the value of submersioncolor, then you see if it's empty or not.
i tried that already... I see nothing being returned as I would expect... but its still continuing with the code as if 'submersioncolor <> ""'
-
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.
-
@Mack: (and this time it's not on automatic question mode). Have you got some bmx sample code using framewerk? Similar to Marleys' scene loading example. I'd like to give it a try in blitzmax.
never mind... i see that you have bmx... give me one second and i will forward the code to you as a PM
-
Nope tried that you end up with:
Error: Shader file "abstract::postfilter_adjust.frag" not found.
not sure what its for or trying to do or where to turn it off.
weird.. i don't get that error in bmax.
-
@Tyler
Yes, of course. Vec3s needed. But it throws the error
already at the create method "Compile Error: Identifier 'Create' not found".
@ VicToMeyeZR
Thats just because the forum uncourteous changed code to comments.
I had to add a ' at the end of every comment and forget that one.
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?
-
Mack, any ideas on the "null framewerk" message? (besides reporting there's a null framewerk, ahahahah ).
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.
-
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)
-
Never mind, just takes some math.
so you got it? i think everyone would like to see it
-
I haven't started using LUA yet and I just downloaded and ran the latest update on a C++ program that was working fine last night and now I get an error.
ERROR: unable to find DLL function: GetLuaState.
When I hit 'enter', Vis C++ 2008 stops at CreateWorld() and gives this message:
Unhandled exception at 0x10126838 in program.exe: 0xC0000005: Access violation.
Is there something I should be doing with LUA to stop this error?
did you update all of the files you need inside your game directory? like the engine.dll, the engine.h, engine.cpp?
-
Just experimenting and I'm trying to get the terrain grid points from a mouse click/position. Not sure how to go about it yet, just started messing around, and starting to try cameraproject but I don't think that's going to work out. Anyone have any ideas?
where are you trying to do this? in a program or the editor?
for a lua program, this gives me the position of a pick for any entity class including terrain:
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 end
it should also work for bmax as well
-
hmmm... weird. if i take out the skybox it seems to load the firepit without the error, but the fire and heathaze are missing and the fire sound only plays one loop. If I have a skybox then I get the error.
ok... must have been an issue with my update... I performed a clean install and the firepit loads with the skybox now. I still do not have heathaze or fire, but I assume I will have to edit the firepit.lua to perform a GetGlobalObject for the transparency world...
Terrain Grid Points
in Programming
Posted
nice.