Dialogie window popping in the middle of the screen.

Mareus
Greetings everyone!

I am wondering if there is a way to prevent the dialogue window popping out in the middle of the screen. I am using the following dialogue script:

topics = Split ("What mission?;I was born ready!;Err.. what mission?;Actually I am having second thoughts about it.", ";")
show menu ("", topics, true) {
switch (result) {
case ("What mission?") {
msg ("Viconia smiles. 'Oh don't be so coy. Haven't you heard you are going to Gliese 667 Cc?'")
speak_to_android_female_mission
}
case ("I was born ready!") {
msg ("'Good.'")
speak_to_android_female_mission
}
case ("Err.. what mission?") {
msg ("'Mission to Gliese 667 Cc.'")
speak_to_android_female_mission
}
case ("Actually I am having second thoughts about it.") {
msg ("'Oh don't worry about it.'")
speak_to_android_female_mission
}
}
}


Unfortunately whenever I choose an option the dialogue window pops out in the middle of the window. Is there a way to position it so that it doesn't go over pictures and the text? Also when I press cancel I get this message: Error running script: Object reference not set to an instance of an object. Is there a way to prevent the error showing up?

HegemonKhan
for the error:

I think by making your 'topics' variable, instead an attribute (by attaching it to an object), it'll work, for example:

game.topics_1 = Split ("What mission?;I was born ready!;Err.. what mission?;Actually I am having second thoughts about it.", ";")
show menu ("", game.topics_1, true) {
switch (result) {
case ("What mission?") {
msg ("Viconia smiles. 'Oh don't be so coy. Haven't you heard you are going to Gliese 667 Cc?'")
speak_to_android_female_mission
}
case ("I was born ready!") {
msg ("'Good.'")
speak_to_android_female_mission
}
case ("Err.. what mission?") {
msg ("'Mission to Gliese 667 Cc.'")
speak_to_android_female_mission
}
case ("Actually I am having second thoughts about it.") {
msg ("'Oh don't worry about it.'")
speak_to_android_female_mission
}
}
}

jaynabonne

I think by making your 'topics' variable, instead an attribute (by attaching it to an object), it'll work


Actually, that's not it. The error comes about because when you cancel, "result" is null. So the switch fails. You can handle that by putting:

if (result <> null) {
...
}

around your switch statement.

For the first part, you can't control where the popup comes up. (It's a bit tricky to try to determine where exactly pictures and text are anyway, short of not putting it over the window at all, which is highly non-standard.)

One option (if it suits you) is to change "show menu" to "ShowMenu". This will use the inline menu code instead of the popup, which might be more to your liking... or not. :)

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums