enigma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Enigma-devel] Re: network 2-player game


From: Tacvek
Subject: Re: [Enigma-devel] Re: network 2-player game
Date: Tue, 21 Mar 2006 14:16:58 -0500


----- Original Message ----- From: "Ronald Lamprecht" <address@hidden>
To: "Tacvek" <address@hidden>
Cc: "enigma-devel" <address@hidden>
Sent: Friday, March 17, 2006 1:56 PM
Subject: Re: [Enigma-devel] Re: network 2-player game


But how far do the changes in the error system affect existing levels
and Enigma itself? Please provide us all information you have.

My previous message answeing this question was somewhat unclear.
I'm not sure what effect the error change would have on the levels. If any level attempts to check to errors using "call" then then they sould upgrade to "pcall". _LASTERROR will no longer
be available.

It does require some changes to the main enigma code.

Lua 4.0 used to call _ERRORMESSAGE, which by default was _ALERT, whenever there was an error. The error would propagate upward, except in cetain circumstances. One such circumstance was calling Lua code from C.
The error would not progagate beyond C unless explicity told to.

In Lua 5 this is different. Errors normally propagate upwards. The only real way to deal with errors in lua code is to use pcall, rather than call. pcall works pretty much the same, except in the case of error. If there is no error pcall returns true. If there is an error, pcall returns 2 values: "false", and the error string.

A similar system is used with c code. I'm currently tring to upgrade Enigma to Lua 5.1. Lua 5.1 contains some is mostly the same as 5.0 but happens to contain a few additional compatability macros that would help.

If I am successfull I will send a patch. I will not be updating the lua scripts, but I belive that
all the nessisary information can be found at:
http://www.lua.org/manual/5.0/manual.html#BNF (scroll up a bit)
and
http://www.lua.org/manual/5.1/manual.html#incompat

(Note my patch would neglect things like the changelog entries but compaired to the relative difficulty of changing the c code, that would be easy for somebody else to supply on my behalf. I will also likely need to switch to tolua++ to be able to support Lua 5.1).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]