flachdrache Posted August 3, 2012 Share Posted August 3, 2012 from switch.lua - does this actually mean something or is it outdated... function object:Reset() self.model:SetKey("active","0") self.model:SetKey("valuetouse","1") self.model:SetKey("keytoset0","active") self.model:SetKey("arguments","self.active") self.model:SetKey("message0","Run Code") self.model:SetKey("message1","Activate") self.model:SetKey("reloadafterscript","1") self.disable = 0 end thx Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
flachdrache Posted August 3, 2012 Author Share Posted August 3, 2012 ... while we are on it, the template.lua got a Reset function. --[[ function object:Reset() end ]]-- When and how will it be called e.g. automatically like UnlockKeys ?! Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
macklebee Posted August 3, 2012 Share Posted August 3, 2012 well since that code from the switch script does not exist in any of the code that i have since 2.31 - i can only assume that is the old lua code from when LE had multi-state lua instead of single state. so yes - i would assume that code is outdated... as for the object:Reset(), according to the Getting Started with Lua: object:Reset() This function is called whenever a model's reset matrix is reset. This can happen if physics are reset in the editor, or if a model is manually moved in the editor. Models that use internal joints can be updated with this function. So it looks like it calls the Reset() when you first place the model into the scene, any time you move the model, or if you hit the Reset Physics button on the toolbar. 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...
flachdrache Posted August 3, 2012 Author Share Posted August 3, 2012 I am not too sure about when stuff gets called ... e.g. onReset() Vs. doReset() would have been more clear. I`ll test that out again then ... the issue iam having is to build positionable game entity`s w/o disturbing the update loop. A combination of Reset() and UnlockKeys() does work currently but going for random tests is not a preferable task ... but you know that. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... 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.