Mission offering
Posted: Wed Jul 04, 2007 8:34 pm
I have programed a mission OXP. I'll upload it soon if I find out how.
In writing I noticed that missionoffering is handled badly by most programmers. Nobody takes the trouble if it is allowed at that time.
Result: Two missions are offered simultaniously but the player sees only one of them. This can easy be overcome by always checking if "gui_screen_string" is equal GUI_SCREEN_MISSION before a mission is offered. In oolite this check leads to somewhat complicated programming. So easier is it to test for the most important other pages as in next demo script:
<key>conditions</key>
<array>
<string>"Put your condition equasions here"</string>
<string>gui_screen_string oneof GUI_SCREEN_STATUS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_MARKET, GUI_SCREEN_SHORT_RANGE_CHART</string>
</array>
<key>do</key>
<array>
<string>setGuiToMissionScreen</string>
<string>addMissionText: test1</string>
</array>
Existing missionscripts are easy modified by searching for the text "addMissionText:" and add above "gui_screen_string" test in the condition.
For Assassins this adding took one minute, for targoidwars it took even less. I wrote a special OXP that offers a mission on every dokking and I had my own OXP. With this change all four OXP worked perfectly together and waited for each other in presenting their missions.
This works in 95% of the cases. To get a 100% compatibility betwee OXP one must introduce a extra variable that everybody checks. I wrote a proposal and will upload it together with my OXP.
Eric Walch
In writing I noticed that missionoffering is handled badly by most programmers. Nobody takes the trouble if it is allowed at that time.
Result: Two missions are offered simultaniously but the player sees only one of them. This can easy be overcome by always checking if "gui_screen_string" is equal GUI_SCREEN_MISSION before a mission is offered. In oolite this check leads to somewhat complicated programming. So easier is it to test for the most important other pages as in next demo script:
<key>conditions</key>
<array>
<string>"Put your condition equasions here"</string>
<string>gui_screen_string oneof GUI_SCREEN_STATUS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_MARKET, GUI_SCREEN_SHORT_RANGE_CHART</string>
</array>
<key>do</key>
<array>
<string>setGuiToMissionScreen</string>
<string>addMissionText: test1</string>
</array>
Existing missionscripts are easy modified by searching for the text "addMissionText:" and add above "gui_screen_string" test in the condition.
For Assassins this adding took one minute, for targoidwars it took even less. I wrote a special OXP that offers a mission on every dokking and I had my own OXP. With this change all four OXP worked perfectly together and waited for each other in presenting their missions.
This works in 95% of the cases. To get a 100% compatibility betwee OXP one must introduce a extra variable that everybody checks. I wrote a proposal and will upload it together with my OXP.
Eric Walch