Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Pages: 1 2 [All]

Author Topic: TEXT issue  (Read 8278 times)

0 Members and 1 Guest are viewing this topic.

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
TEXT issue
« on: March 13, 2007, 11:59:55 PM »

Hi,
    In my project I have a scene defined for closeups of items. With this closeup is a scroll telling the player some details about the item they have picked up.

But what I also need is some text at the bottom of the screen showing these details for localization purposes.

I know how to define a window for this scene to hold the text but how would I define and get the text to appear for the different items?

As I said I have one scene, and the ability to drag items from Inventory into the scene to give the closeup and the details, I just need the Text at the bottom of the screen.


Many thanks



Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: TEXT issue
« Reply #1 on: March 14, 2007, 03:17:17 PM »

It's hard to give any reasonable answer, because it's all very dependant on your implementation.
But you could for example make a convention that all the inventory items will provide a custom property called "Description", so in each of the item scripts you'd add something like:

this.Description = "This is some log description of this inventory item";

And later when displaying the item close up, you'd have to keep track of the currently selected item, check its Description property and display it in the window.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TEXT issue
« Reply #2 on: March 14, 2007, 03:41:19 PM »

Yes I understand, Sorry I have the window and I know where to put the text descibing the item as each item has a section of seperate code in the script.

But I cannot use actor.Talk to show the text as I do for actor speech as the actor is not present on screen, what is the command to show the text in the window?

As this window displays Talk lines.

Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: TEXT issue
« Reply #3 on: March 14, 2007, 11:29:18 PM »

you can use an Entity Container as a window component and invoke the Talk of the attached entity.

Hope that 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

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TEXT issue
« Reply #4 on: March 15, 2007, 12:27:23 AM »

hmmmmm is this the same as the credits on the demo?

Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: TEXT issue
« Reply #5 on: March 15, 2007, 07:11:40 PM »

I don't think so.

your window would have something like this:

   ENTITY_CONTAINER
   {
     NAME = "Caption"

     X = 0
     Y = 0
   
     VISIBLE = TRUE
     ENTITY = "path_to_some_entity\entity.entity"
   }   

where your entity will be a file with font definition etc. with for example name entity_caption

then you can access the Talk method by first accessing the container:

var container = yourwindow.GetControl("Caption");

then access the entity itself

var ent = container.GetEntity("entity_caption");

and lastly call

ent.Talk("blabla");

This should work although I can't test it right now.

« Last Edit: March 18, 2007, 01:03:57 AM by metamorphium »
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TEXT issue
« Reply #6 on: March 18, 2007, 06:13:31 PM »

Hi,
    Thanks for this but I still cannot get it to work and get errors: -

Call to undefined method 'GetEntity'. ignored.

Here is what I have.


CLOSEUPWIN.window  - definition file

WINDOW
{
X =705
Y = 480
WIDTH = 200
HEIGHT = 200
NAME = "CLOSEUPWIN"
}

ENTITY_CONTAINER
{
NAME = "CLOSEUPTEXT"
X=0
Y =0
VISIBLE = TRUE
ENTITY = "interface\CLOSEUPWIN\CLOSEUP_TEXT.entity"
}


Then I have my ENTITY script - CLOSEUP_TEXT.entity

ENTITY
{
NAME="CLOSEUP_TEXT"
CAPTION="closeup_text"
ACTIVE=TRUE
FONT = "fonts\outline_white.font"
}




Then in my Scene_init script for ITEM CLOSEUPS I have -


global CLOSEUPWIN;
CLOSEUPWIN.visible = true;
var container = CLOSEUPWIN.GetControl("CLOSEUPTEXT");
var ent = container.GetEntity("CLOSEUP_TEXT");
ent.Talk("BLAH....BLAH.....BLAH!!");



any ideas where I am goign wrong??
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: TEXT issue
« Reply #7 on: March 18, 2007, 07:01:41 PM »

hmm, try:

Code: WME Script
  1. var ent = container.GetEntity();
  2. ent.Talk("BLAH....BLAH.....BLAH!!");
  3.  
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TEXT issue
« Reply #8 on: March 19, 2007, 04:42:58 PM »

I have a feeling its my WINDOW setup - see below

WINDOW
{
X = 705
Y = 480
WIDTH = 200
HEIGHT = 200
NAME = "CLOSEUPWIN"
  SCRIPT = "interface\CLOSEUPWIN\CLOSEUP_TEXT.script"

ENTITY_CONTAINER
{
NAME = "CLOSEUPTEXT"
X = 705
Y = 480
VISIBLE = TRUE
ENTITY = "interface\CLOSEUPWIN\CLOSEUP_TEXT.entity"
}
}


Is this correct, I am not getting the errors now in WME. log but do not see anything on the screen.
mmmmmmmmmmmmmmm tricky this!


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: TEXT issue
« Reply #9 on: March 20, 2007, 01:50:59 PM »

I see. It's incorrect definition.

ENTITY_CONTAINER is relative to window definition. You should put there

X = 0
Y = 0

