I am trying to write my first small script. To keep it simple I just want to make a box turn continually.
When I invoke the script editor ( micro ) I see there is some default code there. Do I need that? If so where do I insert my own code. Thanks.
entity.turn( objID, 0, 1, 0 )
obj = 0;
-- System initialisation - Skyline script entry point
function onInit(objID)
sky.lprint("LUA: Script Active!");
obj = objID;
end
-- Called after all the scenes onInit() have been called.If you need to ensure your data exits, then do you set up here
function postInit()
end
-- Updated every frame
function onUpdate(timeDelta)
end
obj = 0; declaires the obj variable
function onInit(objID)
sky.lprint("LUA: Script Active!"); <-- this is for debugging and prints to the console
obj = objID; <-- This gets the ID of the object from the
--paramater that has been passed to the onInit(objID)
--function and places it in the obj variable
end to be used in the script
function onUpdate(timeDelta)
end
obj = 0;
-- System initialisation - Skyline script entry point
function onInit(objID)
sky.lprint("LUA: Script Active!");
obj = objID;
end
-- Updated every frame
function onUpdate(timeDelta)
entity.turn( obj, 0, 1, 0 )
end
cassius_b wrote:Is it possible to program a whole game in one big script. Is that what scene scripts are for?
CUBE = 3
entity.turn( CUBE, 0, 1, 0 )
Users browsing this forum: No registered users and 1 guest