Tip:
Highlight text to annotate it
X
First you need to update ExtraForYouAreNotAlone to 1.1.1 or above.
We also need to upgrade a quest script
Scripts>Quests>System>Define>QuestNew
_newQuest[? "Mask"] = _mask;
Now we need to make space for the Quest Log in the pause menu
objOptions>Draw GUI
We need to change the order and positions on the title buttons.
DrawButton("Save/Load", 0, _xPos+206*0.5, _yPos);
DrawButton("Inventory", 0, _xPos+206*1.5, _yPos);
DrawButton("Options", on==onTitle, _xPos+206*2.5, _yPos);
And we add the quest button
DrawButton("Quests", 0, _xPos+206*3.5, _yPos);
Copy the whole part
objInventory>Draw GUI
Go to // Draw panel selection
Paste it
Move on==onTitle up to inventory and add a 0 in options instead
Remove the old
Copy the whole part
objSaveLoad>Draw GUI
Go to // Draw panel selection
Paste it
Move on==onTitle up to Save Load and add a 0 in inventory instead
Remove the old
Ok. The Quests button now exists.
We need to fix an instance order issue.
objOptions>Create
state="JustLoaded";
Step event
We will add everything in a state engine
switch (state) { case "Show":
We tab this twice. To get it aligned.
break; case "JustLoaded": state="Show"; break; }
This will allow us to set state="JustLoaded" and when it run it change state to "Show"
This fix the instance order issue. Because we got a lot of keyboard_check_pressed(vk_left) and right in the menus.
And all is in the Step event. So if objInventory is visible and we press right and objOptions happen to be after objInventory in the instance order list.
The keyboard_check_pressed(vk_right) will run in objOptions too.
and we may jump 2 tabs instead of one.
Ok. Lets continue.
In case (onTitle):
objInventory.state="JustLoaded";
When objInventory is show the state engine will wait one step until it check for keyboard presses.
Copy the last part.
Objects>objInventory>Create
state="JustLoaded";
Step event
Same here. We will add everything in a state engine
switch (state) { case "Show":
Tab twice.
Paste the end.
In case (onTitle):
objSaveLoad.state="JustLoaded";
objOptions.state="JustLoaded";
Copy the last part.
Objects>SaveLoad>Create
state="JustLoaded";
Step event
Same here. We will add everything in a state engine
switch (state) { case "Show":
Tab twice.
Paste the last part.
In case (onTitle):
objInventory.state="JustLoaded";
We need to create the quest menu.
Duplicate objSaveLoad to objQuests
Create event
We change these button names.
onInProgressButton = 1;
onHandInButton = 2;
onCompleteButton = 3;
Quest_array=-1;
Quest_array_offset=0;
This will be our buttons in this menu and hold the quest text
Step event
Line 7: if (keyboard_check_pressed(vk_left))
Line 12 and 13: objOptions.visible = true; objOptions.state="JustLoaded";
When the title "Quests" is select at the top and we press left the next "Options" will show instead.
case (onInProgressButton):
case (onHandInButton):
case (onCompleteButton):
on = onInProgressButton; break;
on = onHandInButton; break;
on = onCompleteButton; break;
case (onInProgressButton):
case (onHandInButton):
case (onCompleteButton):
on = onInProgressButton; break;
on = onHandInButton; break;
on = onCompleteButton; break;
This make the up and down arrow select each button
We also need to get the quest array when each is selected
Quest_array_offset=0; Quest_array=QuestGetLog(1); break;
Quest_array_offset=0; Quest_array=QuestGetLog(0); break;
Quest_array_offset=0; Quest_array=QuestGetLog(2); break;
Paste it here to. But I had some problems. So just wait...
Quest_array_offset=0; Quest_array=QuestGetLog(1); break;
Quest_array_offset=0; Quest_array=QuestGetLog(0); break;
Quest_array_offset=0; Quest_array=QuestGetLog(2); break;
Quest_array will now be filled with data about the selected quest state
We also need to enable left and right buttons so we can scroll
Line 15: Quest_array_offset-=1;
// Scroll quest text
if (keyboard_check_pressed(vk_right))
{ Quest_array_offset+=1; }
// Scroll quest text
Ok. We need to remove some old code in the last switch statement. Keep the close.
We now need to draw the quest text.
Draw GUI
Move on==onTitle to quests and replace it with 0
This makes the Quests title lit up when its selected
We need to change the button text and move them a little.
DrawButton("In Progress", on==onInProgressButton, _xPos+width*0.15, _yPos+height*0.5-80);
DrawButton("Hand in", on==onHandInButton, _xPos+width*0.15, _yPos+height*0.5);
DrawButton("Completed", on==onCompleteButton, _xPos+width*0.15, _yPos+height*0.5+80);
DrawButton
Ok. Now we draw the quest text
// Draw Quest Text
QuestDrawLog(Quest_array,Quest_array_offset,_xPos+width*0.30,_yPos+height*0.20,25,13);
DrawButton("Close", on==onCloseButton, _xPos+width*0.15, _yPos+height-48);
We need to show the Quests menu when we press left when the Options title is selected.
objOptions>Step
In if (keyboard_check_pressed(vk_right))
Copy this part.
Paste.
objQuests.visible = true;
objQuests.state="JustLoaded";
We need to handle the new quest menu in some places
Scripts>Misc Functions>NewGame
instance_create(0, 0, objQuests);
Scripts>Misc Functions>EndGame
with (objQuests) instance_destroy();
Scripts>Saving>Loading>LoadGame
instance_create(0, 0, objQuests);
Objects>objGame>Step
&& (!objQuests.visible)
with (objQuests) objGame.forcePaused |= visible;
Ok. All done. Time for a test.
We get this quest.
And this one.
As you see in the pause menu. We got a new tab.
If we click down we see the quests in progress. A head "Mask" and the name of the quest.
We dont have any hand on or complete yet.
Its a little simple. But there is not much space. But we may upgrade this quest log in the future :-)