PYRE Mini Update: LUA Scripting?

I’ve been thinking about how I will make it possible for custom scripts to be executed on runtime, so I browsed the asset store and found NLUA! In my case I’m going to be using the Unity3D Version found here that handles most of the main unity functions well, but still might need tweaking.

With NLUA, you can write a .lua file to a specific player-accessible directory so it can be compiled at any point during runtime (at least I think so). Here is an example of a .lua that would spawn a sphere:

import 'System'
import 'System'
import 'UnityEngine'
import 'Assembly-CSharp' -- The user-code assembly generated by Unity
function Update() 
    if Input.GetKey(KeyCode.Space) then GameObject.Instantiate(sphere, transform.position, Quaternion.identity) 
    end
end

With this framework users will have a lot of control over their own mods, so that’s definitely a plus. But on the other hand a skilled enough user can also use this power to exploit the game in ways that could break the game for others.


Leave a comment