Applying Scripts to objects
From MaratisWiki
(Difference between revisions)
Dahnielson (Talk | contribs) |
Dahnielson (Talk | contribs) m |
||
Line 1: | Line 1: | ||
− | + | Once in Maratis editor, click on "Add Mesh" | |
+ | |||
https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/addmesh.png | https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/addmesh.png | ||
+ | Select your object, then name it like want (here i kept the default) | ||
− | |||
https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/rename.png | https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/rename.png | ||
− | + | Now create a new text file in your project/scripts folder, name it like you want, e.g.: new.lua | |
− | + | ||
− | + | ||
https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/script.png | https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/script.png | ||
+ | I quickly edited the file for the example, this script will rotate the mesh on the X axis. | ||
+ | |||
+ | Click on the Scene button and locate your script: | ||
− | |||
https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/scene.png | https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/scene.png | ||
Line 20: | Line 21: | ||
https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/scriptok.png | https://dl.dropbox.com/u/19970067/MWiki/ApplyingScript/scriptok.png | ||
+ | Done! | ||
− | + | '''Note:''' Only one script can be added to a scene at a time. To add more, use the 'dofile' function within a script, and include multiple other scripts. | |
− | Note: Only one script can be added to a scene at a time. | + | |
− | within a script, and include multiple other scripts. | + | |
[[Category:User manual]] | [[Category:User manual]] | ||
[[Category:Lua scripting]] | [[Category:Lua scripting]] |
Latest revision as of 09:24, 10 February 2014
Once in Maratis editor, click on "Add Mesh"
Select your object, then name it like want (here i kept the default)
Now create a new text file in your project/scripts folder, name it like you want, e.g.: new.lua
I quickly edited the file for the example, this script will rotate the mesh on the X axis.
Click on the Scene button and locate your script:
Done!
Note: Only one script can be added to a scene at a time. To add more, use the 'dofile' function within a script, and include multiple other scripts.