Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. you will also need to add the camera's position to this resulting TFormVector position when you are setting the position of the picked entity.
  2. Just set the properties of the directional light like color, rotation, etc inside the editor. One of the reasons to use the editor is to instantly see realtime results. If you set up the directional light like you want inside the editor, it should look the same whenever you load the SBX file with your program.
  3. are you loading a SBX file or are you just loading the model in your program? I am asking because I can see from your first picture that you have a directional light in the editor scene...
  4. how many directional lights do you have in the scene for your program? Are you creating a directional light in the program and also loading a directional light from the SBX file? multiple directional lights in a scene cause this flattening affect... it is a known bug...
  5. http://leadwerks.com/werkspace/index.php?/topic/1228-ssdo-filter/page__view__findpost__p__11438
  6. Look inside the Leadwerks Evaluation folder that you installed and double-click the file "oalinst.exe". This should fix the error you are getting.
  7. Ultimate Unwrap 3D will allow you to convert them to GMF which is the only format compatible with the current LE.
  8. perhaps you have another sbx file of the same name? Try hardcoding the path to the file... scene = LoadScene("Maps/camerapath.sbx") just know I can load my maps without any issues... what are you setting the abstract path to? require("Scripts/constants/collision_const") require("Scripts/constants/engine_const") require("Scripts/math/math") RegisterAbstractPath("") Graphics(800,600) fw=CreateFramework() scene=LoadScene("Maps/train.sbx") controller=CreateController(1.8,0.45,0.25,45,0.9) controller:SetCollisionType(COLLISION_CHARACTER,0) controller:SetMass(100) controller:SetPosition(Vec3(0,1,0)) camerapitch=fw.main.camera.rotation.x camerayaw=fw.main.camera.rotation.y HideMouse() MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) while KeyHit(KEY_ESCAPE)==0 do jump=KeyHit(KEY_SPACE)*6.0 if controller:IsAirborne()==1 then jump=0 end 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,-89.99) fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1) movespeed=4 movesmoothing=10 if controller:IsAirborne()==1 then movesmoothing=200 end move=Curve( (KeyDown(KEY_W)-KeyDown(KEY_S))*movespeed,move,movesmoothing) strafe=Curve( (KeyDown(KEY_D)-KeyDown(KEY_A))*movespeed,strafe,movesmoothing) controller:Update(camerayaw,move,strafe,jump,400,1) fw:Update() fw.main.camera:SetPositionf(controller.position.x,controller.position.y+1.8,controller.position.z,1) fw:Render() Flip(0) end controller:Free() ShowMouse()
  9. try the first post of this thread... http://leadwerks.com/werkspace/index.php?/topic/89-3ds-max-to-gmf-exporter/
  10. Looking at how to get a randomly picked entity's body so to add a force to it. The bullet.lua just loops until it gets the parent that is the model. The example in the wiki for c++'s AddBodyForceAtPoint just does the GetParent() on the picked entity. Trying this in bmax several ways, all I get are either Int to TBody conversion error using the lua method, or TEntity to TBody conversion error using the c++ method. What is the correct way to convert your pick.entity to either a model or body in bmax? Here is the bmax code with the lua method involved... SuperStrict Framework leadwerks.engine Import "c:\program files\leadwerks engine sdk\bmx\framework\framework.bmx" Include "lua-gluefunctions.bmx" GCSetMode(2) RegisterAbstractPath ("c:\program files\leadwerks engine sdk") Graphics(800, 600) Global fw:TFramework = CreateFramework() If Not fw RuntimeError "Failed to initialize engine." MoveEntity fw.Main.camera, Vec3(0, 0, - 5) Collisions 1,1,True Global oildrum:TModel = LoadModel("abstract::oildrum.gmf") EntityType(oildrum, 1, 1) Local body:TBody = CreateBodyBox() SetBodyMass body, 1.0 EntityType body, 1 Local mesh:TMesh = CreateCube() EntityParent mesh, body Local material:TMaterial material = CreateMaterial() SetMaterialColor material, Vec4(1, 0, 0, 1) PaintEntity mesh, material Local ground:TBody=CreateBodyBox(10,0.1,10) PositionEntity ground,vec3(0,-2,0) EntityType ground,1 Local groundmesh:TMesh=CreateCube() ScaleEntity groundmesh,vec3(10,0.1,10) EntityParent groundmesh,ground,0 material:TMaterial = CreateMaterial() SetMaterialColor material,vec4(0,1,1,1) PaintEntity groundmesh,material Local light:TLight=CreateDirectionalLight() RotateEntity light,vec3(35,55) Local piv:TPivot = CreatePivot() EntityParent fw.Main.camera, piv While Not KeyHit(KEY_ESCAPE) If KeyDown(KEY_LEFT) TurnEntity piv,vec3(0,1,0) If KeyDown(KEY_RIGHT) TurnEntity piv,vec3(0,1,0) If KeyDown(KEY_UP) MoveEntity fw.Main.camera, Vec3(0, 0, 0.1) If KeyDown(KEY_DOWN) MoveEntity fw.Main.camera, Vec3(0, 0, - 0.1) Local pick:TPick If MouseHit(1) pick = CameraPick(fw.Main.camera, Vec3(MouseX(), MouseY(), 1000)) If pick Local campos:TVec3 = EntityPosition(fw.Main.camera, True) Local force:TVec3=vec3(pick.x-campos.x,pick.y-campos.y,pick.z-campos.z).normalize() force.x:*100.0 force.y:*100.0 force.z:*100.0 AddBodyForceAtPoint(GetMeshModel(pick.entity), force, Vec3(pick.x, pick.y, pick.z)) EndIf EndIf fw.Update() fw.Render() DrawText "Click on the body to apply force.", 0, 40 DrawText "Use the arrow keys to move the camera.", 0, 60 Flip(0) Wend GCCollect() End Function GetMeshModel(entity:TEntity) While entity <> Null If GetEntityClass(entity) = ENTITY_MODEL return entity EndIf entity=entity.parent Wend EndFunction
  11. for 2.2X, just create an INI text file with the same name as the GMF, and write this in it: collisiontype=2 and save it in the same place as the tree's GMF file. when you upgrade to 2.3, you can replace the need for INI files with lua script ..or you can just do like lumooja was saying to do, select all the instances, then open up the properties window and hit the New button and create a new key/value of collisiontype/2...
  12. yep, that basically where i had gotten mine many moons ago...
  13. ah... yeah cuz i wasn't paying attention and just copied some code from some of my scripts into it without checking the variable names... group vs group1... edited the code above to reflect the change still think this line should be group = grid:AddGroup("behavior") and the Strings to Vec's are defined in the math/vector.lua file...
  14. yes. your'e correct. disregard comment.
  15. Sounds like you already answered your own question based on the 5 reasons stated.
  16. just remember due to recent changes, the buffer you create needs to be the same size as your current buffer or you will have serious fps drop.
  17. try this: require("scripts/class") require("Scripts/math/vector") local class=CreateClass(...) function class:InitDialog(grid) self.super:InitDialog(grid) local group = grid:AddGroup("behavior") group:AddProperty ("turnspeed", PROPERTY_VEC3) group:Expand(1) end function class:CreateObject(model) local object=self.super:CreateObject(model) object.model:SetKey("turnspeed","1,1,1") function object:SetKey(key,value) if key=="turnspeed" then self.turnspeed = StringToVec3(value) else return self.super:SetKey(key,value) end return 1 end function object:Render() self.model:Turn(self.turnspeed,1) end end
  18. try using this and see if you get better results: texture0="abstract::BrickRound_D.dds" clamp0=0,0,0 texture1="abstract::BrickRound_Disp.dds" clamp1=0,0,0 blend=0 depthmask=1 depthtest=1 overlay=0 zsort=0 cullface=1 castshadows=1 specular=0.100000001 bumpscale=1.00000000 gloss=0.100000001 shader="abstract::mesh_diffuse_bumpmap_parallax.vert","abstract::mesh_diffuse_bumpmap_specular_pom.frag" shadowshader="abstract::mesh_shadow.vert",""
  19. hehe... i like it... i like where this style is heading... its refreshing. very nice work. I see your lua skills are doing just fine!
  20. he means with the code he showed, this line: test =CreateSource(ambient,SOURCE_LOOP) needs to be this: test =CreateSource(ambient,1) but if he added this to the top of his script: require("Scripts/constants/engine_const") he could have left it as SOURCE_LOOP, because SOURCE_LOOP is defined as 1 in that script... or he could have just made his own script that had that defined in it... or he could have just defined SOURCE_LOOP=1 in his script
  21. macklebee

    lgui screenshot

    whats the status of this?
  22. you could do either method... either create a controller script that loads the vwep model and handles its properties and reactions or just translate the code to bmax, which would be the simplest.
  23. weeping gun i think he meant the vwep model that comes with the SDK
  24. You could kind of do this in LE 2.2X's sandbox. You could change the color of a texture and use that to paint onto your other textures in your terrain, but it would effectively kill one of your 5 available texture slots.
×
×
  • Create New...