Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Pages: [1] 2  All

Author Topic: Making a notepad interface  (Read 18512 times)

0 Members and 1 Guest are viewing this topic.

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Making a notepad interface
« on: December 05, 2003, 05:07:37 PM »

Hello!

Could someone give any ideas about the best way to create a Notepad-like system? The basic idea is this:

In the game, the protagonist can take notes of certain items, characters and locations. For example, when the character looks at a person, a note (written by the game developers, not by the player) about the person is added to the notepad. The notes can later on be viewed, all on one page, and readed. - Similar to the system in Discworl Noir, from these parts.

There should also be the ability to combine notes.

The best way would probably be to use a window for the whole notepad and "buttons" for each notepad entry. Or is it? Would it be more beneficial to use entities loaded into the window instead of buttons? Or perhaps a whole other kind of method?

Thanks,
Jussi Eskelinen
Programmer, ForeverDream Studios
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Making a notepad interface
« Reply #1 on: December 05, 2003, 05:58:17 PM »

Hi,

since jnsfbi wants a notepad in her game too, we've discussed that a bit before. I scripted a simple system where each notepad page can contain two blocks, either a text or an image. Then you simply fill in a page by calling one script method when appropriate. It's implemented as a window with four static controls, loading in either an image or a text. The notepad content is just an array of objects in a script.
It was fine but too limited for certain kind of information. So the other idea was to prepare the more complicated notepad pages as separate .window files and load them when needed (a window can contain other windows and load them dynamically).

The ultimate solution will be a simple HTML viewer I'm working on, but it will take some time to finish. Plus, it probably won't be suitable for your needs. But having a few static controls and fill them with different texts might work in your case. It depends on how complicated your notepad will be.

I hope that helps a bit.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Making a notepad interface
« Reply #2 on: December 05, 2003, 06:07:27 PM »

Here's a sample of the simple system I've been talking about above:

http://dead-code.org/download/diary.zip

What you need to do to use it is:

1) load the window into a global variable

global WinDiary = Game.LoadWindow("diary\diary.window");
WinDiary.Visible = false;

2) display the diary when needed

WinDiary.GoExclusive();

3) add new pages using the AddPage method (method AddPage(Text1, Text2, IsImage1, IsImage2))

WinDiary.AddPage("Blah blah~nSecond line", "path\MyImage.bmp", false, true);

You can specify either a text or a path to a sprite/image as the first two arguments. The last two are logical values specifying whether you passed in image or text.
« Last Edit: December 05, 2003, 06:09:20 PM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re:Making a notepad interface
« Reply #3 on: December 06, 2003, 03:40:17 PM »

Thank you very much, I'll check that out! :)
Logged

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re:Making a notepad interface
« Reply #4 on: December 07, 2003, 03:06:01 PM »

...but combining notepaqd items? For example a page like this:


-----------------------------------------------------------------
Note1: A pirate was killed.

Note2: A blunt instrument was found next to the pirate.
-----------------------------------------------------------------

You could click note 1 and then note 2, and thus create a new note: "The pirate was killed with a blunt instrument."

This is what i'd need the buttons for...
Logged

creatorbri

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
  • I'm a llama!
    • View Profile
Re:Making a notepad interface
« Reply #5 on: December 07, 2003, 06:47:54 PM »

I believe we were thinking of putting a graphical checkbox next to each note, so that the user could click to put checks by two notes, then click a button at the bottom or someplace to combine them. How would this be done in a Window?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Making a notepad interface
« Reply #6 on: December 07, 2003, 07:09:12 PM »

How about having a prefabricated page template with several lines and checkboxes and filling them in and hiding/showing them when needed? Similarly as in the diary example I've posted but with more complex "blocks".
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

McCoy

  • The cocido eater
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 365
  • Spurrrrrrring
    • View Profile
    • Spur Games
Re:Making a notepad interface
« Reply #7 on: December 08, 2003, 01:03:26 PM »

