Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. for terrain textures to show up in the Editor's paint Layer section, the name of the texture has to be like 'terrain_XXXX.dds' or even 'terrain_XXXX_YYYY.dds' if you want to create a folder inside the Open File dialog... the naming of vegetation models to be used in the Editor's vegetation Layer section uses the 'vegetation_AAAA.gmf' and 'vegetation_AAAA_BBBB.gmf' naming convention...
  2. There is no bug. You are trying to load the standard LE font, Arial9, using the abstract path. If you looked at your console log, you will see its not being loaded. And since your code is constantly trying to set a font that is not there, its bogging down the whole process. You need to use the 'incbin::' call to grab LE's embedded font. RegisterAbstractPath("") Graphics(400,300) fw=CreateFramework() font1 = LoadFont("incbin::Arial9") font2 = LoadFont("abstract::ComicSans_24_Bold_Italic_Shadow") while AppTerminate()==0 do fw:Update() fw:Render() SetBlend(1) DrawText("Standard LE font",0,60) SetFont(font2) DrawText("Custom Font",0,100) SetFont(font1) SetBlend(0) Flip(0) end ComicSans_24_Bold_Italic_Shadow.zip
  3. sorry for the misdirect, I didn't understand exactly what you were trying to accomplish... but in any case, you should probably read Getting Started with Lua... specifically page 10 concerning Classes and Objects.
  4. Here are the stages of how the object scripts work with the normal class/object functions: 1) Placing the model into the scene for the first time: Creating class whatever Creates the object Gets the Keys Sets the Keys Unlocks the Keys 2) Opening the model's property dialog: Adds the properties to dialog Gets the Keys 3) Pressing the APPLY button in the property dialog: Gets the Keys Sets the Keys Unlocks the Keys 4) Deleting the model from the scene: Freeing class whatever
  5. It depends on the language that you will use for the exact syntax, but basically the easiest way is to load the scene, iterate through all of the scene's children or world's entities, and grab the child/entity that is the terrain class. a BlitzMax method is shown here: http://leadwerks.com/werkspace/index.php?/topic/3054-how-to-retrieve-pointer-to-terrain-from-loaded-scene-blitzmax-style/ the lua method can be done like this: require("scripts/linkedlist") ... for ent in iterate(CurrentWorld().entities) do if ent:GetClass()==ENTITY_TERRAIN then ... ... end end
  6. should work just as before from what i see... but you need to actually have a mat file available...
  7. The heightmap and alphamap are saved to the same folder as the SBX file... MAPS. The textures used are kept in the Materials Folder under the Terrain folder. If you are wanting to paint details into your terrain then I would suggest that you use the editor. and the wiki has info for the Terrain commands, but all of this can easily be just achieved by just loading the scene/SBX file.
  8. no problem... i thought it strange to see this issue occurring again after it was finally fixed... Only Josh can say what version of the newton.dll he is supplying... which might help if that information was included in our versions.txt file...
  9. Also, I have tested this successfully with the cube scaled down to 0.04m^3 (~1.5inches cubed)... anything below that it gets a little funky with the physics... but at that size i would suggest just using raycasts since something that size would be difficult to see anyways...
  10. Like I mentioned above, at one point LE was using this version 2.22. Somewhere either in LE's myriad of SDK updates or Newton's updates, this was lost. yes, but it won't matter... the flavor of the week is to use anything other than newton for LE3... granted the same people complaining about how slow newton is now will be also complaining about the crappy unrealistic physics behavior from whatever other physics engine is used in LE3 6 months from now...
  11. I went through this exercise already 6 months ago. I was the one that was providing demos to Julio so he could rectify the issue. As stated for the newton 2.22 version from Julio: When I suggested to Vetal to use the Newton.DLL from Newton 2.22 SDK, it was based on actual proof of it working and not just a guess. Using the current newton.dll that comes with LE 2.4 right now, I was getting the same results as Vetal. I switched to the dll from Newton 2.22 and ended up with this: yes, to simulate an actual bullet being fired, the raycast method is the way to go... but I was answering to solve Vetal's issue and any other issues anyone would see with this type of interaction.
  12. Download the Newton SDK 2.22 version and use the Newton.DLL from it. This issue was rectified in that version and at one time LE was using it. For some reason either we have reverted back to a previous version in LE or for some reason a later version of the Newton dll is not working correctly. As long as the "bullet" is set with swept collision ON it works fine.
  13. Look at how the switch and underground_fanblades scripts work. Also open up the tunnels.sbx file and you will see an example of them working.
  14. can you not use lua scripted objects in c++ at all? if you can this is no different... just need it in the scene and it should just work.
  15. this might be of some interest to you: Texture Slots
  16. Look at how the original environment_sound script works. It sets the source to nil every time the keys are unlocked then creates the sound again. You would have to do the same thing as well to prevent multiples.
  17. what i posted was just the flythrough script with the small modification i made... your script is just the flythrough script with an extra couple of buffers and some code to take screenshots... but for what you are wanting with the fixed camera, it applies to both... Find this line in your script: fw.main.camera:AlignToVector(t,3,0.05*1.0) and replace it with this: --'Edited here to check whether camera should be at fixed angle or' --'interpolated between the two nodes rotation values' if currentnode:GetKey("fixed")=="1" then fw.main.camera:SetRotation(currentnode.rotation,1) else fw.main.camera:AlignToVector(t,3,0.05*AppSpeed()) end And change the info_camera_node.lua script to what i showed above.
  18. the line here: fw.main.camera:AlignToVector(t,3,0.05*1.0) is replaced with this: --'Edited here to check whether camera should be at fixed angle or' --'interpolated between the two nodes rotation values' if currentnode:GetKey("fixed")=="1" then fw.main.camera:SetRotation(currentnode.rotation,1) else fw.main.camera:AlignToVector(t,3,0.05*AppSpeed()) end thats all that was changed... that and the one line added to the node script.
  19. ok just a quick and dirty version that lets you fix the camera angle to the current node's angle. First change the info_camera_node.lua script to this: require("scripts/class") local class=CreateClass(...) function class:InitDialog(grid) self.super:InitDialog(grid) local group=grid:AddGroup("Camera Node") group:AddProperty("starthere",PROPERTY_BOOL,0,"Start here") group:AddProperty("fixed",PROPERTY_BOOL,0,"Fixed Camera Angle") group:Expand(1) end then the game script to this: require("Scripts/linkedlist") require("Scripts/spline") require("Scripts/constants/keycodes") HideMouse() FlushMouse() FlushKeys() local dummy = LoadModel( "abstract::info_camera_node.gmf" ) local node local currentnode if dummy~=nil then for node in iterate(dummy.reference.instances) do if node:GetKey("starthere")=="1" then currentnode=node break end end dummy:Free() end if currentnode==nil then Notify("No starting camera node found!") return end local nextnode=currentnode:GetTarget() if nextnode==nil then Notify("At least two camera nodes are required.") return end local tension=EntityDistance(currentnode,nextnode)*0.5 local spline=CreateSpline(currentnode.position,currentnode.mat:K():Scale(tension),nextnode.position,nextnode.mat:K():Scale(tension),0.75) local splinelength = spline:Length() fw.main.camera:SetMatrix(currentnode.mat) local n=0.0 while KeyHit(KEY_ESCAPE)==0 do if n>=1.0 then currentnode=nextnode nextnode=currentnode:GetTarget() if nextnode==nil then break end tension=EntityDistance(currentnode,nextnode)*0.5 spline=CreateSpline(currentnode.position,currentnode.mat:K():Scale(tension),nextnode.position,nextnode.mat:K():Scale(tension),0.75) n=0.0 splinelength=spline:Length() end p=Vec3(0) t=Vec3(0) n = n + 0.01*AppSpeed()/splinelength*10.0 spline:Interpolate(n,p,t) MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) fw.main.camera:SetPosition(p) --'Edited here to check whether camera should be at fixed angle or' --'interpolated between the two nodes rotation values' if currentnode:GetKey("fixed")=="1" then fw.main.camera:SetRotation(currentnode.rotation,1) else fw.main.camera:AlignToVector(t,3,0.05*AppSpeed()) end fw:Update() fw:Render() Flip(0) end ShowMouse() How to use: Set the rotation of the camera node in the editor. Then decide if you want the camera direction to be set by the node's rotation or have it change as it the game script interpolates between the current node's and the next node's rotation values by selecting the property dialog's checkbox for Fixed Camera Angle. Note that the camera angle is always in the same direction as the node's Z-axis (the blue arrow). To prevent major camera rotation swings, set a non-fixed camera angle node at the same rotation as a fixed camera angle node after the fixed camera angle node.
  20. yes a bit of hack... and just as a side note, i hope your designers all have a SDK license as well... Well the problem is the fact that the CurrentBuffer() could be grabbing any of the several buffers... you would have to be more specific. Using lua to load the postfilter would be ideal... as long as there were no conflicting functions in your shader.
  21. ? Did I write something above that suggested I changed the normal options or shaders? No my shaders skills are far from that unfortunately. This just allows people to setup a scene in the editor how they want with the above options and then also have the same scene loaded into their game with the exact same effects without the need to program it into their game.
  22. its called SweptCollision It used to be pretty bad with objects going through each other even with Swept Collision on, but that has been rectified in Newton 2.22.
  23. There are several ways to achieve this: 1) either replace one of the shaders (like the SSAO) with your own in the shaders.pak and turn it on/off using the Tools>Options settings 2) replace all the normal shaders (like shown here ) 3) create a lua script that sets the postfilter shader... keep in mind lua has issues with loading some shaders due to some function overwrite issues as noted here
  24. macklebee

    Font scale

    LE uses bitmap fonts. So to change the size of the font requires you to create a new font (map)... I say map because FontStudio creates a DDS file and a INI file that holds the location of each letter on the DDS texture. You can download FontStudio from here. You can review the wiki tutorial thats been around for quite awhile from here. Also, Aggror provided a new video tutorial recently found here
  25. you will also get: C++ headers/BMAX modules access to the SDK users' forums access to the SDK users' downloads
×
×
  • Create New...