Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Pages: 1 2 [All]

Author Topic: How Add Window  (Read 11019 times)

0 Members and 1 Guest are viewing this topic.

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
How Add Window
« on: November 15, 2008, 02:55:14 AM »

I need basic instructions for adding a static image using the Window Editor and having it work in the game.

I read through as many forum posts and the docs online but can't find all the pieces or I'm missing something.  :  )
« Last Edit: November 15, 2008, 07:16:31 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How Add Window
« Reply #1 on: November 15, 2008, 10:19:14 PM »

Create a window, set its dimensions so that it covers the entire screen (e.g. 800x600). Set its "Transparent" property to true. Then add buttons or static controls to it where you want your on-screen icons displayed.
Finally, in some script (e.g. in game.script, if you want it to be visible all the time) call something like:

var WinHUD = Game.LoadWindow("path\name.window");
WinHUD.Visible = true;
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #2 on: November 15, 2008, 11:43:24 PM »

Thank you, Mnemonic, I will try it.  :D
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #3 on: November 16, 2008, 12:28:44 AM »

It works beautifully.  Am surprised how simple it is!  That doesn't mean I can add a more complicated window as easily but it's a start.   :o
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #4 on: November 16, 2008, 04:05:24 AM »

Am playing Deathgate and would like to add some Deathgate type things to my file.  Will be back as soon as I've searched the forum to see if there are already instructions on what I'd like to do and whether I can do said stuff based on search results.  :  ) I think everything that's done in Deathgate that I would like to do can be done in a Window. 
« Last Edit: November 16, 2008, 04:32:19 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: How Add Window
« Reply #5 on: November 16, 2008, 02:36:16 PM »

let me know if you need something more specific. Death gate is excellent game and it's an example of game which can be made totally in WME. :)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #6 on: November 16, 2008, 05:30:06 PM »

Thank you, Metamorphium, I'm sure I'll need some help. Am playing both Ghost in the Sheets and DeathGate while making a simple demo game to make sure that I can do the usual things I like to do in a game.  I found DeathGate by browsing this forum -- there was a discussion of adventure games.  It runs pretty well in Dosbox and I agree it seems very suited to WME.   

By the way, I really liked your music in the WME book exercises--it's my favorite type of music--. 
« Last Edit: November 16, 2008, 05:44:07 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #7 on: November 17, 2008, 04:12:40 AM »

I now have a question about following a Deathgate style.  What is the most efficient way of displaying talk topics at the bottom of the scene and the answers for each in a box up top right next to the picture of the speaker.

As here:


Would it be a window? As you click on the talk topic at the bottom, the response of the person in the picture appears up top in the box to the right of the picture.  I like this a lot. The screen seems to be broken into 3 parts: the picture of the speaker on the left, the response to each talk topic on the right and the talk topics on the bottom. It's nice that the talk topic that's selected appears yellow when you click on it but that's not absolutely necessary.

I'm trying to chase this down reading through old threads.  I found this old quote from Mnemonic:

"basically you can create "windows", those can have a backround image, title bar etc., plus the windows can contain other windows and "widgets", such as buttons, single line editors and static texts or images. Using these simple elements you can build up rather complex interfaces."

 
« Last Edit: November 17, 2008, 05:45:02 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #8 on: November 17, 2008, 08:44:50 PM »

Trying to figure out at least one way if not the best way to do this:
Looking at the particle emitter demo
I could create a window for each scene where I wanted this type of interface to take place could have 3 regions designed into the background (They are just there--drawn there).
Then could create the talk topics on the bottom square in a window via buttons.
Pressing a talk topic button, would trigger dialogue in the right hand box--just as in the particle emitter demo if you press the sentence for "Make snow"-it snows.  And when you press the sentence "Make rain" it makes rain. 

There has to be a better way.
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: How Add Window
« Reply #9 on: November 17, 2008, 09:54:26 PM »

Cat, for this you need exactly one window. You can even use the stock responses.def to boot. Simply put another static component to the right (the huge flowing text) and one static (or entity container) for the person's face. The rest is just background imagery. :)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #10 on: November 17, 2008, 11:16:31 PM »

Let me see if I understand the steps correctly:
1. Create window and script to load window.
2. Create buttons in the bottom that are the talk topics that the player depresses.
3. Create static component to the right of big face which is just a static component itself. 
4. Use stock responses.def somehow.

Only 2 things I'm vague on but maybe I just have to try it---
1. How do I use the stock responses.def?
2. How do I fill the static component on the right with the text that answers each talk topic?

Thank you for your help!

Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: How Add Window
« Reply #11 on: November 17, 2008, 11:27:50 PM »

Cat,

you might want to backtrack to the chapter about dialogues. :)

http://res.dead-code.org/doku.php/wmebook:ch7

You can newly open the responses.def file in the window editor and add there a few more components. When the response is triggered, you simply update the Text property of the upper static control.

Hope this helps.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #12 on: November 18, 2008, 01:56:26 AM »

There's so much knowledge stuffed into that WME book that I totally forgot Chapter 7!  Thanks. I will try it. Am not sure yet I know how to make it work in a window but will see how it goes.  :  )
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #13 on: November 18, 2008, 04:17:08 AM »

I reread Chapter 7--I had no problem implementing the dialogues in the game I made following the WME book.

But I'm lost. I don't have an actor at all in this little demo game that I'm making.  I do have a "phantom entity" that is nothing but a 2 pixel image.

I have my window "Box" all set up and it shows up when I play the scene.

I have the picture in as a static control.  I have a black background in on the right as a static control to hold the response text that should show up when the player left clicks on a talk topic.

I have two talk topics at the bottom as buttons.

I can open the responses def file in the window editor but what to do next escapes me.