Or why not making a system simillar to the inventory? The diary notes are static controls, if you click over one of them, it attachs to your cursor (like a game inventory object does), and then when you click over another text line (and that's the text line intended to be combined with) you can use it like an event like you do in the inventory, something like

Code: [Select]
on "notePirateKilled"
{
     noteOn = noteWindow.GetControl("notePirateKilled");

     self.Text = "A pirate was killed with a blunt instrument";
     noteOn.ApplyEvent("destroy");
}

on "destroy"
{
      self.Visible = false
}

Of course this would need MUCH improvement, but it shows my basic idea. But now that I think of it, it would be very tedious to add all the static controls needed, maybe you could do it in run-time making a fuction for creating them or something.

Well,  that's only my idea, and likely not the best  :-[
« Last Edit: December 08, 2003, 01:06:15 PM by McCoy »
Logged

Click here to sign my sig!

creatorbri

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
  • I'm a llama!
    • View Profile
Re:Making a notepad interface
« Reply #8 on: December 09, 2003, 09:04:39 PM »

For the time being we've decided to make the notebook a mostly static thing, more like a diary of events and descriptions. But we still would like to eventually expand the notepad into a fully interactive system.

In the meantime, I would like to use the notepad notes as triggers for dialogue. In other words, the notepad can be displayed while in a dialogue tree, and a note can be selected, which triggers a question from the main actor that is related to that note. I'm sure Jussi (deadworm222) would appreciate ideas on implementing this (even though I'm sure he could figure it out on his own :)).
« Last Edit: December 09, 2003, 09:10:52 PM by irbrian »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Making a notepad interface
« Reply #9 on: December 09, 2003, 09:59:20 PM »

It wouldn't be possible to display the notepad and the built-in "response box" at the same time, since the reponse box disables the game. But it wouldn't be a good idea anyway. IMHO showing the notepad instead of the responses shouldn't be a problem. For example having a method like GetTopicFromNotepad which would display the notepad, wait for the player to select something and return the topic back to the script so that it could process the topic appripriately...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

creatorbri

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
  • I'm a llama!
    • View Profile
Re:Making a notepad interface
« Reply #10 on: December 09, 2003, 10:46:13 PM »

Yeah, I was thinking we could just have one of the dialogue options be something like "[Ask about something in my Notebook...]" -- that option would then display the notepad, and whatever note was selected would trigger the appropriate dialogue.
Logged

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re:Making a notepad interface
« Reply #11 on: December 23, 2003, 10:07:12 AM »

I've been tweaking the diary script to make it suitable for our needs, but now there's a problem to which there's probably an easy answer.

I have made three separate windows: characters.window, locations.window, and events.window, each of which contains notes from their respective subjects. (Respective? Sounded cool, but I don't know if it means what I think it means...)

You can open the windows separately from F5-F7, and like that they work just fine. Now, I've also made it possible to open each window from every other window, so that in all windows there are buttons called LOCATIONS, EVENTS, CHARACTERS. However, when you click one of these buttons, the window DOES open, but it doesn't display the contents!

Here's an example piece of the non-functioning code:
Code: [Select]
on "locations_button"
{

this.Close();
var WinLocations = Game.LoadWindow("diary\locations.window");
WinLocations.GoExclusive();

}

What is the problem?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Making a notepad interface
« Reply #12 on: December 23, 2003, 10:34:14 AM »

Hm, I tried that on the WME demo, modified the on "save" handler in mainmenu.script to the following:

Code: [Select]
////////////////////////////////////////////////////////////////////////////////
on "save"
{
  this.Close();
  var WinSave = Game.LoadWindow("interface\system\save.window");
  WinSave.GoExclusive();
}

and it seems to work fine, all the code in save.window gets executed properly. Is there something special about your windows?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re:Making a notepad interface
« Reply #13 on: December 23, 2003, 02:23:14 PM »

I fixed this problem, I just had to define the windows as global. Now it works beautifully.
Logged

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re:Making a notepad interface
« Reply #14 on: December 26, 2003, 09:31:14 AM »

I just want to report you that notepad programming is going well so far. Thanks for all the support :D
Logged
Pages: [1] 2  All
 

Page created in 0.044 seconds with 20 queries.