Jump to content

"old" script confusion[s] - switch.lua


flachdrache
 Share

Recommended Posts

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

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

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.

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

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.

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...