More stuff accessible from Python
Posted: Wed Mar 05, 2008 6:56 pm
This is a bit of a "general" feature request. Problem is, too many things happen in C++, which, as a modder, one has no access to, and that, IMO, one should.
A perfect first example is quitting the game, either by pressing [ESC] after dying, or by pressing [ESC]-Q while still alive. Apparently this is done in C++ and there's no easy way to modify. At PU we want quitting actions to lead back to the opening main menu, rather than quit the whole application back to the desktop; but we can't seem to do it because the quitting is hard-coded.
Another is targets. We'd like to separate navigational targetting from tactical targetting, but it seems we have no access. It makes no sense that the "target nearest/most dangerous" hostile would target a base, even if it's a hostile faction base, when in PU most bases don't even have turrets for defense. And if I select a jump point as a navigational destination, it makes no sense that I would lose the selection when I need to target a ship, either to fight it or to talk to. Most importantly, the original Privateer game had independent navigational targeting (which put a white cross around your destination, rather than a locking square), and we'd like to make PU be like the original Privateer as much as possible. Question is, if AI is in Python, why not targetting?
Another example is ship purchases: It seems that in PU, when you buy a ship from the ship dealer guy, the purchase goes through a Python function; but if you purchase a ship through the ships GUI, the purchase is done in C++. This is a problem because we wanted to modify the purchase code so that if you have cargo in your current ship it gets moved to the new ship, automatically, if it fits; and otherwise it tells you that your cargo can't be moved and refuses the purchase. (This is to patch possible exploits such as having a Paradigm fully loaded with catnip, flying a cloaking Excalibur fighter to Kilrah, landing there, then having your Paradigm delivered unscratched with the full cargo.)
Another example: Right now there's a bug in PU which I hear is present in vegastrike as well... If your hull gets damaged, once you land, sometimes the price for repair is astronomical. Yes, it would be nice to have the bug fixed, but it would be nicer still if the computation for the repair cost was in a python function, so that one could just fix it. Not to say that it doesn't make sense that repairing something shouldn't be more costly than buying new, sometimes... It does make sense: if I total my car, how much would a garage charge me for putting it back together to brand-new condition? But in that case, we need a means to DUMP the item, just like one can DUMP mission cargo in the commodities room. But it seems that all of the GUI stuff is hard-coded and inaccessible to modders.
Another one: Faction name display on the HUD. We wanted the display code to automatically capitalize the first letter, plus the first letter following an underscore, for HUD purposes; but this is in C++ and Hellcat pledged to change that code, but we're still waiting, months after. Now we'd also like to NOT display any faction names that end with single or double underscores; but again, no access...
There needs to be some kind of policy in place for what's to be C++ and what's to be Python. Presently it seems kind of random.
A perfect first example is quitting the game, either by pressing [ESC] after dying, or by pressing [ESC]-Q while still alive. Apparently this is done in C++ and there's no easy way to modify. At PU we want quitting actions to lead back to the opening main menu, rather than quit the whole application back to the desktop; but we can't seem to do it because the quitting is hard-coded.
Another is targets. We'd like to separate navigational targetting from tactical targetting, but it seems we have no access. It makes no sense that the "target nearest/most dangerous" hostile would target a base, even if it's a hostile faction base, when in PU most bases don't even have turrets for defense. And if I select a jump point as a navigational destination, it makes no sense that I would lose the selection when I need to target a ship, either to fight it or to talk to. Most importantly, the original Privateer game had independent navigational targeting (which put a white cross around your destination, rather than a locking square), and we'd like to make PU be like the original Privateer as much as possible. Question is, if AI is in Python, why not targetting?
Another example is ship purchases: It seems that in PU, when you buy a ship from the ship dealer guy, the purchase goes through a Python function; but if you purchase a ship through the ships GUI, the purchase is done in C++. This is a problem because we wanted to modify the purchase code so that if you have cargo in your current ship it gets moved to the new ship, automatically, if it fits; and otherwise it tells you that your cargo can't be moved and refuses the purchase. (This is to patch possible exploits such as having a Paradigm fully loaded with catnip, flying a cloaking Excalibur fighter to Kilrah, landing there, then having your Paradigm delivered unscratched with the full cargo.)
Another example: Right now there's a bug in PU which I hear is present in vegastrike as well... If your hull gets damaged, once you land, sometimes the price for repair is astronomical. Yes, it would be nice to have the bug fixed, but it would be nicer still if the computation for the repair cost was in a python function, so that one could just fix it. Not to say that it doesn't make sense that repairing something shouldn't be more costly than buying new, sometimes... It does make sense: if I total my car, how much would a garage charge me for putting it back together to brand-new condition? But in that case, we need a means to DUMP the item, just like one can DUMP mission cargo in the commodities room. But it seems that all of the GUI stuff is hard-coded and inaccessible to modders.
Another one: Faction name display on the HUD. We wanted the display code to automatically capitalize the first letter, plus the first letter following an underscore, for HUD purposes; but this is in C++ and Hellcat pledged to change that code, but we're still waiting, months after. Now we'd also like to NOT display any faction names that end with single or double underscores; but again, no access...
There needs to be some kind of policy in place for what's to be C++ and what's to be Python. Presently it seems kind of random.