Jump to content

thehankinator

Members
  • Posts

    436
  • Joined

  • Last visited

Everything posted by thehankinator

  1. I am creating emitters in code. It's convenient for me to define them in the editor then convert them to code. I don't have to do it this way but a division operator for a Vec4 isn't an uncommon thing in a vector library. Nothing I am doing requires this operator, I've already got a workaround.
  2. Does anyone have the collision type table? It doesn't exist in the documentation anymore. Or has something changed in resolving collisions? https://www.leadwerks.com/learn?page=API-Reference_Object_Collision
  3. It'd be handy if Vec4 had a division operator for converting colors defined in 0-255 to 0-1
  4. I am not able to divide a Vec2 or Vec4 but Vec3 works fine. Seems like this should work, am I wrong? local Case1 = Vec2(164, 0) / 255 --Doesn't work local Case2 = Vec3(164, 0, 0) / 255 --Works local Case3 = Vec4(164, 0, 0, 255) / 255 --Doesn't work Error message for Case1 and 3 is: Attempt to perform operation on an invalid operand
  5. Using this page https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_Emitter_SetMaxScale It isn't clear how many arguments this Lua function accepts. Syntax section states 1 argument But the example has 2 arguments if (window:KeyDown(Key.Up)) then maxscale = maxscale + 1 emitter:SetMaxScale(maxscale,maxscale) elseif (window:KeyDown(Key.Down) and maxscale > 0) then maxscale = maxscale -1 emitter:SetMaxScale(maxscale,maxscale) end The C++ documentation is consistent in that there is a single argument. However the header file "Emitter.h" has two functions listed virtual void SetMaxScale(const float x);//lua virtual void SetMaxScale(const float x, const float y);//lua Seems like both Lua and C++ have 1 and 2 arguments variations but only the 1 argument variant is documented and Lua example shows 2 arguments.
  6. Calling GetAngle() on a sprite set to Billboard mode is always returning 0. Here is how I set it up: 1) Create a sprite 2) Set it to Billboard mode 3) Assign a material 4) Put this script on it function Script:UpdateWorld() System:Print(self.entity:GetAngle()) end The billboard appears to be working (always facing the camera) but the script always prints 0. I tried casting it to a sprite ( tolua.cast(self.entity,"Sprite") ) and calling GetAngle on that but no change. Any idea what I am doing wrong?
  7. Sorry if this has already been posted but it seems like Material:SetPickMode is broken. For example this code: local mat = Material:Create() local shader = Shader:Load("Shaders/Model/diffuse+alphamask.shader") mat:SetShader(shader) shader:Release() mat:SetPickMode(true) Crashes with this error: attempt to call method 'SetPickMode' (a nil value) Seems like this should work, this is the documentation for the function: https://www.leadwerks.com/learn?page=API-Reference_Object_Asset_Material_SetPickMode
  8. I don't know what the signature of CreateBox() is nor what Entity and Model classes look like but this compiles for me under VS2015 and MinGW 5.3.0 (Debug and Release for both). Entity had to have a virtual function to make it polymorphic. #include <memory> class Entity { public: virtual ~Entity() {} }; class Model : public Entity { public: virtual ~Model() {} }; template <class T, class Y> std::shared_ptr<T> Cast(std::shared_ptr<Y> o) { #ifdef DEBUG return std::dynamic_pointer_cast<T>(o); #else return std::static_pointer_cast<T>(o); #endif } std::shared_ptr<Entity> CreateBox() { return std::dynamic_pointer_cast<Entity>(std::make_shared<Model>()); } int main() { std::shared_ptr<Entity> entity = CreateBox(); std::shared_ptr<Model> model = Cast<Model>(entity); return 0; }
  9. https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Transform_Point Two things: 1) Minor thing, the Lua example contains local position = Transform:Point(2,0,0,NULL,model) "NULL" should be "nil". 2) The documentation doesn't say what using NULL/nil means but I think the documentation used to state that it would use global space. This is missing from the other functions in Transform.
  10. dark-rocky-big-diff.mat It is also missing Veg Shadow shader
  11. I don't remember exactly but I'll get it for you tonight.
  12. That was it! Thanks! It would be nice if the editor would give a warning or message when the user selects an object that contains a material that does not have a vegetation shader defined.
  13. I picked up The Zone DLC and started poking around with vegetation. After placing various rocks I get these really weird blue/white monoliths. When looking around, they appear to randomly move around or disappear/appear. I've trashed my map and started over a couple times, restarted LE they keep coming back. Also, the rocks in the screenshot disappear as the camera approaches them but appear when backing up. Test.map
  14. In my opinion, the game launcher would have successful if the UI was completed. It seems like every time I tried to share a game with it, the other person couldn't find my game. The biggest issue being the name of the game wasn't even visible, just some number below a screenshot. Nothing that couldn't be overcome but it prevented me from saying "Hey go try my game on the launcher, it's called The Hankinator's stupid game". Even worse if someone just opened it up and wanted to browse the games. I know the image had the title in it but that wasn't always all that readable when it was scaled down to a 2 inch square. Even I wouldn't bother looking around there because it was awkward and time consuming just to see the name of the games. Often times even using the Leadwerks website to "launch" the launcher would end in steam reporting an error. There were other things that I think should have been added to the interface like a list of games that the user had already subscribed to, that would have made it easier for the user to come back and play the game again rather than looking through page after page trying to remember what the game image was (cause the title sure wasn't there!) to play it again. Heck I remember opening the launcher a few times and the UI was totally hosed(I think this was around the time that the UI was revamped). I know early access means there are issues but if I tried an early access title and saw that I'd uninstall. Speaking of which did the launcher ever leave early access? I think some people avoid early access stuff, I usually do. Maybe all this was fixed recently, but I feel like there were very significant UI problems for months if not a year+. I think these and other issues killed any "steam" behind the launcher from day 1. Sorry for the rant but the game launcher was one of my favorite features of Leadwerks and I really wanted to see it succeed.
  15. R9 380 pretty low end for VR however I have been playing Robo Recall without any lag or chopping so I doubt that's the problem.
  16. It's still choppy without calling and also setting vsync to false
  17. It loaded up ok but it was choppy(I don't know what the frame rate was but without VR and vsync it's over 350) and the models on the very left and right edge of the view "popped" in, like maybe they were culled for a narrower field of view or something. I tried to take a screenshot but the window was just blank. Is there a way to have Leadwerks mirror the scene in Rift on to my monitor?
  18. I have an Oculus and usually have an hour or so a day I could check something out.
  19. Have you thought about using nullptr instead of NULL? https://en.wikipedia.org/wiki/C%2B%2B11#Null_pointer_constant
  20. Have you profiled Lua vs LuaJIT in Leadwerks? I'm curious if there will be performance impact. LuaJIT comparison tool claims pretty substantial gains over regular Lua (http://luajit.org/performance_x86.html).
  21. You could do something hacky like this. Do this for like 10 or 20 points around the player using sin() and cos() multiplied by the distance you want (10 in your example) from the player's global location. Use World:Pick() from that point to the player, this tell you if this point has line of sight to the player. If your level has walls then this will also tell you if you are on the map or not. If your level does not have walls you could do another World:Pick() from the point to the same point with a big -y value to see you are over an object. If your level is not flat this can get complicated, if there are no ceilings you could use World:Pick() with some big +y value to a big -y value to find the ground, then do the line of sight pick from that point to the player. You wouldn't want to run this every frame but it should work.
  22. I never liked the "Error list" window, what's in the "Output" window regarding these errors? What does the line of code in Leadwerks that is causing the error look like? It seems like these errors don't all have the same cause. I am able to to reproduce the 6th error like this: std::shared_ptr<Point> blah; std::shared_ptr<Triangle> blah2; blah = blah2; Which is pretty obvious what's wrong there. The error given is: 1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(579): error C2440: '<function-style-cast>': cannot convert from 'const std::shared_ptr<Triangle>' to 'std::shared_ptr<Point>' 1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(579): note: No constructor could take the source type, or constructor overload resolution was ambiguous 1> C:\Junk\Src\Thing.cpp(155): note: see reference to function template instantiation 'std::shared_ptr<Point> &std::shared_ptr<Point>::operator =<Triangle>(const std::shared_ptr<Triangle> &) noexcept' being compiled 1> C:\Junk\Src\Thing.cpp(155): note: see reference to function template instantiation 'std::shared_ptr<Point> &std::shared_ptr<Point>::operator =<Triangle>(const std::shared_ptr<Triangle> &) noexcept' being compiled 1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(579): error C2228: left of '.swap' must have class/struct/union
  23. Ranged based for loops were added to the C++ standard in c++11, not a MSVC only thing. I've not seen the exact syntax that Roland used but this is how I do it in MSVC 2015 and GCC. for (auto&& entity : list) { entity->SetPosition(1,2,3); } ( auto&& ensures you get a reference and no copies are made) http://en.cppreference.com/w/cpp/language/range-for https://stackoverflow.com/questions/26991393/what-does-auto-e-do-in-range-based-for-loops
×
×
  • Create New...