I don't know what components to put in the responses def file or where to put them to trigger or create the response for each button.

Thanks for any help.  Everything is working fine except I'm stuck right here. 

Talking with an actor I can handle.  Talking split between a button and a static control is beyond me right now.

By the way, I'm really glad I printed your WME book out because right now I can't get into that area of the website.  :  )   
« Last Edit: November 18, 2008, 06:31:05 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #14 on: November 18, 2008, 06:01:58 AM »

To simplify where do I store the response for each button that represents a talk topic? I don't have an actor--no molly or sally.

How and where do I call that response?  How do I pass it to the static component that receives and displays the text for response to the button.

I would guess it's called on left click in script on the button that has the talk topic but I don't know what to put there.
« Last Edit: November 18, 2008, 06:47:07 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

sychron

  • Wanderer zwischen den Welten
  • Global Moderator
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 223
  • There is no spoon. The enemy gate is down!
    • View Profile
Re: How Add Window
« Reply #15 on: November 18, 2008, 12:25:29 PM »

Use DialogBranches / Dialog functions to store the topics. The WME Book gives an outline of this.
Logged
... delete the inner sleep ...

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #16 on: November 18, 2008, 04:18:25 PM »

Thanks, Sychron, I appreciate your help but I don't know how to do that with the setup I have.  I have my talk topic on a button.

For example,
"Hi, how are you."

Button has a name in the window editor  Button1

Player depresses that, then the response should show up in the static control on the upper right.  Static control has a name in the window editor  Textbox.

"I'm fine."

I don't know where to put the script to invoke the appearance of the text in the static control or what script to put there.

There are now 3 buttons--each one should invoke its own text to appear in the static control and player does not have to click on any one in any order to get the text for that button to show up.

I'll keep trying.  I don't think I understand completely how the engine uses the responses.def file.
« Last Edit: November 18, 2008, 04:44:39 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #17 on: November 18, 2008, 08:14:53 PM »

I figured out how to do this so it works for me.  I know there's a subtler more sophisticated method but since I'm a very new newbie, I'm just happy to have this work and to understand it. 

Since it might help someone else, I'm going to post what I did. I followed Organican's instructions for making a subtitle box.  It might also help the more knowledgeable people give me some tips on a better way to do it. If you don't think it's at all helpful, you can delete it.  :  )

I put a global in my little game's script base.scripts called "text".

I made a window in the scene where this all is to occur and called the window Box.

I attached one script to Box.  That says: 

#include "scripts\base.inc"
var Win = this.Parent;

Then I made a button "Topic" in the bottom left of the Window. 
Parent notify True
Text "How are you?"
Font Franklin
Text Aligned Left
Disabled False
Visible True
Pressed True
etcetera

To that button I attached a script I added by hitting scene add script called Topic:

#include "scripts\base.inc"

var Topic = this.Button;

on "LeftClick"
{
text="I'm fine. How are you?";
}


Then I made another button under that one in the bottom left for the second talk topic:
Parent notify True
Text "Tell me about the missing spell books."
Font Franklin
Text Aligned Left
Disabled False
Visible True
Pressed True
etcetera

Attached script same way called Topic2:

#include "scripts\base.inc"
var Topic = this.Button;
on "LeftClick"
{
text="Strange things are happening in the palace.";
}

Then on the upper right side I made a third button instead of a static object.

Called this button Text
Parent notify True
Text "This is where you will see the response. (Although I could probably leave this blank-haven't tried yet.)"
Font Franklin
Text Aligned Left
Disabled True
Visible True
Pressed False
etcetera

To that button I attached the script -- same way as before via scenes add script:

Text

#include "scripts\base.inc"

var Text = this.Button;

while(true)
{ this.Text=text;
Sleep(300);
}


Now when the player presses a talk topic on the bottom, the responsive answer shows up in the box on the right---and I still have my nice picture in a static on the left.

If anyone can improve on this or shorten it, please do.

Thank you all for your help----eventually I'll understand the better way to do this.   :D

« Last Edit: November 18, 2008, 08:24:52 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #18 on: November 18, 2008, 11:25:51 PM »

The only problem with this is that [null] appears on the screen in the response box until I've left clicked on the talk topic.  Is there a way to get rid of that without putting some code in the prior scene when changing scense to put some text there?
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #19 on: November 19, 2008, 04:39:07 AM »

Cat, for this you need exactly one window. You can even use the stock responses.def to boot. Simply put another static component to the right (the huge flowing text) and one static (or entity container) for the person's face. The rest is just background imagery. :)

I'd like to try this again but I still need some help to do it the way Metamorphium suggests.

By "the rest is just background"--does that mean that the questions (I call them talk topics) at the bottom, would be part of the background--drawn in with Text Art and regions put around each one that would trigger on left click the right static box to display the responses? 

I tried opening response def in my window but i then couldn't load the window--game wouldn't let me.

How do you open response def in a window? 

If I take this one step at a time maybe I can do the sleek way of doing this.  But I need some help here. : )

« Last Edit: November 19, 2008, 06:38:13 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: How Add Window
« Reply #20 on: November 19, 2008, 11:02:57 AM »

Cat, please send me a link (pm) to some minimalistic repro project, I'll look into it for you.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #21 on: November 19, 2008, 04:05:42 PM »

Thanks, I can send it tonight. There isn't much in there yet but I did set up the window--2 static screens and a button at the bottom on the left and some script for the window and the button.  I took the responses.def out of the window as I just couldn't get the window to load otherwise.  Thank you very much for any help.
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How Add Window
« Reply #22 on: November 20, 2008, 03:22:18 AM »

I sent the link.  Thanks, Metamorphium.
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  
Pages: 1 2 [All]
 

Page created in 0.056 seconds with 20 queries.