Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Pages: 1 2 [All]

Author Topic: Making a notepad interface  (Read 18522 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

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 #15 on: December 26, 2003, 09:42:17 AM »

I'm glad to hear that :)
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 #16 on: January 02, 2004, 04:24:07 PM »

I have a problem with the notepad system, once again. Everything else works, but...

I have three separate windows - Locations, Events and Characters. Now, when I talk to a person, and choose [Consult Notepad], the Characters-window appears by default. In each window are buttons that open the other windows. Now, if I don't want to ask about anything in the Characters window, I should be able to choose either the Events or locations window - and this works - but because the code looks like this

Code: [Select]

if(Selected==4)
      {

Loop=false;
Game.Interactive = true;
WinCharacters.GoExclusive();

Game.Interactive=false;

if(question=="1")
{
WinCharacters.CrossOutNote(1);//removes the first note

actor.Talk("Ask about the first note");


}






if(question=="2")
{

WinCharacters.CrossOutNote(2);
actor.Talk("ask about the second note");





}


if(question=="3")
{
WinCharacters.CrossOutNote(3);
actor.Talk("ask bout the third note");

}

if(question=="4")
{

WinCharacters.CrossOutNote(4);

actor.Talk("fourth note");

}


OldGuyDialogue();//after asking, go back to dialogue


...the Locations/Events window opens AND the OldGuyDialogue() script is executed, thus displaying the dialogue choices and making the screen a mess.

I tried a different method: I created one window called Notepad, and made Characters/Loacations/Events sort of sub-windows (if real subwindows can be created, I don't know how). Within the Notepad-window I could have switched between the different sub-windows  - but this didn't work, as the only way to open a window is the GoExclusive, and when another window is opened on top of the Notepad window, it makes the controls in Notepad-window unaccessible.

In my mind a few ideas are forming, but... do you have any ideas?
Logged

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re:Making a notepad interface
« Reply #17 on: January 02, 2004, 07:34:49 PM »

Never mind: the notepad interface is now fully functioning! :D
Logged

MMR

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 349
  • http://mmrdeveloper.wordpress.com/
    • View Profile
    • TinyWME
Re:Making a notepad interface
« Reply #18 on: January 02, 2004, 08:19:04 PM »

When will you show us something of that???

I'm eager!!  ;D
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 #19 on: January 02, 2004, 10:03:11 PM »

Never mind: the notepad interface is now fully functioning! :D


Great, you were faster than me :) How did you fix it?
About the sub-windows, it should be possible, i.e. to nest a WINDOW definition infor other window, but I found it's broken :( It will be fixed in the next build.
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 #20 on: January 03, 2004, 10:08:45 AM »

Sorry, MMR, I'm under a wov of silence ;) . If everything goes well, you don't have to wait too long for a playable demo. Have you visited the teaser site? http://www.foreverdreamstudios.com/games.html

Instead of making the buttons  open a window, I made them assign a value to a global variable (which I cleverly named go_on, don't ask me why); like go_on="characters", go_on="events", go_on="locations". Then, in the dialogue script:

Code: [Select]
if(Selected==4)
{

Loop=false;
Game.Interactive = true;
WinCharacters.GoExclusive();

for(var f=0; go_on!="go_on"; f=f+1)
{
if(go_on=="characters") WinCharacters.GoExclusive();
if(go_on=="events") WinEvents.GoExclusive();
if(go_on=="locations") WinLocations.GoExclusive();
}

if(go_on=="go_on")
{
//we have selected a note, and an appropriate response will be heard

Now it's stuck in the loop, until go_on=="go_on" - whic happens if you close the window or you click on a note that begins a dialogue. Phew!
Logged

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Making a notepad interface
« Reply #21 on: December 31, 2010, 08:55:23 AM »

Can anyone post a working sample project of this  technique? Thanks
Logged
Pages: 1 2 [All]
 

Page created in 0.039 seconds with 20 queries.