Advice Request: In Game NoteBook

Started by PaddyF, Mon 06/05/2019 23:14:24

Previous topic - Next topic

PaddyF

Hi guys,

Need advice:

I want my character to add information to a notebook over the course of the game which the player can review.

I am thinking about using ChangeRoom when the player looks at notebook in the inventory to change the player to a Notebook room.

If the player has acquired information from a dialog option, an address for example, and I want to update the NoteBook room to reflect that, should I create a duplicate room and use an if/else statement to load it?

I thought about using one room and numerous objects that appear if dialog options have been chosen but I've heard too many can hinder performance.

Finally, I would prefer the notebook room to appear in a box (320x200) over the 640x470 game screen, will I have to use a GUI for that?

Thanks for any and all advice

Khris

I'll address your final comment first: using a GUI is definitely preferable for that, mostly because you cannot display more than one room at the same time.
To show Notebook entries you can either use labels (text only) or buttons (to display sprites on the GUI).

The easiest way is to position those on the GUI in the editor, then turn them visible in-game one by one at the appropriate time. If the order isn't fixed, you might want to add some logic that keeps positioning the latest entry below already visible ones (using for instance GUIControl[lastindex].Y and GUIControl[lastindex].Height).

In this case all you need to do is show a "popup modal" GUI using gNotebook.Visible = true; and have a button that turns it invisible again.

PaddyF

#2
Thanks Khris.

I've implemented those steps and they appear to be working nicely.

Here is some Global script to call up the Gui and change the pages by toggling labels on and off via a next page button.

Code: ags

//Open NoteBook Gui Commands
function iNoteBook_Look()
{
  player.Say("Let's take a look..");
  gNotebookIndex.Visible = true;
    
}

//Index Button Handlers

function BLocations_OnClick(GUIControl *control, MouseButton button)
{
  gNotebookLocations.Visible = true;
  LLocations2.Visible = false;
  gNotebookIndex.Visible = false;
}



//Return To Index From Locations
function BReturnToIndex_OnClick(GUIControl *control, MouseButton button)
{
  gNotebookLocations.Visible = false;
  gNotebookIndex.Visible = true;
}


//NoteBook Put Away Command
function BPutAway_OnClick(GUIControl *control, MouseButton button)
{
  gNotebookIndex.Visible = false;
}

//Location Page Zero
function BNextLoc0_OnClick(GUIControl *control, MouseButton button)
{
  //Turn to Page 1
LLocations.Visible = false;
  LBarAddress.Visible = false;
  LPoliceDept.Visible = false;
  LApartmentAddress.Visible = false;
  LLocations2.Visible = true;
}

//Locations Page 1
function BLastLoc1_OnClick(GUIControl *control, MouseButton button)
{
  //return to Page 0
    //Page 2 Labels Below as TRUE
LLocations.Visible = true;
  LBarAddress.Visible = true;
  LPoliceDept.Visible = true;
  LApartmentAddress.Visible = true;
    //Page 1 Labels Below as FALSE
  LLocations2.Visible = false;
}




probably some unnecessary lines, but it is working.

to navigate the "pages" is to toggle page buttons visible/invisible based on what "page" the user is on.

I've built "Index" page on a separate duplicate Gui with buttons that navigate to other pages. gNotebookIndex has buttons to call up their relevant GUIs.

The problem I will have is by navigating the GUI's using visible true/false commands is when I want an event, i.e use iNotebook on suspicious person, to toggle a label visible in the GUI, it will conflict with the navigation system.

Can you help me script a check for if that event has happened or is their a simpler way to do it?

Thanks again for your help


Khris

I'm sorry to have to put it this way but you have two options:

a. Cobble something together using your current, very limited tool set. This will work eventually but be a huge hassle and a nightmare to maintain.

b. Spend a few more weeks learning more about programming techniques and AGS' capabilities in general, then do it properly.

I obviously recommend method (b), but it's up to you of course. Long story short, short of writing a module for you or posting pages of explanations, there's no good way to help you with this at this point. I dimly recall someone posting a notebook module, but I'm too lazy to search for it right now, with the "topic only" search being broken and all that.

PaddyF

Hey Khris,

That's a fair enough assessment.

I will be going with both options, and hopefully come out the end of it with the feature I want.

Thanks for you advice again

Paddy



SMF spam blocked by CleanTalk