Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. in the editor's asset list on the right, you have the models available to drag into a scene... if you double click on the model icon in the list it will open the script editor and the model's lua script... this is where you can add properties... look at the standard models that come with the SDK to see what is in their object scripts to see how this is accomplished...
  2. Place the Scripts folder into your working directory if you are using lua or do not use entities in the editor that have scripts if you are not using lua.
  3. they are inherent to lua... http://pgl.yoyo.org/luai/i/5.6+Mathematical+Functions
  4. also, the fps drop when getting close to a textured surface is a separate issue from decals... you can see a large fps drop just by moving close to the spinning cube in both of our examples even without creating a single decal...
  5. i think the biggest problem with decals has always been the the fact that you have to create a new decal every time, instead of being able to copy from an existing decal... and with the way the command works you have to use it that way to get the benefit of how it wraps correctly onto a surface... I can simulate a similar drop in FPS (granted not as large) by creating a plane each pick and placing it at the pick location... but if I create the plane beforehand and then just create copies of it, the effect on fps is negligible... require("scripts/constants/engine_const") require("scripts/math/math") RegisterAbstractPath("") Graphics(800,600) fw=CreateFramework() fw.main.camera:SetPosition(Vec3(0,0,-2)) material=LoadMaterial("abstract::cobblestones.mat") mesh=CreateCube() mesh:Paint(material) ground=CreateCube() ground:SetScalef(10.0,1.0,10.0) ground:SetPositionf(0.0,-2.0,0.0) ground:Paint(material) light=CreateDirectionalLight() light:SetRotationf(45,45,45) decal = CreatePlane() decalmaterial = LoadMaterial("abstract::bullethole.mat") decal:SetScale(Vec3(.0625,.0625,.0625)) decal:Paint(decalmaterial,1) decal:Hide() counter = 0 HideMouse() gx = Round(GraphicsWidth()/2) gy = Round(GraphicsHeight()/2) while KeyHit(KEY_ESCAPE)==0 do mesh:Turn(Vec3(AppSpeed()*0.5,AppSpeed()*0.5,AppSpeed()*0.5)) move = Curve((KeyDown(KEY_W)-KeyDown(KEY_S)),move,3/AppSpeed()) strafe = Curve((KeyDown(KEY_D)-KeyDown(KEY_A)),strafe,3/AppSpeed()) fw.main.camera:Move(Vec3(strafe/15,0,move/15)) fw.main.camera:Point(mesh,3,1) MoveMouse(gx,gy) if MouseHit(1)==1 then local pick = CameraPick(fw.main.camera,Vec3(gx,gy,100),0,0) if pick~=nil then --'this creates a new plane each pick --[[decal = CreatePlane() decalmaterial = LoadMaterial("abstract::bullethole.mat") decal:SetScale(Vec3(.0625,.0625,.0625)) decal:Paint(decalmaterial,1) decal:SetParent(pick.entity) decal:SetPosition(pick.position,1) AlignToVector(decal,pick.normal,2,1)]]--' --'this creates a copy of previous plane each pick' local shot = decal:Copy(1) shot:Show() shot:SetParent(pick.entity) shot:SetPosition(pick.position,1) AlignToVector(shot,pick.normal,2,1) counter = counter + 1 end end fw:Update() fw:Render() SetBlend(1) DrawText("Number of 'decals': "..counter,0,20) DrawText("Use WSAD to move camera",0,40) DrawText("Left-Click to apply 'decal'",0,60) SetBlend(0) collectgarbage(collect) Flip() end ShowMouse() but with the way the command works now I dont know how you could get the wrap effect by creating a copy...
  6. what exactly are you trying to accomplish? just constant movement? then just use the 'object:Update()' function... i would assume the error is from you creating an infinite loop that calls itself from inside its own function... you would have the same problem if you did the same with any other function that called itself from inside itself... like using 'object.model:SetKey("name","killerclown")' inside the 'object:SetKey(key,value)' function...
  7. uh. you are moving the object every time the matrix is updated? looks like a you are creating an infinite loop... as for the error, use 'object.model' or just 'model' when using Entity commands as the 'object' itself is not an entity...
  8. you could use njob to make the heightmap from the diffuse... as for the final _step DDS file, I am still attempting to reproduce the same results that franck has... without much luck...
  9. hmmm i don't believe FindChild() would work... this is how you can do it in lua: require("scripts/linkedlist") local terrain for terrain in iterate(fw.main.world.terrains) do terrain:SetShadowMode(1) end
  10. Submeshes refers to having multiple meshes in one model - mesh hierarchy. The old windmill that came with the original 2.3 SDK is an example of this as well as the monstertruck and the viperscout that currently comes with the SDK. It allows you to create a complex model inside your modelling app and then obtain access to the separate meshes via FindChild()... like the blades in the windmill which lets you rotate them separate from the rest of the model or find the tire location of the monstertruck so you can easily attach physics tires.
  11. Place the environment_atmosphere object into the scene and open up its property dialog. Under the 'Atmosphere' option, change the second value of the 'Camera Range' to a higher value... like 3000 - 4000 or are you referring to DoF? then click on the Tools>Options...>Configuration and uncheck DoF... if its not either one of those then post a screenshot of what you are referring to...
  12. yes the editor has grid snap based on grid tile size... and yes if you load a sbx with loadscene, it will load the models as they were placed in the editor
  13. whats a DEPHBUFFER? and why a semicolon before CreateWorld? and fyi, the button '<>' in the menu bar is for code...
  14. macklebee

    windmill

    is this the old windmill by wailingmonkey from the early 2.3 days? If so, then the lua script should be for the windmill gmf and the findchild name for the blades is "windmill_blades". If it is some other model, then without seeing the model i can only guess that you do not have the right name for the submesh. and fyi, the '<>' icon in the reply toolbar is for code... just place your code in between...
  15. its easy to reproduce in uu3d... just create a cube via uu3d and then save as a gmf.
  16. as far as i know the altitude is just the Y scale component... you could try using EntityScale() to get that... dunno... EDIT --- and now that i think about it, the meterspertile is just the X component of the terrain's scale...
  17. yes uu3d is really nice and has alot of very nice hidden features in it... and it doesnt appear to make more vertices as far as the GMF is concerned... when i counted the vertices in a plain uu3d exported cube and an unwelded face uu3d exported cube, the number of vertices was the same... granted a cube is pretty basic...
  18. ooo nice find... i tried about every other 3d tool except that one... so no need for the chamfers if you use uu3d... nice. but if he doesnt have uu3d he will need to chamfer... unless his modelling app has that ability as well...
  19. an exported uu3d created cube will suffer the same problem... it has to with the normals i would suspect... in the following picture, i have created 4 cubes. listing them left to right: 1) CreateCube() 2) UU3D created cube saved as gmf 3) 3DWS created cube saved as gmf 4) Another modelling program created cube with small chamfers on each corner and converted to gmf using uu3d if you add a really small chamfer to all the edges of the cube, you should be able to fix the issue
  20. the problem is with the PHY file that you have in that zip file... I dont know how that was generated, but you can see that physics body is not located any where near the visual mesh. Delete the PHY file, and reopen the Editor, drag the rock into the scene and it will create the PHY file for you. to see the problem yourself, go to Tools>Options...>Display and click the Show Physics option EDIT-- once you get that straightened out then follow Roland's advice with the script.. I like to use this script for basic scenery items that has the collision property already set, so I don't have to open the property dialog... require("scripts/class") require("scripts/constants/collision_const") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) object.model:SetKey("collisiontype", COLLISION_SCENE) end
  21. just end your commented parts with a comma as well... like so: ' Initialize' LE.Initialize() LE.SetAppTitle(AppTitle) LE.RegisterAbstractPath(MediaDir) ' Set graphics mode ' If LE.Graphics(ScreenWidth, ScreenHeight) = 0 Then ErrOut("Failed to set graphics mode.") Return End If ' Create framework object and set it to a global object so other scripts can access it' Dim fw As LeadwerksEngine.TFramework = LE.CreateFramework() If fw.IsValid = False Then ErrOut("Failed to initialize engine.") Return End If
  22. From what I see the thing that drops the fps the greatest is the flickering light script. If I replace those objects with just a simple pointlight, the fps is basically a flat 60 fps (vsynch on obviously) in a standalone lua script. With the flickering lights, the fps will drop down to 15 whenever those lights are viewed. You could try what Josh did in the firepit script and fake the range of the light by changing the color of the light instead of actually changing the light range every update. btw, I love the artwork... fantastic stuff! reminds me of torchlight.
  23. In previous SDKs prior to 2.5, LOD models used to be children of the model. This is no longer the case as of 2.5 since freeing LOD's has been "fixed". So what are they now? How can one access them?
×
×
  • Create New...