Jump to content

thehankinator

Members
  • Posts

    436
  • Joined

  • Last visited

Recent Profile Visitors

9,491 profile views

thehankinator's Achievements

Newbie

Newbie (1/14)

145

Reputation

  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
×
×
  • Create New...