Getting mission choices to work...

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Cmdr. Wombat
Deadly
Deadly
Posts: 150
Joined: Mon Jan 31, 2005 6:08 pm
Location: Kentucky

Getting mission choices to work...

Post by Cmdr. Wombat »

I've been trying to get the "player choice on mission screen" scripting to work. I can get it to work if I use it once in a script, but not subsequent times. If I have a second screen with choices hitting return to choose doesn't work. I can move between choices using the arrow keys. I've included test scripts below. Any idea where I'm going wrong? It doesn't seem to matter whether I put resetMissionChoice before or after setMissionDescription.
Thanks. :?

script.plist:

Code: Select all

{
    "questions" = (
                 {  
                    conditions = ( "galaxy_number equal 3", 
                                   "dockedAtMainStation_bool equal YES",
                                   "missionChoice_string undefined" ); 
                    do = ( setGuiToMissionScreen, 
                           "addMissionText: questions_test",
                           "setMissionChoices: questions_yesno" ); 
                 }, 

                 {
                    conditions = ( "galaxy_number equal 3",
                                   "dockedAtMainStation_bool equal YES",
                                   "missionChoice_string equal YES" ); 
                    do = ( "resetMissionChoice",
                           "setMissionDescription: question1" ); 
                 }, 

                 {  
                    conditions = ( "galaxy_number equal 3", 
                                   "dockedAtMainStation_bool equal YES" ); 
                    do = ( setGuiToMissionScreen, 
                           "addMissionText: questions_test2",
                           "setMissionChoices: questions_yesno2" ); 
                 }, 

                 {
                    conditions = ( "galaxy_number equal 3",
                                   "dockedAtMainStation_bool equal YES",
                                   "missionChoice_string equal YES" ); 
                    do = ( "resetMissionChoice",
                           "setMissionDescription: question2" ); 
                 }, 




                 ); 
}

missiontext.plist:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?> 
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
 <plist version="1.0"> 
 <dict> 
    <key>questions_test</key>
    <string>Is this question thing working?</string>
    <key>questions_yesno</key>
    <dict> 
       <key>YES</key>
       <string>Certainly looks that way.</string>
       <key>NO</key>
       <string>Not a chance.</string>
    </dict>
    <key>question1</key>
    <string>Okay, past first question okay</string> 
    <key>questions_test2</key>
    <string>can I ask a second question?</string>
    <key>questions_yesno2</key>
    <dict> 
       <key>YES</key>
       <string>If you insist.</string>
       <key>NO</key>
       <string>Not a chance.</string>
    </dict>
    <key>question2</key>
    <string>Okay, past second question okay</string> 
 </dict> 
 </plist>
[aegidian here - I edited this to make it a new topic, I'll get to answering it in a bit, mmkay?]
It is generally inadvisable to eject over the target you just bombed.
User avatar
aegidian
Master and Commander
Master and Commander
Posts: 1161
Joined: Thu May 20, 2004 10:46 pm
Location: London UK
Contact:

Post by aegidian »

You need to set a mission_variable to keep track of the question being asked so that you know which answer pertains to which question.

Then you can test that say "mission_mymissionquestion equal QUESTION_ONE" before checking the value of missionChoice_string.

I can work up an example for you, but I don't have time just now so I hope you can see the principle. Otherwise, give me a day or two.
"The planet Rear is scourged by well-intentioned OXZs."

Oolite models and gear? click here!
User avatar
Cmdr. Wombat
Deadly
Deadly
Posts: 150
Joined: Mon Jan 31, 2005 6:08 pm
Location: Kentucky

Post by Cmdr. Wombat »

Got it working now.
Many, many thanks. A new set of missions will be ready soon.

Yes, a set. :D
It is generally inadvisable to eject over the target you just bombed.
User avatar
johnsmith
Deadly
Deadly
Posts: 141
Joined: Fri Sep 22, 2006 10:32 am
Location: Teance
Contact:

Post by johnsmith »

I'm confused. Maybe the trumbles are addling my brain.

Code: Select all

            conditions = (
                "planet_number equal 141", 
                "galaxy_number equal 3", 
                "dockedAtMainStation_bool equal YES", 
                "mission_wedding undefined", 
            ); 
            do = (
                setGuiToMissionScreen, 
                "addMissionText: wedding_first_briefing", 
                "setMissionChoices: wedding_caruth_choice", 
                {
                    condition = {0 = "missionChoice_string equal YES"; }; 
                    do = {
                        0 = "set: mission_wedding STAGE1"; 
                        1 = "setMissionDescription: wm1_short_desc1"; 
                    }; 
                }
Is this the right way to do it? When I click on either option when play testing, I get a buzzing noise, and I can't go to another screen. What have I done wrong? Do I need to explicitly declare what I want to do if the player refuses the mission?

Code: Select all

	<key>wedding_caruth_choice</key>
	<dict>
		<key>NO</key>
		<string>The private concerns of naval officers are none of my business</string>
		<key>YES</key>
		<string>OK, I'll go to Teance</string>
	</dict>

EDIT: OK, got rid of that particular bug, but it still won't work. See

https://bb.oolite.space/viewtopic.php?t=2442
Post Reply