Lua Bindings

Wednesday, March 13, 2013

I've been updating how my Lua binding system works over the last few days. My original system was getting me in the shit with co-routines because I short sightedly stored a global Lua instance and accessed it from everything.

While this has worked, and is accessible, it does fuck me about in a lot of ways. Like I can only really have one Lua instance in each dll realm (menu, client, server). I've got no need to have more right now – but that's not the point.

My old bindings looked like this..

ss (2013-03-13 at 04.37.28)

The calls to Get_Entity  and Get_Float are what are bumming me. They're accessing globals.

So now my bindings are looking like this.

ss (2013-03-13 at 04.36.24)

The 'lua' variable is passed to the function from a function that the LC_Function macro creates. It's no longer retrieved from a global – it's retrieved from the lua_state that is passed by Lua to all function calls.

I also started documenting the functions in a way that I can parse with a PHP script, turn to JSON and automatically throw at the wiki. Something I really really wish I had done over the years for the 2,000 other functions.

More Rubbish

Your Portfolio Gave Me Diarrhea

Friday, October 1, 2021

Motivation

Friday, September 24, 2021

We got married

Thursday, September 16, 2021

Unity Quiz

Sunday, September 6, 2020

Everything We Watched In Lockdown

Thursday, September 3, 2020

Office Progress

Tuesday, March 12, 2013

Paths

Monday, March 11, 2013

Next Bot

Thursday, March 7, 2013

The Sign

Wednesday, March 6, 2013

VPK Search Paths

Tuesday, March 5, 2013