Menu is being displayed twice?
zach0ary
30 Nov 2016, 08:16Why is this code making the menu come up twice?
menulist = Split("Answer;Ignore", ";")
ShowMenu ("Therapist : Why do you blame yourself for your friends death", menulist, false) {
if (result = "Answer") {
msg ("You: Do You believe that if you die in your dream you die in real life? See I killed my friend in my dream and he died in real life.. plain and simple.")
msg ("The therapist takes notes")
SetTimeout (3) {
play sound ("Door Kick sound effect.mp3", true, false)
OutputTextNoBr ("Someone in kevlar armor kicks down the door, knocks the therapist out and then you get knocked out.")
play sound ("skypesmsto_35vqfqpz 2016-11-27 09.05.02.wav", true, false)
MoveObject (player, Cell)
}
}
else {
OutputTextNoBr ("Therapist: Ignoring me wont help you, I know you think that you killed your friend but that's impossible, He died of a heartattack.")
play sound ("Door Kick sound effect.mp3", true, false)
OutputTextNoBr ("Someone in kevlar armor kicks down the door, knocks the therapist out and then you get knocked out.")
play sound ("skypesmsto_35vqfqpz 2016-11-27 09.05.02.wav", true, false)
MoveObject (player, Cell)
}
}
The Pixie
30 Nov 2016, 08:31I just tried it in test game with the play sound
lines removed (as I do not have the files), and it works fine. Either it is the sounds or something else in your game.
I have no experience of using sounds, but you could comment out those four lines by putting //
at the front and see if it still happens. If it does, it is not the sounds, and you need to look elsewhere.
sirwacka
01 Dec 2016, 13:40inexperienced user here, but could it possible be because you put the Split before the ShowMenu?
hegemonkhan
01 Dec 2016, 13:55unfortunately that's not it, but good guess at it.
the 'split' is a Function that creates a list and then returns that list, which is then being stored/saved/set into the 'menulist' Variable. That 'menulist' Variable is then used by the 'ShowMenu' Function, providing the 'ShowMenu' Function the needed list (as a Parameter/input, being that list, to be used within the 'ShowMenu' Function) as the Value of the 'menulist' Variable.
it's working almost exactly like this in math algebra:
menulist : x
the created list : 4
ShowMenu : y
ShowMenu's other Parameters/Inputs (question message, and whether to be able to cancel out of ShowMenu during game play or not): + 5
x = 4
y = x + 5
// y = 9
// the '4' is being used only once (aside from it being set/stored/saved into the 'x' Variable) to produce the 'y = 9'
// and like-wise, the 'created list' (created via the 'split' Function) is being used only once (aside from it being set/stored/saved into the 'menulist' Variable) to produce the in-line menu during game play via the 'ShowMenu' Function and its use of the inputted 'created list' (via the 'menulist' Variable as a Parameter) for its usage