[Scripting][Lua] Checking custom type of variable.

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Lachu
Hardened
Posts: 208
Joined: Sat May 04, 2013 2:19 pm

[Scripting][Lua] Checking custom type of variable.

Postby Lachu » Mon Jul 24, 2017 9:09 am

Is there possibility to check type of lua variable in lua or C code? Type in this case means City, Tech, Player, etc.

Lachu
Hardened
Posts: 208
Joined: Sat May 04, 2013 2:19 pm

Re: [Scripting][Lua] Checking custom type of variable.

Postby Lachu » Mon Jul 24, 2017 5:19 pm

Ok. I found solution for my problem, but never problem occurs. How to add a new universal(type in requirement list)?

sveinung
Elite
Posts: 421
Joined: Wed Feb 20, 2013 4:50 pm

Re: [Scripting][Lua] Checking custom type of variable.

Postby sveinung » Thu Aug 10, 2017 6:33 pm

Lachu wrote:How to add a new universal(type in requirement list)?


It isn't formally documented. Have a look at how it was done before.

Looking at Freeciv's history will reveal the answer to many questions of this type. To be on the safe side have a look at following commits to see if something was forgotten and later added as a bug fix.