Dreaded meetings
The first conversation that needed to be implemented was the meeting. This conversation could have been done using 25 separate conversation screens, but instead is handled with only a tiny bit of code. The first piece of code, which actually didn't need to be done this way, but I didn't feel like typing black a bunch of times so I build the blah string using a tiny bit of code.
- BLAHSTRING = "BLAH";
- for (var cntrBlah = 0; cntrBlah < 25; ++cntrBlah)
- {
- }
When the game is restarted, the meeting conversation is reset to the starting conversation with the following code.
- meetingTime = 0;
- npcMessage = "I am glad that you were all able to make it to this mandatory meeting. Over the next two hours I will tell you about our current financial situation and what we are doing about it.";
Within the bossloop frames, the following code is used to set the menu choices to proper choices.
- stop();
- dialog_movie.ST.setCallback(this, bossLoop);
- dialog_movie.ST.setMessage(npcMessage);
- if (meetingTime >= 24)
- dialog_movie.ST.setMenu(2,"Goodbye", 2);
- else
- {
- dialog_movie.ST.setMenu(1,"Wait (" + (120-meetingTime*5)+")", 0);
- dialog_movie.ST.setMenu(3,"SKIP (-25Points)", 1);
- }
As you can see, this sends events to a function called bossLoop, which is a fairly simple message handling function.
- function bossLoop(n)
- {
- if (n == 1)
- {
- score -=25;
- meetingTime = 23;
- }
- ++meetingTime;
- if (meetingTime == 24)
- npcMessage = "So, as you can tell from the profit summary, our company is losing money. Now for the important news I promised. To remedy the situation I have sold the company. You will all receive your final paycheck from Nancy. Don’t worry about me, my uncle made sure that I got a golden parachute from the purchasing company. Have a good day.";
- else
- if (n==2)
- else
- }