RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Incorporating lua into runuo?

Safera

Page
If I have a uo-based lua script, is it possible to incorporate it into my runuo shard somehow?

I tried writing a C# script calling the lua script, but i don't really know what I'm doing.

Here's what I wrote:
Code:
using Window;
using System.Windows.Threading;
 
        Lua lua = new Lua();
 
        XmlDocument xmlDocument = new XmlDocument();
 
        xmlDocument.Load(@"Window.xml");
 
        lua.DoFile(@"Window.lua");
 
        LuaFunction luaFunction = lua.GetFunction("transformXML");
        Object o = luaFunction.Call(xmlDocument.OuterXml);
 

Arvoreen

Sorceror
Hmm, where did you get your Lua class from? Doing some quick googling lead me here

http://code.google.com/p/luainterface/
and some example stuff here
http://www.gamedev.net/page/resources/_/technical/game-programming/using-lua-with-c-r2275

I haven't tinkered with any of it, and it seems kinda interesting, but the issue I come up with in my head is this: You have a "uo based script" in lua, problem being, who knows what type of server it's for, what kind of items they have exposed (i.e. their "PlayerMobile" could be completely different from our PlayerMobile), and how it is interfaced, you would have to write a C# script that would send all of that relevant data to the lua script so when it executed, it would have that stuff to work with. At least I think so. :)

So it might just be easier/better off to just rewrite the script in C#.

Hope this helps!
 

pooka01

Sorceror
I already worked with Lua, it's nice and kind of similar, but i think it's better C#, more simple visually, as there are no { } in luas for the functions.

Code:
function meta:SetSprintMeter(num)
 self:SetNWInt("sprint_meter",num)
 self.SprintMeter = num
end
I use lua in another game so idk if it would be the same on UO.
 

Safera

Page
Well, OSI allows users to write LUA scripts to make extensions for UO. It would be nice to be able to Incorporate those into runuo. The one I happened to be looking at allows a resizable radar map, but there are many that improve upon UO's GUI.
 

Vorspire

Knight
The LUA extensions you're talking about are client extensions that allow players to customize interfaces and event handlers, etc.
Such LUA extensions are client-side and wouldn't serve much use in server-side development in RunUO.

Think of the LUA extensions as scripts for the client, if you want your players to use them on your shard, you'll have to supply them like you would with any other patched game files.

Isn't LUA only supported by the Enhanced Client at the moment?


Another great example of how LUA is usually implemented in game clients can be seen in World of Warcraft, specifically in Add-on development.
 

Safera

Page
Maybe you are correct regarding the enhanced client....I sure hope not though. *will look into it*

Thank you for that understandable explanation in laymen's terms, btw.
 

mumuboy

Sorceror
LUA scripts are extensively used for gumps in the new enhanced client. This makes it difficult to implement the enhanced client from a RunUO perspective.
 

Safera

Page
Say it isn't so....

Yeah, I didn't see anything incorporated for the Classic Client either....which is unfortunate.
 

Simon Omega

Traveler
A lot of games seem to be incorporating scripting languages into the Client/GUI. I have even seen many server side engines in Python. Only thing I would be worried about is future patches making a feature in accessible (World of Warcraft does this if it can create automation features).

I have seen many client scripts I would love to use. Someone on ABCUO or some such shard, said a complete HowTo could be found here for getting the enhanced client to work in RunUO. I've searched and searched, found no such thing.

I've noticed a lot of games using LUA for the UI... Never understood why. I even tried those LUA frameworks to develop Android and Apple Applications. LUA always looked and read like a mess to me. Worked with many groups that can't stand it at all.

But I've meet people that love LUA and think Python is Alien.

:) wish there was a common scripting language that everyone agreed on.
 

Simon Omega

Traveler
Creating a new "java++"? xD
JavaScript++#.Not-Net (Because MS was already Sued over Java.Net and J#)
It could use duck typing, and a nero-network to decide the statements for you, while perfecting your Grate Grandmothers Sponge Cake Recipe.
 
Top