Discovery Gaming Community

Full Version: Can FLHook be made easier
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am making a thread just to ask because I'm not sure if it's even on the right track or if anyone had ever tried something like this.

Can FLHook be reimplemented or extended with a scripting language? Currently to write FLHook plugins you need to have a decent knowledge of C++ and knowledge of its limitations to avoid things like client-side crashes or infinite jump bugs that anyone who has played long enough on disco surely remembers.

I was wondering if there ever was any kind of effort to provide an interface for FLHook that would allow for safer plugin development in more high level languages such as Lua or JavaScript or if anyone knows if such a thing would even be possible. I know that it's possible to use native C++ module bindings in Node alongside JavaScript code so maybe someone tried it before.

Perhaps TheStarport would be a better place to ask but I'm not really into that community so I'm asking here in hopes that someone knows something.
have u tried asking on the Freelancer Galactic Community discord? there's more flhook devs there


https://discord.com/invite/c6wtsBk
I think the risks like infinite jump bugs and the likes aren't quite as present if you're doing stuff like adding (minor?) functionality to existing plugins, like say adding a new factory archetype to PoBs with slightly different mechanics. It's when you start making Freelancer really do new things it doesn't want to do that it might choke. But yeah, C++ still isn't the most approachable I suppose.
There are some people on other servers working on a simpler version of FL-Hook
It's a nightmare but can be done...
introducing language without static typing and with runtime not handled errors like Javascript is extremely bad idea.
otherwise i believe it should be possible transforming flhook to work in another language. I would not have minded this language being Golang, C#, Java or Rust though. Anything static typed at least. Golang and Rust sound like a good idea to me.
Familiar with Golang enough to know it will be working splendidly for sure for this goal. Fast performance, has pointers, easy to learn. Certainly lovely language for this goal.
how to make the connection is another story though. Something like C shared libraries, or through some other way connecting.
There was some guy that made a python based hook many years ago and another guy that made a plugin to use python scripts.

There's also the FLHook listener to which you can send commands. We tested this years ago with Blodo with some ASP.NET app that could send arbitrary admin commands to the server as we were experimenting with web interfaces for POB management.

While it would be a nice change, I can't fathom why anyone would want to do something like this in 2023 as it wouldn't really bring anything new to the table. This is a dying game without an open-sourced engine. It cannot survive the same way Doom, Stalker or even Freespace 2 can. It can be a really great learning project as the use case we have here is extremely rare, but as far as a use in production go it would be a nightmare as there's so much legacy behavior you'd have to make sure is reimplemented it probably would become nothing but a development hell, let alone the months/years of work you'd need to reimplement the existing plugins if the intent is to completely replace the current hook.
I will address the title of the thread* as adding a scripting language introduces more headaches than advantages.

(10-17-2022, 03:29 PM)Corile Wrote: [ -> ]I am making a thread just to ask because I'm not sure if it's even on the right track or if anyone had ever tried something like this.

The problem with FLHook is that Disco allowed beginners do stuff to it, because of a lack of capable developers, which converted it into a rotting biomass of everyone's excrements. Rewriting the entire thing from scratch is the only way because the entirety of current and past developers are not capable nor experienced enough to do it. Time constraints are not a thing, you could convert the entire FLHook into something capable under 2 months - assuming you work on it during the weekends.

Yet I've played around with Freelancer and found out it's extremely simple to mod the game the right way, as what people call "engine limitations" are sad excuses for their inabilities.

(01-22-2023, 10:34 AM)Alley Wrote: [ -> ]While it would be a nice change, I can't fathom why anyone would want to do something like this in 2023 as it wouldn't really bring anything new to the table. This is a dying game without an open-sourced engine. It cannot survive the same way Doom, Stalker or even Freespace 2 can. It can be a really great learning project as the use case we have here is extremely rare, but as far as a use in production go it would be a nightmare as there's so much legacy behavior you'd have to make sure is reimplemented it probably would become nothing but a development hell, let alone the months/years of work you'd need to reimplement the existing plugins if the intent is to completely replace the current hook.






Imagine in 2023 that you can create a system dynamically, share it with other clients, and creating bases only when they're in range. This completely bypases any INI files and makes the game impossible to metagame. This change took about an evening to implement, it is so simple. And instead of stuff like weapons/ships/commodities being in INI files, I made them load from an SQL database which makes everything much simpler and user friendly.

I'm doing stuff which nobody in the last 20 years imagined are possible.
(01-22-2023, 10:34 AM)Alley Wrote: [ -> ]There was some guy that made a python based hook many years ago and another guy that made a plugin to use python scripts.

There's also the FLHook listener to which you can send commands. We tested this years ago with Blodo with some ASP.NET app that could send arbitrary admin commands to the server as we were experimenting with web interfaces for POB management.

While it would be a nice change, I can't fathom why anyone would want to do something like this in 2023 as it wouldn't really bring anything new to the table. This is a dying game without an open-sourced engine. It cannot survive the same way Doom, Stalker or even Freespace 2 can. It can be a really great learning project as the use case we have here is extremely rare, but as far as a use in production go it would be a nightmare as there's so much legacy behavior you'd have to make sure is reimplemented it probably would become nothing but a development hell, let alone the months/years of work you'd need to reimplement the existing plugins if the intent is to completely replace the current hook.
We work on it because it is fun to work on, it allows us to work with the newer features of C++, and overall modernising something as old and archaic as FLHook serves as very good RDD (Résumé Driven Development). Unlike working on a personal side project that would never see the light of day, our work on FLHook can at least be used by some people, however small the sample size might be there. It allows us to work on a proper project with all the planning and management that goes into such and it's just overall a very good thing to get practice on.

To actually answer the OP: Adding in a scripting language is almost never going to happen and offers very little. FLHook 4.0 has been made far more moddable than FLHook 2.1 ever was, and day by day we add more and more development utilities.

(01-22-2023, 01:29 PM)StDH Wrote: [ -> ].....

For the love of god please don't tell me this is an actual take or you work in the industry. If so I feel very sorry for your employer.

(01-22-2023, 01:29 PM)StDH Wrote: [ -> ]I'm doing stuff which nobody in the last 20 years imagined are possible.
Yikes. Me, FriendlyFire, Nen, Raikkonen, Alley, and a very long list of people would like a word lol.

Being able to adjust Adoxa's code or read hack offsets from the Starport does not make you a competent client modder, and looking at that video... well, yeah.
(01-22-2023, 01:29 PM)StDH Wrote: [ -> ]I'm doing stuff which nobody in the last 20 years imagined are possible.

I'm really happy for you buddy, great job !