conflicting OXPs -- partial solution

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

conflicting OXPs -- partial solution

Post by Commander McLane »

For quite some time we have again and again discussed the problem of conflicting OXPs, because their missionscreens pop up at the same time, so one missionscreen is overwritten by another one, and you miss some important information. For now the only solution is to remove one OXP from the addons-folder while playing the other.

Now I've found a partial solution I want to share. It's far from perfect (but perhaps could be perfected?), but anyhow it can help.

For Anarchies.oxp I have scripted the possibility to bribe a GalCop official in a main station to have your legal status cleared. Technically that works by being shown a missionscreen on a random basis, while you are docked at the main station in an Anarchy system. A GalCop officer will offer you to bribe him and you can accept or reject that offer.

Now as (for the changes of the legal system it does) you should have Anarchies.oxp in your addons-folder permanently, there can be conflicts with other OXPs that show missionscreens.

The "traditional" solution for me would be to insert a condition that checks whether any missions are running (like ionics, military or assassins, or even the built-in missions). And if so--meaning their main mission variable is neither undefined nor at its final value--I would have to prevent the bribe-script from being executed at all. Not very satisfying. Why should corrupt officers stop offering you to bribe them, just because you are running a mission?

So into the first set of conditions, that triggers the small series of missionscreens dealing with bribe, I inserted the following line:

Code: Select all

						"gui_screen_string equal GUI_SCREEN_EQUIP_SHIP",
As a result of that, if you dock at the station, any other mission can display its screen(s) undisturbed. The bribe offer will only be made in the moment when you enter the equipment-(F3-)screen. And this won't happen as long as you are busy with whatever your other mission requires you to do. So no conflict possible. In-game I have the perfect explanation that the corrupt officer approaches you while you are looking for equipment or refuelling.

Of course there is the chance that in the Anarchy station you're in you don't press F3, so you will never get the bribe offer. But this is bearable, as the offer comes with a random chance anyway.

---

To give out my complete information: I first tried GUI_SCREEN_STATUS as a condition, thinking that the status screen is where you land automatically after no more missionscreens are displayed. But it turned out that after each missionscreen, so after pressing SPACE or RETURN the engine sets the gui-screen to STATUS_SCREEN briefly before your next mission screen is displayed. So it didn't avoid the conflict.

Some more information: For reasons I don't know some of the screens don't produce a value in gui_screen_string. E.g. the save-screen returns an UNDEFINED, and the trade market screen does not--as you would expect--return GUI_SCREEN_MARKET, but just plain nothing. Not even an UNDEFINED.

---

So you scripters all: Feel free to use this (or a similar) method as well.

And most of all: Feel free to modify and perfect it!
Post Reply