wh1sp3r Posted February 23, 2010 Share Posted February 23, 2010 Why ? when i do aritmetic thing with yy .. it shows different error, that i am doing arithetic on variable yy (usedata) i tried to make number from it, same problem. what's wrong ? Quote -= Phenom II X4 965 3.4Ghz - ATI HD5870 - 6 GB DDR3 RAM - Windows 8 Pro 64x=- Website: http://www.flamewarestudios.com Link to comment Share on other sites More sharing options...
Josh Posted February 23, 2010 Share Posted February 23, 2010 This would indicate that the values being passed to the function are nil (undefined). 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...
wh1sp3r Posted February 23, 2010 Author Share Posted February 23, 2010 local posL = Vec3(0,0,0) local pos = Vec3(0,0,0) for i=0, 3362 do posL = surface:GetVertexPosition( i ) pos = TFormPoint( posL, object.model, nil) local h = class.GetTerrainHeight(pos.x, pos.z, self.model.world) hm, but It's defined ... IT's Vec3 Quote -= Phenom II X4 965 3.4Ghz - ATI HD5870 - 6 GB DDR3 RAM - Windows 8 Pro 64x=- Website: http://www.flamewarestudios.com Link to comment Share on other sites More sharing options...
Josh Posted February 23, 2010 Share Posted February 23, 2010 That looks like it should work then. Please post an example I can reproduce. 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...
wh1sp3r Posted February 23, 2010 Author Share Posted February 23, 2010 ok, here decalplane.zip Quote -= Phenom II X4 965 3.4Ghz - ATI HD5870 - 6 GB DDR3 RAM - Windows 8 Pro 64x=- Website: http://www.flamewarestudios.com Link to comment Share on other sites More sharing options...
wh1sp3r Posted February 23, 2010 Author Share Posted February 23, 2010 any news ? Quote -= Phenom II X4 965 3.4Ghz - ATI HD5870 - 6 GB DDR3 RAM - Windows 8 Pro 64x=- Website: http://www.flamewarestudios.com Link to comment Share on other sites More sharing options...
macklebee Posted February 23, 2010 Share Posted February 23, 2010 he is probably sleeping Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Marleys Ghost Posted February 23, 2010 Share Posted February 23, 2010 Sleeping? how dare he!! lol ... the wonderful world of timezones 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...
AndyGFX Posted February 23, 2010 Share Posted February 23, 2010 Your problem is very simple: Method in LUA is seperated by : change this line local h = class.GetTerrainHeight(pos.x, pos.z, self.model.world) to: local h = class:GetTerrainHeight(pos.x, pos.z, self.model.world) Quote [HW] C2D Q6600, 4GB RAM, NV8800GTX, Vista Ultimate x64 [sW] Blide Plus, BlitzMax, Delphi, C++, 3DWS 5.53, Leadwerks 2.xx Link to comment Share on other sites More sharing options...
wh1sp3r Posted February 23, 2010 Author Share Posted February 23, 2010 lol ? thank you Andy, i will try it Quote -= Phenom II X4 965 3.4Ghz - ATI HD5870 - 6 GB DDR3 RAM - Windows 8 Pro 64x=- Website: http://www.flamewarestudios.com Link to comment Share on other sites More sharing options...
macklebee Posted February 23, 2010 Share Posted February 23, 2010 same problem with this line: local terrain = class.GetTerrain(world) Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
AndyGFX Posted February 23, 2010 Share Posted February 23, 2010 This little sample shows how-to and when is possible call function/method with . and when with : -- | --------------------------------------------------------------------------- -- | Define class name -- | --------------------------------------------------------------------------- TMyClass = {} -- | --------------------------------------------------------------------------- -- | Define class properties -- | --------------------------------------------------------------------------- TMyClassProp = { var1 = 10, var2 = null, my_fnc = function (a) print(a) end } -- | --------------------------------------------------------------------------- -- | CONSTRUCTOR -- | --------------------------------------------------------------------------- function TMyClass:New() o = TMyClassProp setmetatable(o, self) self.__index = self return o end -- | --------------------------------------------------------------------------- -- | Method #1 -- | --------------------------------------------------------------------------- function TMyClass:SetVar1(v1) self.var1 = v1 end -- | --------------------------------------------------------------------------- -- | Method #2 -- | --------------------------------------------------------------------------- TMyClass.SetVar3 = function (v1) TMyClass.var1 = v1 print(TMyClass.var1) end -- | --------------------------------------------------------------------------- -- | Method #3 -- | --------------------------------------------------------------------------- function TMyClass:GetVar1(v1) return self.var1 end -- ***************************************************************************** -- USING -- ***************************************************************************** -- create instance of TMyClass myClass = TMyClass:New() -- call class method myClass:SetVar1(100) -- direct acces myClass.var2 = 101 -- test result print (myClass:GetVar1()) print (myClass.var2) print (myClass.SetVar3(222)) myClass.my_fnc(123) Note: Every functions in LUA are values. More here: Lua Functions Quote [HW] C2D Q6600, 4GB RAM, NV8800GTX, Vista Ultimate x64 [sW] Blide Plus, BlitzMax, Delphi, C++, 3DWS 5.53, Leadwerks 2.xx 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.