Jump to content
Sign in to follow this  
petsagouris

Lua Wishlist

Recommended Posts

It would be nice to see an event system for Lua for Reflex with the following:

OnPlayerConnected(id, player)
OnPlayerDisconnected(id, player)

OnPlayerJoin(id, player, team)
OnPlayerSpectate(id, player)

OnRoundStart(gametype, players, scores)
OnRoundEnd(gametype, players, scores)

OnGameStart(gametype, players)
OnGameEnd(gametype, players, scores)

OnHit(player, weapon, target, damage)
OnPickup(player, pickup)
OnWeaponPickup(player, weapon)

I also suggest that the following 3 Lua libraries should be supplied:

luasocket, luasql (sqlite please), lfs (file system)

 

edit: Furthermore (as if it were not enough already), I would like to have some functions to manage players:

Kick(player)
ForceSpectator(player)
SetWeapons(player, weapon[, ammo])
Message(player, text) --shown only to the player

Share this post


Link to post
Share on other sites

Sounds more like you want server-side stuff and not UI system stuff. Not really sure why a UI system would need any of the stuff you mentioned in the second list. Also you won't get a "onHit" function, simply because you could then start to calculate enemy stacks .... imagine the outrage. Nope. :D

 

Regards

Share this post


Link to post
Share on other sites

i don't want somebody to access my filesystem (lfs) and send it over the internet (luasocket)

 

I would be amazed if either of those are implemented since currently lua is parsed every frame (single thread) would pretty much suck...

Share this post


Link to post
Share on other sites

Most of what you are asking for can be written already. provided you don't expect to be playing, sounds more like spec stuff. you have access to player state , connecting/connected, game states for round/game start/end. you could track pretty much any pick of the current spec'd player/yourself and weapon pickups.

 

Only thing there that you can't really do already is onhit

Share this post


Link to post
Share on other sites

i don't want somebody to access my filesystem (lfs) and send it over the internet (luasocket)

 

I'd let people make a pitch at least for what application they have in mind that this would be useful for and balance it against the easily-minimized security concerns. This sounds like server-side stuff where they want to store stats in a SQLite database or something and then use luasocket to upload them elsewhere, in which case they're doing it wrong. They've missed the point someone made above that lua is currently for the UI system, and the UI doesn't need any of this access, and discussion of server-side lua is a separate thing. I'm all for a server implementation of lua scripting though so that server admins can make automation scripts for their servers.

Share this post


Link to post
Share on other sites

It is true that these are much more related to serverside stuff, not UI. Maybe the conversation ought to be placed in another forum, sorry about that.

Maybe a mod can move the topic more appropriately, even change the title.

 

As far as performance goes, those are not supposed to be called on each frame, as this is mainly for an event-based scripting system.

It might be usefull to consider the spectator, warm-up and after the match UIs to be handled by the server itself so as to cater for a customized experience, community and events promotions.

I would imagine a system that I would be able to review my detailed stats, as well as sent them to be aggregated and stored at some web app.

 

As far as security considerations I can assure you that as long as the source can be read and reviewed by the community there should be no fear.

Share this post


Link to post
Share on other sites

Assuming you can use luasql with sqlite to put these stats in a database, there are a thousand better ways to do everything else than having the game server itself handle sending data or interacting with the filesystem. It also lets server admins be server admins and not deal with dodgy game scripts that are going to interact with their filesystem. I like the idea of an event-driven server-side lua system though.

Share this post


Link to post
Share on other sites

Assuming you can use luasql with sqlite to put these stats in a database, there are a thousand better ways to do everything else than having the game server itself handle sending data or interacting with the filesystem. It also lets server admins be server admins and not deal with dodgy game scripts that are going to interact with their filesystem. I like the idea of an event-driven server-side lua system though.

Sqlite is completely maintenance free, its just files.

And another question: where would you get dodgy game scripts?

Share this post


Link to post
Share on other sites

Sqlite is completely maintenance free, its just files.

And another question: where would you get dodgy game scripts?

 

I never made any claims about how much or how little maintenance sqlite requires.

 

I don't need game scripts to aggregate and upload stats for me. There are decades worth of tools that do that job much better than someone reinventing the wheel in embedded lua. They'd be dodgy game scripts in the sense that even a really well-built Hackintosh is a dodgy Mac. A hammer is a great tool, but you don't drive screws with it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×