to have it at position 705,480
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TEXT issue
« Reply #10 on: March 20, 2007, 05:21:45 PM »

Hi,
   Yes I have done this and it is now displaying the text in the window in the right place but the text is not spreading across the window it is bunched into the left corner of the screen and centre alligned.


The screen is 800x600, the window is 800x200 at position  X = 0  Y =600
The entity is set as X=0 Y=0 relative to the window.


It looks like this : -

 The key is made from gold
    and shines in the light
      of the morning sun

Instead of this: -

The key is made from gold and shines in the light of the morning sun
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: TEXT issue
« Reply #11 on: March 20, 2007, 05:24:25 PM »

your window is only 200 pixels wide. That's why. Look at your window definition. Also you can specify width of the entity_region.

in both cases it's the WIDTH = 200 thing which causes the problem.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TEXT issue
« Reply #12 on: March 20, 2007, 05:36:59 PM »

Well I have change this to Width 800 and still the same effect.

Here are the scripts again: -

WINDOW
{
  X = 0
  Y = 600
    WIDTH = 800
  HEIGHT = 200
  NAME = "CLOSEUPWIN"
  TRANSPARENT = TRUE
SCRIPT = "interface\CLOSEUPWIN\CLOSEUP.script"
 
  ENTITY_CONTAINER
{
  NAME = "CLOSEUPTEXT"
  X = 0
  Y = 0
  VISIBLE = TRUE
  ENTITY = "interface\CLOSEUPWIN\CLOSEUP_TEXT.entity"
}
}

and ENTITY SCRIPT


; $EDITOR_PROJECT_ROOT_DIR$ ..\..\..\

ENTITY
{
  NAME="CLOSEUP_TEXT"
  CAPTION="closeup_text"
  ACTIVE=TRUE
  SCALABLE=FALSE
  INTERACTIVE=FALSE
  COLORABLE=FALSE
  FONT = "fonts\outline_white.font"
}


Still have the center alligned and bunched up text to the in the left hand corner of a 800x600 scene.


Sorry about this, and many thanks for your help.
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: TEXT issue
« Reply #13 on: March 20, 2007, 06:02:06 PM »

try this:

ENTITY_CONTAINER
{
  NAME = "CLOSEUPTEXT"
  X = 0
  Y = 0
  HEIGHT = 200
  WIDTH = 800
  VISIBLE = TRUE
  ENTITY = "interface\CLOSEUPWIN\CLOSEUP_TEXT.entity"
}
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TEXT issue
« Reply #14 on: March 20, 2007, 06:13:27 PM »

ok now my window file looks like this: -


WINDOW
{
  X = 0
  Y = 600
    WIDTH = 800
  HEIGHT = 200
  NAME = "CLOSEUPWIN"
  TRANSPARENT = TRUE
SCRIPT = "interface\CLOSEUPWIN\CLOSEUP.script"
 
ENTITY_CONTAINER
{
  NAME = "CLOSEUPTEXT"
  X = 0
  Y = 0
  HEIGHT = 200
  WIDTH = 800
  VISIBLE = TRUE
  ENTITY = "interface\CLOSEUPWIN\CLOSEUP_TEXT.entity
}
}


But I am getting an error message in WME.log

Syntax error in ENTITY_CONTAINER definition
17:09: Error loading WINDOW definition
17:09: Error parsing WINDOW file 'interface\CLOSEUPWIN\CLOSEUPWIN.window'
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: TEXT issue
« Reply #15 on: March 20, 2007, 06:30:16 PM »

A missing closing quotation mark after CLOSEUP_TEXT.entity.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TEXT issue
« Reply #16 on: March 20, 2007, 06:33:16 PM »

no I saw this, this is in place, just not copied over from script. Sorry

WINDOW
{
  X = 0
  Y = 600
    WIDTH = 800
  HEIGHT = 200
  NAME = "CLOSEUPWIN"
  TRANSPARENT = TRUE
SCRIPT = "interface\CLOSEUPWIN\CLOSEUP.script"
 
ENTITY_CONTAINER
{
  NAME = "CLOSEUPTEXT"
  X = 0
  Y = 0
  HEIGHT = 200
  WIDTH = 800
  VISIBLE = TRUE
  ENTITY = "interface\CLOSEUPWIN\CLOSEUP_TEXT.entity"
}
}


But errors still the same in WME .LOG
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: TEXT issue
« Reply #17 on: March 20, 2007, 06:42:55 PM »

All right, actually the entity container doesn't use WIDTH and HEIGHT, because they are not needed. What you need to do is to set the SubtitlesWidth attribute of the embedded entity. This has to be done in script, though.

So, in the code where you're querying the entity, add something like:

Code: WME Script
  1. var ent = container.GetEntity();
  2. ent.SubtitlesWidth = 800;
  3.  
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TEXT issue
« Reply #18 on: March 20, 2007, 08:57:16 PM »

Thanks....this works.

Thanks very much for your help on this topic.    ::rock
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS
Pages: 1 2 [All]
 

Page created in 0.122 seconds with 24 queries.