Player scripting with Lua?

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderators: Oberlus, Oberlus

Post Reply
Space Krill
Posts: 1
Joined: Sun Apr 21, 2019 2:03 am

Player scripting with Lua?

#1 Post by PeterM_20492 » Sun Apr 21, 2019 2:13 am


Just wondering if anyone has considered providing player scripting with Lua.
Empire maintenance gets awfully tedious and I would like to script some logic to, for example, initiate builds of Basic Shipyard and Drydock when there's no other one of these in-system (or according to other rules I decide upon and script in.)

Later on in the game, I'd like to script 'auto-improve' planets, just queueing up terraforming and gaia transform if available.

Or a script that goes through the queue and puts ship builds at the top and terraforming and gaia transforms on the bottom.

If people got really sophisticated with their scripts, they could AI a "player" and have contests about whose player is the best.

Lua is "cool" because it's designed to be an embedded scripting language.

If I did this, would it be considered for inclusion in the code base?



User avatar
Release Manager, Design
Posts: 4892
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Player scripting with Lua?

#2 Post by Vezzra » Sun Apr 21, 2019 1:16 pm

We have already two scripting languages in FO, one self-designed (FOCS) for scripting game contents, and Python for the AI and universe generation scripts. The (long-term) plan is to replace FOCS with Python, not to add yet another scripting language to the mix.

So, if we wanted to include scripted player actions, extending the already present Python API would be the way to go.

That said, for the cases you cited this actually should not be done, because if you find something in the game that wants to make you use scripts to automate it (because you perceive it that repetitive and boring), than that means we've failed to meet our design goal and the game element/mechanic is in need of revision. There shouldn't be anything in the game that requires boring and repetitive micromanagement that can be done by a script.

I know that we currently have such elements/mechanics in FO, but the way to fix this is to redesign/revise those elements/mechanics properly. At least that's the plan.

Post Reply