Quote: "Are compiled Lua scripts are usable by LSE?"
The advantage of compiled Lua Scripts over "
open source" scripts is that it is
encrypted. I wanted to handle encryption especially within the
Plugin Container. So people can write their plugins and encrypt/compile it to sell and free ones could go open source.
Ofcourse using a compiled version of a lua script is faster in loading it in (dofile,loadfile etc), but it is not necessarily faster in "calling a function" (pcall) so I don't think there lies an advantage.
I added it to the list mate! Thanks for the tip!
Quote: "Also on the topic of scripts, do you have a sample script for us to look at?"
LSE runs the scripts by calling the functions. I find this, the best wayt to handle alot of scripts at the same time. There are 2 ways of optimizing your scripts and the use of your scripts:
1.
setFrameSkipping(ammout) -- this allows yout to skip the update script an ammount of frames
2.
setScriptOff() -- this drops the script (script cant run)
After calling the second command you can undo it by using another script to activate your dropped script. Using:
lockEntityIToUpdate(iPlaceOfDroppedScript);
setScriptOn();
unlockEntityIToUpdate();
Here is a simplified version of the script Marc Steene made for the video:
-- Entity Script Template
-- Info: The Engine will setup the script by calling the initEntity function. And calling the update function every entity script call.
-- This means it is important to have those intact in your script.
local offsetx = 3.9;
local offsety = 0;
local offsetz = -3.9;
local idleAnim = addAnim(0,5499,0.2);
local headLimbID = 62;
function initEntity() -- Init Entity
setCameraToLimb(headLimbID);
setLimbDummy();
end
function updateEntity() -- Update Entity
playAnim(idleAnim);
setCameraToLimbOrientation(headLimbID,20);
setCameraMoveFromLimbOffset(headLimbID,offsetx,offsety,offsetz);
end
Any suggestions C&C are welcome.
Cheers,
