L B Posted March 6, 2010 Share Posted March 6, 2010 I'm no LUA expert, but I need to change the shadow mode of a model at spawn. What would be the correct code for it? Quote Link to comment Share on other sites More sharing options...
L B Posted March 6, 2010 Author Share Posted March 6, 2010 Oh and if I may ask as well, how can I set it to static? Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted March 6, 2010 Share Posted March 6, 2010 Try something like: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object = self.super:CreateObject(model) object.model:SetKey("castshadows",2) end That will spawn the object with shadows set to static. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Josh Posted April 22, 2010 Share Posted April 22, 2010 Or this: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object = self.super:CreateObject(model) object.model:SetShadowMode(2,1) end Since class.lua uses the direct castshadows value to return a key, it's safe to call SetShadowMode() directly. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.