UncleBob's annoying API questions

Pioneer is an open-ended space adventure game. Explore the galaxy, make your fortune trading between systems, or work for the various factions fighting for power, freedom or self-determination.
Homepage: http://pioneerspacesim.net/
IRC: http://pioneerspacesim.net/irc
Downloads: https://pioneerspacesim.net/page/download/
Brianetta
Private
Posts: 863
Joined: Sun Apr 03, 2011 6:12 pm

RE: UncleBob's annoying API questions

Post by Brianetta »

Expanding on that last:The only Lua scripts that currently create globally scoped objects are the ones in data/libs, and that should probably remain the case. Scripts in that directory are executed before those in data/modules. Ideally, they should provide an API for module scripts to use. That API should be documented by means of the Codedoc system already used by those existing already.The only ones that exist so far are Translate.lua and Characters.lua, the bulk of both of which I wrote myself. Neither of them do anything directly visible to the player. They each provide a class, with methods which the module scripts use.
robn
Private
Posts: 1035
Joined: Mon Jan 31, 2011 10:29 pm

RE: UncleBob's annoying API questions

Post by robn »

Stuff under libs/ is considered part of the "core" API, just like Body, Ship, StarSystem and all those other things. The only difference is that they're written in Lua instead of C++.If you have functionality that you think will be genuinely useful to multiple scripts, then its likely it belongs in libs/. Don't overthink it though. If you're only implementing one module then just do it there. We can split out that functionality later if its going to be useful.
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: UncleBob's annoying API questions

Post by UncleBob »

Sounds like it's really the smartest thing to put them together again. I'm not comfortable enough yet with LUA for messing around with core functionality. Thanks for the help.
Post Reply

Return to “Pioneer”