Jump to content

whiterabbit

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by whiterabbit

  1. I've managed to get a Buffer (and Texture) filled with the current screen. I want to write it to a file, so my game will have a builtin screenshot feature. Leadwerks 2 apparently had a function SaveBuffer which would do exactly what I want, but as far as I can tell it doesn't exist or has been renamed to something else. So, before I try to manually write the bytes to a file, does anyone know if there is a current function for writing a buffer to an image file? (Or maybe there is complete function for taking a screenshot that I don't know about?) EDIT: How do I even get individual values out of a buffer?
  2. I've gotten render to texture working using this code http://leadwerks.wikidot.com/wiki:render-to-texture-security-cam but the Buffer functions are nowhere to be found in the current documentation. Unless I missed it, in which case please point it out Buffer isn't even highlighted in the script editor. I wasn't sure whether to post this in Bug Reports as it's not to do with the program itself...
  3. Does it have to be run in debug mode for that? EDIT: I just tried it and I understand now.
  4. I'm unsure if you actually can change the 'pivot point' of an object, what I do is create a Pivot entity and then drag parent my objects to that. You can then rotate that Pivot and all it's children will rotate correctly.
  5. I get it now, it only has an effect on projects being launched from the editor. os is still available when the .exe is ran manually. Thanks again.
  6. Thanks. Is there any reason I would want to keep it on?
  7. One thing I would like to see is a better stack trace for Lua errors. So when there is an error it doesn't just tell say which file/function, but also shows the chain of function calls leading up to that.
  8. Definitely agree. I started moving them ino/parenting to a pivot so they were all grouped, but then any new ones still have to be moved again.
  9. I was trying to use Math:DeltaAngle but it doesn't seem to exist. I guess it is a C++ function that hasn't been exposed to Lua. I'm using this as a temporary fix and it seems to do the job: function Math:DeltaAngle(a,B) local d = b-a d = d + (( (d>180) and -360 ) or ( (d<-180) and 360) or 0) return d end
  10. I tried to do: local DateRan = os.date("%Y.%m.%d.%H.%M.%S") but got attempt to index global 'os' (a nil value) I did a search and couldn't see an obvious alternative.
  11. Yep, I'm already going to be doing those things in different situations so it's not really a simple option. Gravity is disabled on the world and the ball applies a force to itself to simulate gravity so I can change the direction of gravity (not sure if you can change the gravity direction for the entire world?). I'll try and work around it for now.
  12. Although doing it manually doesn't give the ability to have less than normal bounce. EDIT: Sorry for double post. I'm used to posts auto-merging together on another forum.
  13. Thanks, I thought that might be the case. I just didn't want to have to do it myself.
  14. I have a model of a sphere with a collision mesh imported into Leadwerks and I wanted to control how 'bouncy' it was. Did a google search and came across the functions SetElasticity and SetSoftness (seems like they were called SetBodyElasticity and SetBodySoftness in older versions). The current docs don't mention these functions, or at least not on Entity, and when I try to call them they obviously don't exist. Does anyone know if they've been renamed, not available to Lua, removed for some reason? Just a few things I found: http://www.leadwerks.com/werkspace/topic/2546-balls/ (This has a Lua script that calls SetElasticity which makes me think it did exist at some point) http://www.leadwerks.com/werkspace/page/Documentation/le2/_/command-reference/bodies/setbodyelasticity-r58 (Old docs) http://www.leadwerks.com/werkspace/topic/4683-problem-with-collision-callback/ (C++ but calls SetElasticity)
  15. I just tried using Math:Lerp for the first time and get the error: attempt to call method 'Lerp' (a nil value) This is how I am calling it, I have also tried Math.Lerp and just Lerp, they don't work either. local R = Math:Lerp(self.DayAmbient.x,self.NightAmbient.x,Intense) As as a test I did I for k,v in pairs(Math) do print(k,v) end and I couldn't see Lerp anywhere in the output I understand how Lerp works and can write the function myself to get around this, I just didn't know if the documentation is wrong or I am having some kind of bug or what.
×
×
  • Create New...