Difference between revisions of "Moving to Lua"

From PioneerWiki
Jump to: navigation, search
Line 9: Line 9:
 
==Lua control of hyperspace==
 
==Lua control of hyperspace==
 
Instead of being a core API function, <tt>Ship.HyperspaceTo()</tt> would be a Lua function directly responsible for deciding upon the distance, fuel use, elapsed time, chance of failure and destination of a jump. This function could call a core function to initiate a jump with elapsed time and destination arguments, and the core would immediately set about destroying the current system, animating the jump and building the next one. If it decided the jump was to happen, the Lua function would deduct the relevant quantity of whichever cargo (if any).
 
Instead of being a core API function, <tt>Ship.HyperspaceTo()</tt> would be a Lua function directly responsible for deciding upon the distance, fuel use, elapsed time, chance of failure and destination of a jump. This function could call a core function to initiate a jump with elapsed time and destination arguments, and the core would immediately set about destroying the current system, animating the jump and building the next one. If it decided the jump was to happen, the Lua function would deduct the relevant quantity of whichever cargo (if any).
 
==Lua-based bulletin boards==
 
Everything that normally comes up when the player hits F4 whilst docked, implemented in Lua.
 
 
Depends on:
 
* New UI
 
 
==Lua-based commodities market==
 
Buying and selling goods in a custom shop
 
 
Depends on:
 
* New UI
 
* [[#Lua-based bulletin boards]]
 
  
 
==Lua-defined cargo==
 
==Lua-defined cargo==

Revision as of 19:26, 2 December 2014

Goal

This article assumes that a development goal of Pioneer is to move as much game logic as possible out of the C++ core, and into the Lua environment. That in time, Lua will govern what happens in the game, and the engine will be left to implement how that happens. What, not how is a guiding principle.

The goal of this article, therefore, is to determine a sequence of feature development where each feature is not implemented before something upon which it depends. Each feature is defined as a heading in the next section, including a bulleted list of features which must exist beforehand, and which should exist beforehand.

Features

Lua control of hyperspace

Instead of being a core API function, Ship.HyperspaceTo() would be a Lua function directly responsible for deciding upon the distance, fuel use, elapsed time, chance of failure and destination of a jump. This function could call a core function to initiate a jump with elapsed time and destination arguments, and the core would immediately set about destroying the current system, animating the jump and building the next one. If it decided the jump was to happen, the Lua function would deduct the relevant quantity of whichever cargo (if any).

Lua-defined cargo

All cargo (and equipment) items are defined in Lua, using some sort of cargo class. The engine itself is completely agnostic as to the concept of cargo. It doesn't know or care what you have, as long as it knows how much mass there is.

Depends on:

Arbitrary cargo

Special items ("MacGuffins") required to complete missions or quests. Could include, for example, "5 Furies statue" or "Mycoid vaccine".

Depends on:

Arbitrary equipment

Mission-specific equipment, such as cameras, soil samplers, radiometers, beacons, etc which must be activated or deployed as part of a mission.

Depends on: